Rafter length calculator

Enter the building width, roof pitch and rafter size to get the rafter length and the board to buy. Geometry only: rafter size and span come from your building code.

Enter your measurements

ft
Measure across the tops of the walls, outside edge to outside edge.
in 12
Rise in inches for every 12 in of level run (6 = 6/12). A roofer’s pitch gauge or a level and tape will read it.
in
Measured level from the outside of the wall to the end of the tail. Shed roof: the low wall.
The board’s actual depth — a 2×6 is 5½ in deep. It sets the plumb cuts and the birdsmouth.
ft
More options: Ridge · Seat · Tail …
in
Half is deducted from each rafter. A 2× ridge is 1½ in thick.
in
Usually the full width of the top plate: 3½ in on a 2×4 wall, 5½ in on a 2×6 wall. The code minimum is 1½ in of bearing on wood (IRC R802.6).
in
How far the roof runs past the end walls. Adds fly (barge) rafters and lengthens the ridge and sheathing.
Rafter length (top edge, with overhang)93-1/16 in (7 ft 9-1/16 in)
Board length to buy10 ft boards
Rafters needed
26 rafters
Height above plate (HAP) at the wall line
4-3/8 in
Top of ridge board above the wall plates
40 in (3 ft 4 in)
Rise at the building line (measuring line)
36 in (3 ft)
Birdsmouth heel cut (plumb height)
1-3/4 in
Birdsmouth depth, square to the rafter
1-9/16 in
Plumb cut length (ridge and tail)
6-1/8 in
Ridge board depth
2×8 or deeper (plumb cut 6-1/8 in)
Bottom of the tail below the top of the wall (fascia line)
7-3/4 in
Length without overhang
79-11/16 in (6 ft 7-11/16 in)
Rafter length (decimal inches)
93.08 in
Roof angle (plumb-cut angle from square)
26.6 degrees
Pitch
6/12 = 26.57°
Ridge board length (building plus rake overhangs)
192 in (16 ft)
Roof area to sheathe (all slopes)
248 sq ft
How we got this

Run = 12 ft ÷ 2 − ½ × 1.5 in ridge = 71.25 in

Slope factor √(1 + (6/12)²) = 1.118 → 71.25 in × 1.118 = 79.66 in

+ overhang 12 in × 1.118 = 13.42 in → 93.08 in = 93-1/16 in (7 ft 9-1/16 in)

Board: 93.08 + 2.75 plumb-cut allowance (5.5 in × 6/12) = 95.83 in, + 1 in trim = 96.83 in → buy 10 ft boards

Plumb cut 5.5 in × 1.118 = 6.15 in; heel 3.5 in seat × 6/12 = 1.75 in; HAP = 6.15 in − 1.75 in = 4.40 in = 4-3/8 in

Top of ridge board = HAP 4.40 in + run 71.25 in × 6/12 = 40 in (3 ft 4 in) above the plates

Birdsmouth depth = heel 1.75 in × cos 26.6° = 1.57 in — limit ¼ × 5.5 in = 1.38 in → too deep

  • Rafter length is the line length along the top edge, from the ridge plumb cut (after the ridge deduction) to the end of the tail. Mark the birdsmouth heel cut where the rafter crosses the outside of the wall plate.
  • Birdsmouth too deep: the seat notch is 1-9/16 in deep measured square to the rafter — more than ¼ of the 5-1/2 in depth (1-3/8 in), the end-notch limit in IRC R802.7.1 and Figure R802.7.1.1. Cut a seat no longer than 3-1/16 in (still at least 1½ in of bearing, R802.6) or use a deeper rafter.
  • Rafter size, spacing and span, ridge support, ties and uplift connections are set by your local building code and span tables (IRC R802) — this calculator only does the geometry.
Check your codeCode limits vary by jurisdiction — confirm with your building department before you cut or build. (IRC R802)

For this job · affiliate link
Speed square (7 in)Pivot a speed square to 6 on the COMMON scale and one line marks the plumb cut, the birdsmouth and the tail — the same setting on every rafter.
View on Amazon (opens in a new tab)

Next: Hip roof? Hip and valley rafters, then the jack rafters. Then count the roof sheathing.

Quick answers for common sizes

Worked examples for the Rafter Length Calculator
ExampleAnswer
Rafter length for a 24 ft span at 6/12 pitch173-9/16 in (14 ft 5-9/16 in)
Rafter length for a 12 ft shed at 4/1287-3/4 in (7 ft 3-3/4 in)

Rafter length by building width (same pitch, overhang and rafter size)

Rafter length by building width (same pitch, overhang and rafter size)
Building width (outside of wall plates)Rafter length (top edge, with overhang)Board length to buyTop of ridge board above the wall plates
8 ft66-1/4 in (5 ft 6-1/4 in)8 ft boards28 in (2 ft 4 in)
10 ft79-11/16 in (6 ft 7-11/16 in)8 ft boards34 in (2 ft 10 in)
12 ft93-1/16 in (7 ft 9-1/16 in)10 ft boards40 in (3 ft 4 in)
16 ft119-15/16 in (9 ft 11-15/16 in)12 ft boards52 in (4 ft 4 in)
20 ft146-3/4 in (12 ft 2-3/4 in)14 ft boards64 in (5 ft 4 in)
24 ft173-9/16 in (14 ft 5-9/16 in)16 ft boards76 in (6 ft 4 in)
28 ft200-7/16 in (16 ft 8-7/16 in)18 ft boards88 in (7 ft 4 in)

