Key takeaways
- Rafter length is the level run multiplied by the slope multiplier for your pitch.
- A ridge board shortens each rafter's run by half the board's thickness.
- This tool gives length only, not the rafter size or spacing your code requires.
Enter the span from outside wall to outside wall, your pitch, and any overhang. The overhang is the level distance past the wall, not the length along the slope.
How the calculator works
- Run: (span − ridge board thickness) ÷ 2
- Slope multiplier: √(1 + (pitch ÷ 12)²)
- Ridge to wall: run × multiplier
- Overhang length: level overhang × multiplier
- Total: ridge to wall + overhang length
Worked example
A 24-foot span with a 6/12 pitch, a 12-inch overhang and a 1½-inch ridge board:
| Step | Math | Result |
|---|---|---|
| Run | (288 in − 1.5 in) ÷ 2 | 143.25 in |
| Multiplier for 6/12 | √(1 + 0.5²) | 1.118 |
| Ridge to wall | 143.25 × 1.118 | 13 ft 4 ⅛ in |
| Overhang | 12 × 1.118 | 1 ft 1 ⅜ in |
| Total | 14 ft 5 ⅝ in |
The next even stock length is 16 feet, which leaves room for cuts. Framing lumber is typically sold in even-foot lengths, so check what your supplier stocks.
What this calculator doesn't do
- Size the rafter: the depth, grade and spacing depend on span, load and your local code. Check your building department's rules or ask an engineer.
- Lay out the cuts: it doesn't work out plumb cuts or birdsmouth notches. Ridge-board and tail details can change the cut length slightly, so measure your first rafter before you cut the rest.
- Handle hips and valleys: hip and valley rafters run at an angle across the plan, so they need a different calculation.
To find your pitch first, use the roof pitch calculator. To work out the area these rafters cover, use the roof area calculator.
How pitch changes the lumber you buy
On a 24-foot span with no ridge board or overhang, pitch alone can move you up a stock length:
| Pitch | Rafter length | Shortest even stock |
|---|---|---|
| 4/12 | 12.65 ft | 14 ft |
| 6/12 | 13.42 ft | 14 ft |
| 8/12 | 14.42 ft | 16 ft |
| 10/12 | 15.62 ft | 16 ft |
| 12/12 | 16.97 ft | 18 ft |
Adding an overhang lengthens each one further, so check the stock length before you price the job.
Frequently asked questions
Is the span measured inside or outside the walls?
This calculator expects the distance between the outside edges of the walls, where the rafters land. Measure the way your plans do, because some details differ.
Why does the ridge board matter?
Each rafter stops at the face of the ridge board rather than the center of the building. So each run is shorter by half the board's thickness.
What if I have no ridge board?
Enter 0. That gives the theoretical length from the center of the building to the wall line.
What size rafter do I need?
This tool can't tell you. Sizing depends on span, spacing, lumber grade and roof loads, and those vary by location. Use your local code's tables or an engineer.
Sources
We use primary sources where we can: building codes, federal rules and manufacturer documents. Read our editorial standards.
- 2021 International Residential Code, Chapter 8, Section R802 (wood roof framing, including rafter rules and span tables)