PLANKMATH

Rafters

Width and pitch in. Out come the rafter length to the sixteenth, the board to buy, how many, the ridge, and the cuts to mark.

Layout and material count only. Rafter size, spacing and connections come from the span tables or an engineer, and roof framing is permitted and inspected work in most places. Check with your building department before you cut.

The building
outside of plate to outside of plate
The rafters
for the cuts only, not a size check
3½ for a 2×4 wall, 5½ for a 2×6
doubled ends, barge or fly rafters
On the counter

Your buy list

0

2×8 rafters · — each
Rafters
—
Ridge board
—
Roof surface
—
Estimated cost
—
Run
—
Rise
—
Pitch
—
Line length
—
Overhang, on the slope
—
Rafter length
—
Board needed
—
Plumb cut
—
Plumb cut depth
—
Seat cut
—
Heel cut
—
Height above plate
—
Birdsmouth depth
—

Checks, not a certification

  • —
  • —
  • —
  • —
  • —
  • —
  • —
  • —

Code figures from the 2021 IRC. Local codes amend them.

Shingle this roof

Opens the roofing calculator with this roof surface and its eave, rake and ridge lengths filled in.


Run, pitch factor, rafter

A common rafter is the long side of a right triangle. The level side is the run, from the outside of the wall plate to the face of the ridge board. On a gable that is half the building width less half the ridge's thickness. The upright side is the rise, the pitch times the run. The rafter is the run times the pitch factor, √(1 + (rise ÷ 12)²), which is fixed for a pitch. A 24 ft gable with a 2× ridge has an 11 ft 11¼ in run. At 6/12 the factor is 1.118 and the rafter is 13 ft 4 3/16 in to the plumb line over the outside of the wall. The overhang goes through the same factor, so 12 in out from the wall is 13 7/16 in along the rafter, for 14 ft 5 9/16 in in all.

PitchFactorLine lengthWith 12 in overhangBoard
4/12 1.054 12 ft 7 in 13 ft 7 5/8 in 16 ft
5/12 1.083 12 ft 11 3/16 in 14 ft 3/16 in 16 ft
6/12 1.118 13 ft 4 3/16 in 14 ft 5 9/16 in 16 ft
7/12 1.158 13 ft 9 13/16 in 14 ft 11 3/4 in 16 ft
8/12 1.202 14 ft 4 3/16 in 15 ft 6 9/16 in 18 ft
9/12 1.250 14 ft 11 1/16 in 16 ft 2 1/16 in 18 ft
10/12 1.302 15 ft 6 1/2 in 16 ft 10 1/16 in 18 ft
12/12 1.414 16 ft 10 9/16 in 18 ft 3 9/16 in 20 ft

The table is a 24 ft wide gable with a 2× ridge, 2×8 rafters and a 12 in overhang. The board column allows for the lean of the two plumb cuts and 2 in of trim. Rafters are measured along the top edge here. Any line parallel to the edge gives the same length between the two plumb lines, so a framer who lays out on a measuring line lower down the board gets the same figure.

Marking the cuts

On a framing square, hold the rise on the tongue and 12 on the blade against the top edge. The tongue marks the plumb cut at the ridge and at the tail, and the blade marks the level seat. A speed square does the same from its pivot, set to the roof angle in degrees or to the rise on the common scale. Both plumb cuts lean, so a board's bottom corner at each end sits past the top corner by the rafter depth × rise ÷ 12. That is 3⅝ in on a 2×8 at 6/12, and it is why a rafter that measures 14 ft 5 9/16 in still wants a 16 ft board. Cut one pattern rafter, try it against the ridge and the plate at both ends of the building, then use it to mark the rest.

The birdsmouth

The seat cut sits level on the wall plate and the heel cut is plumb against the outside of the wall. With a full 3½ in seat at 6/12, the heel is 1¾ in and the notch is 1 9/16 in deep square to the edge, which leaves 6⅜ in of a 2×8 standing above the plate. The 2021 IRC sends rafter notches to the joist rules, which allow a notch at the end of a member up to one-fourth of its depth (R802.7.1, R502.8.1). The steeper the pitch or the shallower the rafter, the sooner a full-width seat breaks that. At 8/12 a 2×8 on a 3½ in plate is notched 26.8 %, and the seat should stop at 3¼ in. That still clears the 1½ in of bearing the code asks for on wood (R802.6). The Journal of Light Construction's framing Q&A works the limit the same way, square to the edge. It also recommends a seat no wider than the plate, which keeps the heel tight to the wall.