For a gable roof the calculator takes half the width across the wall plates, subtracts half the ridge board and applies the slope factor, then adds the overhang along the slope. It also tells you how deep to cut the birdsmouth and how high the ridge sits. New to this? Words explained.

The rafter math

A common rafter is the hypotenuse of a right triangle: the level run from the wall to the ridge, and the rise that the pitch creates over that run. The slope factor turns any level distance into the length along the slope, so the same factor works for the main rafter and the overhang.

Side view of a common rafter running from a ridge board down over a wall plate to an overhanging tail, labelled with run, rise, pitch, ridge board, plumb cut, birdsmouth, overhang and rafter length.
One side of a gable. The run is measured level from the outside of the wall to the face of the ridge board; the pitch is the rise per 12 of run; the plumb cut sits against the ridge and the birdsmouth (a level seat cut and a plumb heel cut) sits on the wall plate.
run = building width ÷ 2 − ½ ridge thickness   (gable)
slope factor = √(1 + (pitch ÷ 12)²)
rafter = (run + overhang) × slope factor
roof angle = atan(pitch ÷ 12)

Example: a 12 ft wide shed with a 6/12 roof and a 1½ in ridge. Run = 72 − ¾ = 71¼ in. The 6/12 slope factor is 1.118, so plate to ridge is 79.66 in; a 12 in overhang adds 13.42 in, for 93.08 in — about 7 ft 9-1/16 in along the top edge.

Two worked examples go further: Rafter length for a 12 ft shed at 4/12 for a backyard shed, and Rafter length for a 24 ft span at 6/12 pitch for a two-car garage.

The last column is the figure on the “length of common rafters per foot of run” line of a framing square’s rafter table.
PitchAngleSlope factorRafter length per foot of run
3/1214.04°1.03112.37 in
4/1218.43°1.05412.65 in
5/1222.62°1.08313.00 in
6/1226.57°1.11813.42 in
8/1233.69°1.20214.42 in
10/1239.81°1.30215.62 in
12/1245.00°1.41416.97 in

How long a board to buy

The rafter length is a line length along the top edge — not the length of the board. A plumb-cut tail is vertical, so its bottom corner reaches past the end of the top-edge line by the rafter depth × the pitch (rise ÷ 12). Add that, then about 1 in to square up the factory end:

board needed = rafter length + depth × (pitch ÷ 12)   (plumb-cut tail)
                + 1 in trim → next stock length

In the 12 ft, 6/12 example the 93.08 in line is not an 8 ft rafter. A 2×6 (5½ in deep) adds 2.75 in for the plumb cut — 95.83 in — and the 1 in trim makes 96.83 in, just over 96 in, so buy 10 ft boards. A 2×8 (7¼ in) adds 3.63 in: 96.70 in, 97.70 in with trim. At 12/12 the same building needs a 117.73 in line; a 2×6 adds a full 5.5 in (123.23 in) and 12 ft stock. A tail cut square to the rafter needs no plumb-cut allowance, but it won’t take a flat fascia board.

Birdsmouth, HAP and ridge height

The birdsmouth is a seat cut (level, bearing on the top plate) and a heel cut (plumb, against the outside of the wall). The seat length is usually the plate width — 3½ in on a 2×4 wall. The heel cut height is the seat length × rise ÷ 12, and what is left above it is the height above plate (HAP): the distance, measured plumb at the wall line, from the top of the plate to the top of the rafter. Keep the HAP the same on every rafter and the roof plane stays flat.

plumb depth = rafter depth × slope factor
heel = seat × (pitch ÷ 12)
HAP = plumb depth − heel
top of ridge board above the plates = HAP + run × (pitch ÷ 12)
birdsmouth depth (square to the rafter) = heel ÷ slope factor ≤ ¼ × rafter depth

For a 2×6 at 6/12 with a 3½ in seat: plumb depth 5.5 × 1.118 = 6.15 in, heel 1.75 in, HAP 4.40 in (4-3/8 in). On the 12 ft building the top of the ridge board then sits 4.40 + 71.25 × 0.5 = 40.02 in above the plates. The simple rise on the measuring line (36 in for 6 ft of run) is not where the ridge board goes — the HAP and the ridge deduction move it.

The notch depth matters. The 2021 IRC sends rafter notches to R502.8.1 — “Notches at the ends of the member shall not exceed one-fourth the depth of the member” — and Figure R802.7.1.1 draws the birdsmouth with a D/4 maximum, measured square to the rafter. That 2×6 at 6/12 fails with a full 3½ in seat: the notch is 1.57 in against a 1.38 in limit. Cut a seat of about 3 in (the code minimum bearing on wood is 1½ in, R802.6) or use a 2×8, whose limit is 1.81 in. The calculator runs this check and says which way it goes.

