How to use the rafter length & roof pitch calculator
A rafter runs from the wall to the ridge at the roof angle. Enter the building width and pitch to get the rafter length, roof height, angle and how many rafters to buy.
Enter your measurements in the boxes above. Every result updates as you type, and you can add a price to see the total cost. Use Copy result to save the numbers to your phone before you go to the store.
Formula
Run = span ÷ 2 Pitch factor = √(1 + (rise ÷ 12)²) Rafter length = (run + overhang) × pitch factor
Worked example
With building width (span) 24 ft, roof pitch: 6/12, overhang (level) 12 in, building length 30 ft, rafter spacing: 16 in on center, you need 14.53 ft rafters (roof rise: 6.00 ft; pitch angle: 26.6°).
Quick reference chart
Common sizes worked out with the same formula and the default settings above.
| Pitch | Angle | Rafter (24 ft span) |
|---|---|---|
| 3/12 | 14.0° | 13.40 ft |
| 4/12 | 18.4° | 13.70 ft |
| 5/12 | 22.6° | 14.08 ft |
| 6/12 | 26.6° | 14.53 ft |
| 8/12 | 33.7° | 15.62 ft |
| 10/12 | 39.8° | 16.92 ft |
| 12/12 | 45.0° | 18.38 ft |
Tips before you buy
- The result is measured along the top edge. Subtract half the ridge board thickness when you cut.
- Lumber comes in even lengths, so buy the next even size up.
- Check rafter size against a span table for your snow load.
Frequently asked questions
How long is a rafter for a 24 ft building with a 6/12 pitch?
About 14.5 ft including a 12 inch overhang, so buy 16 ft boards.
What is roof pitch?
How many inches the roof rises for every 12 inches of horizontal run. 6/12 rises 6 inches per foot.
How do I convert pitch to degrees?
Angle = arctan(rise ÷ 12). A 6/12 pitch is about 26.6°.