Ridge, ties and what holds the walls

The ridge board has to be at least as deep as the rafter's plumb cut (R802.3). That cut is deeper than the rafter itself, so a 2×8 at 6/12 needs a 2×10 ridge and a 2×6 at 12/12 needs a 2×10 too. A ridge board only connects the rafters. It holds the roof up only when something ties the walls together. That is ceiling joists or rafter ties in the bottom third of the rafter height, 2×4 at least and no more than 24 in apart for rafter ties (R802.5.2, R802.5.2.2). Without them, or on a gable flatter than 3/12 (R802.4.4), the ridge has to be a beam designed by an engineer and carried to the ground, which this page does not size. Collar ties are a separate job. Where you use them, they go in the upper third of the attic, 1×4 at least and no more than 4 ft apart, and a ridge strap can replace them (R802.4.6).

Code figures behind the checks

CheckFigureSource
Ridge board1 in nominal min; as deep as the rafter's cut end2021 IRC R802.3
Low pitchUnder 3/12, ridges, hips and valleys are designed as beams2021 IRC R802.4.4
BirdsmouthEnd notch ¼ of the depth max2021 IRC R802.7.1, R502.8.1
Bearing1½ in min on wood or metal, 3 in on masonry2021 IRC R802.6
Notched tail3½ in left; cantilever 24 in max2021 IRC R802.7.1.1
Rafter ties2×4 min, 24 in on centre max, bottom third2021 IRC R802.5.2, R802.5.2.2
Collar tiesUpper third, 1×4 min, 4 ft on centre max2021 IRC R802.4.6
Rafter size and spacingNot checked2021 IRC R802.4.1 span tables

Once the frame is worked out, the roofing calculator turns the roof surface into shingles, underlayment and drip edge, and the siding calculator covers the gable ends.


On the counter

The assumptions and limits this calculator uses. The form exposes the settings you can change; fixed allowances are described below.

Building width
Outside of wall plate to outside of wall plate, the way the plans dimension it
Run
Gable: half the width less half the ridge thickness. Shed: the full width. Measured level from the outside of the wall plate
Line length
Run × the pitch factor √(1 + (rise ÷ 12)²), along the top edge, from the ridge plumb cut to the plumb line over the outside of the wall
Overhang
Entered level, out from the wall, and turned into a length along the slope with the same factor. On a shed roof it is at the low eave only. An overhang at the high wall is not added, so add its slope length yourself
Board length
Rafter length, plus depth × rise ÷ 12 because both plumb cuts lean and the bottom corner of each sits that far past the top, plus a trim allowance (2 in by default) for squaring the end. Bought in the next even length from 8 to 24 ft. Over 20 ft most yards order it in
Rafter stock
Used only for the plumb cut, the birdsmouth, the ridge depth and the board lean. The default 2×8 is not a size recommendation. Actual depths: 5½, 7¼, 9¼ and 11¼ in
Spacing
16 in on centre by default because it is a common layout for site-built rafters, not because it suits your roof. The span tables cover 12, 16, 19.2 and 24 in
Count
Length ÷ spacing rounded up, plus one, on each side of a gable. Extras (doubled end rafters, barge or fly rafters) are added as whole boards of the same stock
Ridge board
The building length plus any rake overhang at each end. It must be at least as deep as the rafter's plumb cut (IRC R802.3), so the shallowest of 2×6 to 2×14 that covers it is used. Bought in 8, 12, 16 or 20 ft lengths, multiples of 48 in, so a joint can land on a rafter pair at 12, 16 or 24 in spacing. The order uses whichever lengths add up to the fewest feet. A doubled ridge doubles the count
Birdsmouth
A level seat as long as the plate is wide (3½ in for a 2×4 wall) and a plumb heel of seat × rise ÷ 12. The notch depth is measured square to the rafter edge: seat × sin(roof angle). It is checked against one-fourth of the rafter depth (IRC R802.7.1 → R502.8.1)
Height above plate
The plumb cut depth less the heel, measured plumb over the outside of the wall. Rafters with the same figure line up along the top
Roof surface
Both planes to the ridge line, eave and rake overhangs included: (half width + overhang) × pitch factor × (length + rake overhangs), × 2 for a gable. The roofing link carries this with the eave, rake and ridge lengths
Estimated cost
Before tax and delivery, and only the lines you priced
Not included
Rafter ties, collar ties, ceiling joists, blocking, hangers and straps, fascia and sub-fascia, sheathing, hip and valley rafters, jacks, and anything a roof with more than two planes needs

