How to calculate rafter length
A common rafter is the hypotenuse of a right triangle: the run is the level distance it covers and the rise is how much it climbs. Roof pitch is the rise per 12 units of run.
run = building width ÷ 2 − ridge thickness ÷ 2 line length = run × √(1 + (pitch ÷ 12)²) overhang = eave overhang × √(1 + (pitch ÷ 12)²) rafter = line length + overhang
The square-root term is the slope factor — the length of rafter per unit of run:
| Pitch | Angle | Slope factor | Rise per foot of run |
|---|---|---|---|
| 3/12 | 14.0° | 1.0308 | 3″ |
| 4/12 | 18.4° | 1.0541 | 4″ |
| 6/12 | 26.6° | 1.1180 | 6″ |
| 8/12 | 33.7° | 1.2019 | 8″ |
| 10/12 | 39.8° | 1.3017 | 10″ |
| 12/12 | 45.0° | 1.4142 | 12″ |
The calculator buys the next stock length above the rafter length plus a small allowance for the plumb cut. On a shed (single-slope) roof the run is the full width and the rafter has an overhang at both ends.
Worked example: 12 ft span, 6/12 pitch
A 12 × 16 ft building with a 6/12 gable roof, 2×6 rafters at 24″ on center, a 2×8 ridge (1½″ thick) and a 12″ eave overhang:
- Run = 72″ − ¾″ = 71¼″.
- Line length = 71.25 × 1.118 = 79.66″ (6′ 7⅝″).
- Overhang = 12 × 1.118 = 13.42″, so the rafter is 93.08″ ≈ 7′ 9″ — buy 8 ft boards.
- Rise = 72″ × 6/12 = 36″ from the top of the wall to the ridge line.
- Rafters = (192 ÷ 24 + 1) × 2 = 18, plus waste.
- Roof area = 2 × (84″ × 1.118) × 16 ft ≈ 250 sq ft = 2.5 squares, or 9 sheets of 4×8 sheathing with a 5% allowance.
Plumb cut, seat cut and birdsmouth
Every common rafter has a plumb cut at the ridge (vertical once installed), a birdsmouth where it sits on the wall, and a tail cut at the eave.
- Plumb cut angle = the roof angle, measured off square. For 6/12 that is 26.6° — the setting on a miter or circular saw. With a speed square, pivot on the 6 of the common scale.
- Seat (level) cut = 90° minus the roof angle, off square (63.4° for 6/12).
- Birdsmouth: the seat cut is as long as the wall is thick (3½″ on a 2×4 wall), and the heel cut is seat × pitch ÷ 12 (1¾″ for 6/12). A common rule is to keep the notch to no more than a third of the rafter depth so enough wood remains above the seat; the calculator warns when the notch is deeper.
Cut one pattern rafter, test it at both ends of the building, and use it to mark the rest.
Ridge, collar ties and ceiling joists
The ridge board runs the length of the building plus any rake overhangs. It is usually one size deeper than the rafters so the full plumb cut bears on it — 2×8 for 2×6 rafters. A ridge board is not a beam: unless the ridge is designed as a structural beam, the outward thrust of the rafters has to be resisted by ceiling joists or rafter ties low in the roof.
Collar ties in the upper third of the roof help hold rafter pairs together in wind; this calculator places one on every other pair. Tick Ceiling joists / rafter ties to add one tie per rafter pair at plate height. Spacing and fastening of ties are set by your building code (IRC R802 in the US).
Rafter size, spacing and sheathing
This calculator counts and measures rafters; it does not size them. The allowable rafter span depends on the snow and dead load, the species and grade, the spacing and whether there is a ceiling attached. Look up your case in the rafter span tables of IRC R802 or the AWC Span Tables for Joists and Rafters, or ask your building department. Sheds and garages often use 2×6 at 24″ on center; houses in snow country need deeper rafters or closer spacing.
Roof sheathing is counted per slope with the long edge of the sheets running along the ridge. 7/16″ OSB is common on rafters at 24″ on center; check the span rating stamped on the panel. For roofs with dormers or hips, add the areas in the plywood and sheathing calculator. Add the result to your lumber list together with the walls from the framing lumber calculator.
Frequently asked questions
How long is a rafter for a 12 ft wide building with a 6/12 pitch?
The line length is about 79⅝″ (6′ 7⅝″) with a 1½″ ridge; with a 12″ overhang the rafter is about 7′ 9″, so 8 ft boards work.
How do I calculate rafter length from pitch?
Multiply the run (half the building width minus half the ridge thickness) by √(1 + (pitch ÷ 12)²), then add the overhang times the same factor. For 6/12 the factor is 1.118.
What angle is a 6/12 pitch?
26.57°. The plumb cut is 26.6° off square and the seat cut 63.4° off square. A 4/12 roof is 18.43° and a 12/12 roof is 45°.
How many rafters do I need?
Building length in inches ÷ spacing, rounded up, plus one — per side of a gable roof. A 16 ft building at 24″ on center needs 9 per side, 18 in all, plus a fly rafter at each end for rake overhangs.
How many squares is my roof?
A square is 100 sq ft of roof surface. Multiply each slope length (including the overhang) by the roof length including rakes, add the slopes and divide by 100. The 12 × 16 ft example above is about 2.5 squares.
What size rafters do I need?
It depends on span, spacing, snow load and species, so use the rafter span tables in IRC R802 or the AWC Span Tables, or your local tables outside the US. This calculator measures and counts the rafters you choose.