Enter the width of the building, the roof pitch and the overhang. The calculator gives the rafter length, the rise, the roof angle, the board length to buy and how many rafters you need.
Rafter length is measured along the top edge from the ridge to the end of the overhang. Size your rafters from span tables or your plans.
How rafter length is calculated
- Run: half the building width, minus half the thickness of the ridge board.
- Slope factor: the square root of 1 + (pitch ÷ 12)². For a 6/12 roof that’s 1.118.
- Rafter length: (run + overhang) × slope factor.
- Rise: half the building width × pitch ÷ 12.
The overhang is measured level, from the outside of the wall to the end of the rafter tail.
Worked example
A building 24 ft wide with a 6/12 roof, a 1½ inch ridge board and a 12 inch overhang:
- Run: 12 ft − ¾ in = 11 ft 11¼ in
- Run plus overhang: 12 ft 11¼ in, or 12.94 ft
- Rafter length: 12.94 × 1.118 = 14 ft 5⅝ in
- Board to buy: 16 ft
- For a 40 ft building at 16 inches on center: 31 rafters each side, 62 in total
Roof pitch, angle and slope factor
| Pitch | Roof angle | Slope factor |
|---|---|---|
| 4/12 | 18.4° | 1.054 |
| 5/12 | 22.6° | 1.083 |
| 6/12 | 26.6° | 1.118 |
| 7/12 | 30.3° | 1.158 |
| 8/12 | 33.7° | 1.202 |
| 9/12 | 36.9° | 1.250 |
| 10/12 | 39.8° | 1.302 |
| 12/12 | 45.0° | 1.414 |
The roof angle is also the angle for the plumb cut at the ridge on a speed square.
Rafter size
The calculator gives the length, not the size. Whether you need 2×6, 2×8 or larger depends on the span, the snow and dead loads, the spacing and the wood grade. Use the rafter span tables in your local building code or follow your plans.
Frequently asked questions
How do I calculate rafter length?
Take half the building width, subtract half the ridge board, add the overhang, and multiply by the slope factor for your pitch.
What length rafter do I need for a 24 ft span?
For a 6/12 roof with a 12 inch overhang, about 14 ft 5⅝ in, so buy 16 ft boards. Steeper roofs need longer rafters.
What is a 6/12 roof pitch?
The roof rises 6 inches for every 12 inches it runs level, which is an angle of about 26.6 degrees.
How many rafters do I need?
Divide the building length in inches by the spacing, round up, add one, and double it for both sides of a gable roof.
Is this for hip or valley rafters?
No, it’s for common rafters on a gable roof. Hip and valley rafters run at an angle and use different factors.
Results are for planning. Size rafters from span tables or your plans. See How We Calculate for the formulas we use.