The ridge board itself must be “not less in depth than the cut end of the rafter” (R802.3) — the plumb cut, which is deeper than the rafter. A 2×6 at 6/12 has a 6-1/8 in plumb cut, so the ridge is a 2×8.

Overhangs, fascia, rakes and shed roofs

  • Fascia. A plumb tail cut is as tall as the plumb depth (6-1/8 in for a 2×6 at 6/12), so the fascia board must be at least that wide. The bottom of the tail sits the heel height plus overhang × pitch ÷ 12 below the top of the wall — 1.75 + 6 = 7¾ in for a 12 in overhang at 6/12 — which sets the soffit line.
  • Notched tails. R802.7.1.1 allows notches on the overhanging part of a rafter only where at least 3½ in of rafter remains and the overhang is no more than 24 in long.
  • Rake overhangs. Past the gable ends, the roof is carried by fly (barge) rafters — one at each end of each slope, four on a gable — and the ridge board and sheathing run the rake overhang further at each end.
  • Shed roofs. One rafter spans the whole width, so the run is the full building width. With a birdsmouth on both walls, the heel on the high wall sits at the inside face of its plate, so the run between heels is the width minus the high plate’s width, and the high plate must sit that run × pitch ÷ 12 above the low one. Overhangs past both walls simply add to the rafter length.

New to roof framing? Framing basics: rafters, hips and deck joists puts the pieces in order. Hip roofs need two more calculations: the hip and valley rafter calculator (hips run 16.97 in per foot of common run) and the jack rafter calculator for the shortened rafters between the hips and the walls.

Measuring and marking

  1. Measure the building width across the outside of the top plates at several points; walls are rarely perfectly parallel.
  2. Cut one pattern rafter: mark the ridge plumb cut, measure the line length along the top edge, mark the heel cut at the wall line with the HAP above the seat, then add the tail.
  3. Test the pattern at both ends of the building before cutting the rest.
  4. Crown every rafter up — sight down each board and put the bow on top.
CautionRoof framing is structural. Rafter size, spacing, span, ridge beam design, ties and uplift connectors come from your local building code (IRC section R802 for wood roof framing) and span tables — or an engineer. Get a permit where one is required.
CalculatorPlywood Calculator →Count roof sheathing next — enter 2 identical surfaces for a gable.

What you’ll need

As an Amazon Associate we earn from qualifying purchases. Links to products are affiliate links — they cost you nothing extra and help keep these calculators free.

Frequently asked questions

How long is a rafter for a 12 ft wide building with a 6/12 pitch?

About 79⅝ in from ridge to wall plate after a ¾ in ridge deduction, or about 93 in (7 ft 9-1/16 in) along the top edge with a 12 in overhang measured level. A plumb-cut 2×6 tail and a little trimming push the board past 96 in, so buy 10 ft stock. At a lower 4/12 pitch, see Rafter length for a 12 ft shed at 4/12.

How do I find the rafter length from the pitch?

Multiply the level run by the slope factor √(1 + (pitch ÷ 12)²). For a 6/12 roof the factor is 1.118, so each foot of run needs 13.42 in of rafter.

What angle is a 4/12 or 6/12 roof?

A 4/12 roof is about 18.4°, a 6/12 about 26.6°, an 8/12 about 33.7° and a 12/12 exactly 45°.

Why deduct half the ridge board?

Rafters from each side meet the ridge board, not each other. Each rafter is shortened by half the ridge thickness — ¾ in for a 1½ in ridge — measured level, before the slope factor.

What is a birdsmouth cut on a rafter?

A notch where the rafter sits on the wall: a level seat cut that bears on the top plate and a plumb heel cut against the outside of the wall. The calculator measures the run to that heel line, so mark the birdsmouth where the rafter crosses the outside of the plate.

How deep can a birdsmouth cut be?

No deeper than ¼ of the rafter depth, measured square to the rafter — the end-notch limit the 2021 IRC applies to rafters (R802.7.1, R502.8.1), drawn on the birdsmouth in Figure R802.7.1.1. That is 1-3/8 in on a 2×6 and 1-13/16 in on a 2×8. Steep pitches and wide seats hit the limit first; shorten the seat (1½ in of bearing is the minimum) or go up a size.

What does HAP mean in rafter layout?

Height above plate: the plumb distance from the top of the wall plate to the top of the rafter at the wall line. It is the plumb depth of the rafter minus the heel cut — 4-3/8 in for a 2×6 at 6/12 with a 3½ in seat. Keep it the same on every rafter so the roof plane stays flat.

Why is my rafter board longer than the rafter length?

Because the length is measured along the top edge, and a plumb-cut tail’s bottom corner sticks out past it by the rafter depth × pitch ÷ 12 — 2¾ in for a 2×6 at 6/12. Add about 1 in to square the factory end, then pick the next stock length.

Sources