How to find the length of a common rafter
A common rafter runs from the ridge down to the wall plate on a gable roof. Each side covers half of the building width, less half of the thickness of the ridge board that sits between the two sides. That horizontal distance is the run. The rafter is the hypotenuse of a right triangle whose base is the run, so its length follows from the pitch.
Run = (span − ridge board thickness) ÷ 2
Rise = run × pitch ÷ 12
Line length = run × √(1 + (pitch ÷ 12)²)
Overhang along the slope = overhang × √(1 + (pitch ÷ 12)²)
Total length = line length + overhang along the slope
The line length is the distance along the top edge of the rafter from the face of the ridge board to the outside of the plate. The overhang is measured horizontally from the plate, and it is stretched by the same slope multiplier, so a 12-inch overhang at 6/12 needs about 13.4 inches of rafter. The pitch multiplier is the same one used on the roof pitch calculator.
Worked example: a 24 ft wide building at 6/12
The building is 24 feet wide. The roof is 6/12, the overhang is 12 inches and the ridge board, sold as 2 inches thick, actually measures 1.5 inches.
- Run: (24 − 0.125) ÷ 2 = 11.9375 ft (1.5 inches is 0.125 ft)
- Rise: 11.9375 × 6 ÷ 12 = 5.969 ft
- Multiplier: √(1 + 0.5²) = 1.118
- Line length: 11.9375 × 1.118 = 13.35 ft, about 13 ft 4 in
- Overhang along the slope: 1 × 1.118 = 1.12 ft
- Total rafter: 13.35 + 1.12 = 14.46 ft, about 14 ft 6 in
- Roof angle: 26.57 degrees
Lumber is sold in set lengths, so the 14.46-foot rafter comes from a 16-foot board. Without any overhang the same roof needs 13.35 feet. At a steeper 9/12 pitch the total rises to 16.17 feet.
Standard lumber lengths for rafters
Kreg Tool lists 6 to 20 feet in 2-foot steps as the usual stock. The calculator rounds your total up to the next even foot. Lengths from 6 to 20 feet are the usual stock; 22- and 24-foot boards may be available depending on the supplier and species, so check before you plan around them. Beyond 24 feet it tells you that the rafter is longer than these lengths, and you would look at engineered lumber or trusses instead.
| Building span (ft) | Line length (ft) | Total with overhang (ft) | Next even length (ft) |
|---|---|---|---|
| 12 | 6.64 | 7.76 | 8 |
| 16 | 8.87 | 9.99 | 10 |
| 20 | 11.11 | 12.23 | 14 |
| 24 | 13.35 | 14.46 | 16 |
| 28 | 15.58 | 16.7 | 18 |
| 32 | 17.82 | 18.94 | 20 |
The next even length is only the board you must buy. For the lumber you need in all, count the rafters, which stand at a spacing set by your plans, and use the board foot calculator to price them.
What the length does not include
The line length is measured along the top of the rafter from the face of the ridge board to the outside of the wall plate. It does not include the plumb cut at the ridge, the bird's mouth notch where the rafter sits on the plate, or a fascia board. The size of the rafter board, the spacing, span tables and load rules come from your plans or your local building code, and this tool does not check them. For a roof with a hip, valley or a different pitch on each side the lengths are different, and a structural engineer or the plan should give them.
Rafter length by roof pitch
The same 24-foot building needs a longer rafter as the roof gets steeper, because the slope multiplier grows. At 4/12 the total with the same overhang is 13.64 feet, at 6/12 it is 14.46 feet, at 9/12 it is 16.17 feet and at 12/12 it is 18.3 feet. A steeper roof also has a taller ridge, with a rise of 8.95 feet at 9/12 against 5.97 feet at 6/12 for this span.
Rafter Calculator FAQ
How do I calculate rafter length?
Take half of the span minus half of the ridge board for the run, multiply by √(1 + (pitch ÷ 12)²), and add the overhang times the same multiplier. For a 24 ft span at 6/12 with a 12 in overhang the total is 14.46 ft.
Why do you subtract the ridge board?
The two rafters meet either side of the ridge board, so each one starts half of its thickness short of the center line. With a 1.5-inch board that is 0.75 inch on each side, which shortens the run to 11.9375 ft in the example.
What length of lumber do I buy for a 14-foot rafter?
Lumber comes in 2-foot steps, so a rafter just over 14 feet needs a 16-foot board.
Is the overhang measured along the rafter or horizontally?
Horizontally, from the outside of the wall plate. The calculator converts it to the length along the slope, which is longer by the same multiplier as the rest of the rafter.
Does this work for a hip or valley rafter?
No. It is for common rafters on a gable roof, with the same pitch on both sides. Hip and valley rafters run diagonally, so their lengths need a different calculation.