Enter the building span, roof pitch, ridge board thickness and overhang. The calculator works out the common rafter length from the ridge to the wall plate line, adds the tail, and tells you the shortest standard board that will do.
Rafter length calculator
How it works
A common rafter is the sloping side of a right triangle whose level side is the run and whose upright side is the rise.
- Run = span ÷ 2 − ridge thickness ÷ 2
- Slope factor = √(1 + (pitch ÷ 12)²)
- Rafter length = run × slope factor
- Tail = level overhang × slope factor
For a 6/12 roof the slope factor is 1.118: every foot of run needs 1.118 ft of rafter. The IRC measures rafter spans horizontally for the same reason (Section R802).
Worked example
A 24 ft wide building with a 6/12 roof, a 1-1/2 in ridge board and a 12 in overhang:
- Building span (outside of wall to outside of wall): 24 ft
- Roof pitch (rise per 12 in of run): 6 in
- Ridge board thickness: 1.5 in
- Overhang (level distance past the wall): 12 in
The calculator gives:
- Rafter length with overhang: 14′ 5-9/16"
- Ridge to wall plate line: 13′ 4-3/16"
- Overhang (tail) along the slope: 1′ 1-7/16"
- Rise over the run: 5′ 11-5/8" over 11′ 11-1/4" of run
- Slope factor: 1.1180
- Shortest stock length: 16 ft
The run is 144 − 0.75 = 143.25 in. Times 1.118, the rafter from ridge to plate is 160.16 in, and the 12 in overhang adds 13.42 in along the slope, for 173.58 in (14 ft 5-9/16 in). A 16 ft board leaves room for the plumb cuts.
Notes and limits
- Length is measured along the top edge of the rafter, from the ridge plumb cut to the tail cut. Lay out the bird’s mouth where the rafter crosses the wall plate line.
- Rafter size and spacing depend on span, snow load, dead load and ceiling attachment (IRC R802 span tables). This tool does not size rafters.
- Hip and valley rafters use a different slope factor; this calculator covers common rafters only.
Frequently asked questions
How do you calculate rafter length?
Halve the span, subtract half the ridge thickness, and multiply by the slope factor √(1 + (pitch ÷ 12)²). Add the overhang times the same factor.
What is the slope factor for a 4/12 roof?
1.054. For 5/12 it is 1.083, for 6/12 1.118, for 8/12 1.202, for 12/12 1.414.
Why subtract half the ridge board?
The two rafters meet the ridge board on either side of it, so each one stops half the ridge thickness short of the center line.
Sources
Last reviewed: 25 September 2026. The calculation is covered by automated tests with known answers taken from the sources above. Found an error? Please let us know.
More framing, roofs & stairs calculators
- Wall Stud Calculator (Studs, Plates & Headers)
- Roof Pitch Calculator (Rise and Run to Pitch)
- Roof Pitch to Degrees Converter (and Degrees to Pitch)
- Roof Truss Calculator (How Many Trusses)
- Stair Calculator: Rise, Run and Stringer Length
- Deck Joist Span Calculator (IRC Table R507.6 Estimate)
- Deck Beam Span Calculator (IRC Table R507.5 Estimate)
- All construction calculators