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
More options: Ridge · Seat · Tail …
- 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
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.
Quick answers for common sizes
| Example | Answer |
|---|---|
| Rafter length for a 24 ft span at 6/12 pitch | 173-9/16 in (14 ft 5-9/16 in) |
| Rafter length for a 12 ft shed at 4/12 | 87-3/4 in (7 ft 3-3/4 in) |
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 buy | Top of ridge board above the wall plates |
|---|---|---|---|
| 8 ft | 66-1/4 in (5 ft 6-1/4 in) | 8 ft boards | 28 in (2 ft 4 in) |
| 10 ft | 79-11/16 in (6 ft 7-11/16 in) | 8 ft boards | 34 in (2 ft 10 in) |
| 12 ft | 93-1/16 in (7 ft 9-1/16 in) | 10 ft boards | 40 in (3 ft 4 in) |
| 16 ft | 119-15/16 in (9 ft 11-15/16 in) | 12 ft boards | 52 in (4 ft 4 in) |
| 20 ft | 146-3/4 in (12 ft 2-3/4 in) | 14 ft boards | 64 in (5 ft 4 in) |
| 24 ft | 173-9/16 in (14 ft 5-9/16 in) | 16 ft boards | 76 in (6 ft 4 in) |
| 28 ft | 200-7/16 in (16 ft 8-7/16 in) | 18 ft boards | 88 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.

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.
| Pitch | Angle | Slope factor | Rafter length per foot of run |
|---|---|---|---|
| 3/12 | 14.04° | 1.031 | 12.37 in |
| 4/12 | 18.43° | 1.054 | 12.65 in |
| 5/12 | 22.62° | 1.083 | 13.00 in |
| 6/12 | 26.57° | 1.118 | 13.42 in |
| 8/12 | 33.69° | 1.202 | 14.42 in |
| 10/12 | 39.81° | 1.302 | 15.62 in |
| 12/12 | 45.00° | 1.414 | 16.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 lengthIn 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
- Measure the building width across the outside of the top plates at several points; walls are rarely perfectly parallel.
- 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.
- Test the pattern at both ends of the building before cutting the rest.
- Crown every rafter up — sight down each board and put the bow on top.
What you’ll need
- Speed square (7 in)Budget price
Marks square and angled crosscuts and doubles as a saw guide for a circular saw. The degree scale is handy for rafters and stair angles.
See options on Amazon (opens in a new tab) - Framing squareBudget price
The tool for laying out stair stringers and rafters: rise on one leg, run on the other.
See options on Amazon (opens in a new tab) - Circular saw (7¼ in)Mid-range price
The most versatile first power saw: crosscuts framing lumber, rips boards and, with a straightedge, breaks down plywood sheets.
See options on Amazon (opens in a new tab) - 25 ft tape measureBudget price
A 25 ft tape with a stiff blade and a readable 1/16 in scale covers everything from cut lists to deck layout.
See options on Amazon (opens in a new tab)
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.
Related guides
Sources
- International Code Council, 2021 International Residential Code, Chapter 8 Roof-Ceiling Construction (opens in a new tab) — R802.3 ridge depth not less than the cut end of the rafter; R802.6 1½ in minimum bearing on wood; R802.7.1 and Figure R802.7.1.1 birdsmouth notch D/4 max, notched tails
- International Code Council, 2021 International Residential Code, Chapter 5 Floors (opens in a new tab) — R502.8.1: notches at the ends of a member not over one-fourth its depth (applied to rafters by R802.7.1)
- US Navy NAVEDTRA 14044, Builder — Chapter 2, Roof Framing (public domain) (opens in a new tab) — line length, shortening, overhang (projection) and shed-roof run by the framing-square method