Rafter length formula
run = span ÷ 2
multiplier = √(1 + (pitch ÷ 12)²)
rafter to the ridge board = (run − ridge board ÷ 2) × multiplier
tail = level overhang × multiplier
plumb cut = atan(pitch ÷ 12); seat cut = 90° − plumb cut
HAP = rafter depth × multiplier − seat × pitch ÷ 1224 ft span, 6/12, 1½-in ridge board, 12-in overhang, 2×8 rafter on a 2×4 wall
Run 12 ft. Theoretical rafter 12 × 1.1180 = 13.42 ft; the ridge board takes off 0.75 in × 1.118 = 0.84 in, leaving 13′ 4 ⅛″ to the face of the ridge. Tail 1 ft × 1.118 = 1.12 ft, total 14′ 5 ⅝″ – cut from a 16 ft board. Plumb cut 26.6°, seat cut 63.4° from square. Birdsmouth: 3.5-in seat, heel 3.5 × 6 ÷ 12 = 1.75 in, height above plate 7.25 × 1.118 − 1.75 = 6.36 in.
Lengths are along the top edge of the rafter, measured from the outside of the wall plate. The tool deducts half the ridge board along the slope; with no ridge board (rafters meeting at a point or a ridge beam you measure to) set the thickness to 0. Sizing (2×6, 2×8, spacing) depends on span, load and species: use the span tables of IRC R802 or an engineer, not a length calculator.
How many rafters do I need?
On each side of a gable roof: building length in inches ÷ spacing, rounded up, plus one for the last rafter. A 40 ft house at 16 in on center: 480 ÷ 16 = 30, + 1 = 31 rafters per side, 62 in total. Rafters around openings (skylights, chimneys) and any doubled rafters are extra; gable-end overhang framing is not counted.
| Building length | 16 in on center | 24 in on center |
|---|---|---|
| 24 ft | 19 per side · 38 total | 13 per side · 26 total |
| 32 ft | 25 per side · 50 total | 17 per side · 34 total |
| 40 ft | 31 per side · 62 total | 21 per side · 42 total |
| 48 ft | 37 per side · 74 total | 25 per side · 50 total |
| 60 ft | 46 per side · 92 total | 31 per side · 62 total |
Cut angles on a speed square
Hold the speed square's pivot on the top edge and swing it until the pitch (6 for 6/12) on the “common” scale lines up with the edge: the square's edge now marks the plumb cut. The seat cut is square to that line. The calculator shows both as degrees from square, which is the setting on a miter or circular saw.
For roofing quantities the same multiplier gives the slope length the shingles cover; see the pitch multiplier chart.
Questions
How do you calculate rafter length?
Half the span is the run. Multiply the run by the slope multiplier √(1 + (pitch ÷ 12)²), then subtract half the ridge board thickness times the same multiplier. A 24 ft span at 6/12 with a 1½-in ridge board gives 13′ 4 ⅛″.
How long is a rafter for a 6/12 pitch?
Each foot of run is 1.118 ft of rafter at 6/12. A 28 ft wide house has a 14 ft run: 14 × 1.118 = 15.65 ft before the ridge board and the tail.
What is HAP on a rafter?
Height above plate: the depth of rafter left above the wall plate after the birdsmouth notch, measured plumb. It sets the roof plane height, so every rafter on a wall needs the same HAP.
Sources
- International Code Council, 2021 International Residential Code, Chapter 9 Roof Assemblies (R905, R908) – 2021 edition.
All sources checked on November 28, 2026.