Questions from the aisle

How long a rafter do I need?

Take half the building width, less half the ridge board, and multiply by the pitch factor. Then add the overhang along the slope. On a 24 ft wide gable at 6/12 with a 1½ in ridge and a 12 in overhang, the run is 11 ft 11¼ in. The rafter is 13 ft 4 3/16 in to the outside of the wall and 14 ft 5 9/16 in with the overhang, which comes out of a 16 ft board. A 28 ft gable at 8/12 needs 17 ft 11 7/16 in of rafter, and a 30 ft gable at 6/12 needs 17 ft 9 13/16 in. Once the plumb cuts are allowed for, each of those needs a 20 ft board (2×8 and 2×10 respectively).

How do I work out rafter length from the pitch?

Multiply the run by the pitch factor, √(1 + (rise ÷ 12)²). That is the long side of a triangle 12 in across and the rise up. The factor is 1.054 at 4/12, 1.118 at 6/12, 1.202 at 8/12 and 1.414 (√2) at 12/12. A run of 11 ft 11¼ in (143.25 in) at 6/12 is 143.25 × 1.118 = 160.16 in, or 13 ft 4 3/16 in along the rafter. The overhang works the same way: 12 in level is 13 7/16 in along the slope.

How many rafters do I need?

Divide the building length by the spacing, round up, and add one to close the last space. That gives one side; a gable has two. A 24 × 36 ft gable at 16 in on centre has 27 spaces, so it takes 28 rafters a side and 56 in all. With 2×8 rafters at 6/12, its 36 ft ridge is three 12 ft 2×10s. At 24 in on centre the same building takes 19 a side, 38 in all. A 12 × 16 ft shed at 16 in takes 13. Doubled end rafters and barge rafters for a rake overhang go in the extras box.

What size rafters do I need?

This page does not size them, on purpose. The size and spacing a rafter needs depend on its span, the snow and dead loads, the species and grade of the lumber, and whether a ceiling hangs from it. The answer comes from the rafter span tables in IRC R802.4.1, the American Wood Council span tables the code points to for other species, grades and loads, or an engineer. Your building department can tell you the snow load it designs to and which tables it accepts. The stock you pick here only drives the cut figures: the plumb cut, the birdsmouth, the ridge depth and the board length.

What is a birdsmouth, and how deep can it be?

A birdsmouth is the notch near the foot of a rafter that lets it sit flat on the wall plate. It is a level seat cut and a plumb heel cut. The 2021 IRC limits a notch at the end of a rafter to one-fourth of its depth (R802.7.1, which points to R502.8.1). It also asks for at least 1½ in of bearing on wood (R802.6). This calculator measures the notch square to the rafter's edge. A 2×8 at 6/12 with a full 3½ in seat is notched 1 9/16 in deep, 22 % of the board. A 2×6 on the same wall is notched 28 %, so cut its seat no longer than 3 1/16 in. On a 2×6 wall, a full 5½ in seat would notch a 2×8 at 6/12 by 34 %, so it should not take the whole plate. People read this limit differently for birdsmouths, so ask your inspector how they apply it.



Next off the wall

The rest of outdoor structures — most jobs need two or three of these before the first trip to the store.

All outdoor structure calculators Every calculator on the board

The reasoning behind this one

Roofing squares, pitch and bundles

Where the assumptions above come from, what changes them, and the mistakes that cost a second trip. Free to read, no account needed.