What the rafter calculator works out
It lays out the common rafters for a gable roof, the kind with two sloping sides that meet at a ridge. You get the rafter length, the angle and position of every cut, the number of rafters, the ridge board size and the roof area for sheathing.
Why rafter length is worth calculating
Every rafter on a roof is a copy of the first one. If the pattern rafter is 1/4 inch out, the ridge ends up too high or too low along the whole building, and the birdsmouths do not sit on the wall. Working the length out from the pitch gives you a pattern you can trust before you cut 40 more.
Where to measure for rafters
Measure the building width across the top plates, from the outside of one wall to the outside of the other. Measure it at both ends, because walls are rarely parallel. The overhang is measured level, straight out from the wall, not along the slope. Building length is measured along the ridge.
How rafter length is calculated
The run is half the building width, less half the thickness of the ridge board. The rafter is the long side of a right triangle with the run along the bottom and the rise up the side. For any pitch, that long side is the run times a fixed pitch factor.
Run = (building width − ridge thickness) ÷ 2
Rafter length = run × √(pitch² + 12²) ÷ 12
Roof rise = run × pitch ÷ 12
Worked example
A building 24 feet wide with a 6 in 12 roof and a 1 1/2 inch ridge board: the run is (288 − 1 1/2) ÷ 2 = 143 1/4 inches. The pitch factor for 6 in 12 is 1.118, so the rafter is 160 3/16 inches, or 13 feet 4 3/16 inches, from the ridge cut to the outside of the wall. A 12 inch overhang adds 13 7/16 inches of tail. With the plumb cut at the tail, each rafter needs a board 14 feet 9 3/16 inches long, so buy 16 foot boards.
Pitch factors
| Pitch | Angle | Factor | Rafter per foot of run |
|---|---|---|---|
| 3 in 12 | 14.0° | 1.031 | 12 3/8" |
| 4 in 12 | 18.4° | 1.054 | 12 5/8" |
| 5 in 12 | 22.6° | 1.083 | 13" |
| 6 in 12 | 26.6° | 1.118 | 13 7/16" |
| 8 in 12 | 33.7° | 1.202 | 14 7/16" |
| 10 in 12 | 39.8° | 1.302 | 15 5/8" |
| 12 in 12 | 45.0° | 1.414 | 17" |
Good to know
- This calculator does not size the rafters. A rafter that is long enough can still be too weak for the span and the snow load. Check the IRC rafter span tables or your building department.
- It covers common rafters on a plain gable roof. Hip, valley and jack rafters have different lengths and cuts.
- Lengths are measured along the top edge of the rafter, between plumb lines.
- The rafter count is one pair at every layout mark plus the pair at the end. Add extra for a gable overhang.