Understanding the rafter length calculator — concept and principle
This calculator works out the length of a common rafter for a gable roof from the building span, pitch, overhang and ridge-board thickness, plus the ridge rise, the pitch in both forms and the slope factor. Carpenters and DIY builders use it to order timber and lay out rafters for sheds, garages and extensions.
How it is calculated
- Run = span ÷ 2 − ridge thickness ÷ 2 (the rafter stops at the ridge board's face).
- Pitch in rise-per-12 is converted with θ = arctan(rise ÷ 12).
- Rafter length (ridge to wall) = run ÷ cos θ.
- Overhang along the slope = level overhang ÷ cos θ; total = (run + overhang) ÷ cos θ.
- Ridge rise above the wall plate = span ÷ 2 × tan θ; slope factor = 1 ÷ cos θ.
The principle
A common rafter is the sloping side of a right triangle: the run is the level distance from the wall to the ridge, the rise is the vertical height, and the rafter is the hypotenuse. Dividing the run by the cosine of the pitch gives the sloping length. Each rafter stops at the face of the ridge board, so half the board's thickness is taken off each run. The slope factor, 1 ÷ cos θ, turns any level distance into a distance along the slope; for a 30° roof it is 1.1547.
Worked example
Default inputs: span 7.2 m, pitch 30°, overhang 0.45 m, ridge board 38 mm.
- Run = 3.6 − 0.019 = 3.581 m; cos 30° = 0.8660.
- Rafter to wall = 3.581 ÷ 0.866 = 4.135 m.
- Overhang along slope = 0.45 ÷ 0.866 = 0.52 m; total = 4.655 m (15.27 ft).
- Ridge rise = 3.6 × tan 30° = 2.078 m; pitch = 30° = 6.93 in 12; slope factor 1.1547.
| Building span, outside wall to outside wall (m) | Rafter length incl. overhang (m) |
|---|---|
| 1.8 | 1.537 |
| 3.6 | 2.576 |
| 5.4 | 3.615 |
| 7.2 | 4.655 |
| 9 | 5.694 |
| 10.8 | 6.733 |
| 14.4 | 8.812 |
How to read the result
Lengths are along the rafter's measuring line from the ridge face to the tail. Buy stock at least one standard length longer to allow for the plumb cut, birdsmouth and tail cut. Check the ridge rise against any height limits for the building.
Common mistakes
- Forgetting to deduct half the ridge board.
- Using the overhang measured along the slope as if it were level.
- Confusing pitch in degrees with rise in 12.
- Measuring the span inside the walls instead of outside.
Frequently asked questions
How do I calculate rafter length?
Divide the run by the cosine of the pitch and add the overhang divided by the same cosine.
What is a 30° roof in rise per 12?
About 6.93 in 12.
Why deduct half the ridge board?
Each rafter stops at the face of the ridge board, not at the centre line.
Sources: J. Anderson, "Laying Out a Common Rafter", Fine Homebuilding no. 165 (2004) · NIST Special Publication 811 (2008), Appendix B (1 ft = 0.3048 m)