Rafter length calculator
Enter the run and pitch, get the rafter length.
How do I calculate rafter length?
Multiply the run by √(1 + (rise ÷ 12)²). For a 6/12 roof that is 13.42 inches of rafter for every foot of run, so a 12-foot run needs a 13 ft 5 in rafter before cuts.
What is the run?
The horizontal distance the rafter covers — usually half the building width, measured to the center of the ridge.
How do I add the overhang?
Enter the horizontal overhang; the calculator adds it along the slope using the same factor.
What are the unit lengths for common pitches?
4/12: 12.65 in per foot of run; 6/12: 13.42; 8/12: 14.42; 12/12: 16.97.
Is this the length to cut?
It is the theoretical line length. Subtract half the ridge board thickness and lay out the plumb and seat cuts, as framing guides describe.
Which span do the rafter span tables use?
The horizontal one. Section R802.4.1 of the 2021 International Residential Code says rafter spans are measured along the horizontal projection of the rafter, so a rafter with a 12 ft run is looked up at 12 ft, not at its sloped length. The tables also depend on the species, grade, spacing and loads, so use the one that matches your roof and have the framing checked against the code your jurisdiction has adopted.
Why is the plumb cut at the ridge longer than the rafter is deep?
Because the cut slices the board at a slant. Its length is the board depth times the same slope factor: a 2×6 rafter, 5½ inches deep, at 6/12 has a 6.15-inch plumb cut. The 2021 IRC (R802.3) says a ridge board must be at least 1 inch nominal thick and at least as deep as the cut end of the rafter.
How the length is found
A common rafter is the hypotenuse of a right triangle whose legs are the run and the rise. The pitch is the rise in inches for every 12 inches of run, so the rafter is √(1 + (pitch ÷ 12)²) times the run: 1.118 at 6/12. Framing-square rafter tables print the same number per foot of run, and old carpentry texts multiply it by the run in feet. The result is the line length, measured along the slope from the outside of the wall to the center of the ridge. It is not the length of the board to cut: the seat cut, the plumb cut and the ridge allowance still have to be laid out.
Worked example
A 24 ft wide building has a 6/12 roof and a 12 inch overhang. The run is 12 ft, so the main length is 12 × 1.118 = 13.42 ft. The overhang, 1 ft horizontally, adds 1 × 1.118 = 1.12 ft along the slope, for 14.53 ft in all, or 14 ft 6.4 in. The ridge rises 6.0 ft and the roof angle is 26.6°. If the ridge is a nominal 2-inch board, 1½ inches thick, the plumb cut sits ¾ inch short of the center of the ridge along the run, which is 0.84 inches along the slope, so the line length shortens to 14 ft 5.6 in.
Common mistakes
Taking the whole building width as the run is the commonest error; for a symmetrical gable the run is half the span. Entering the overhang as a length along the slope double counts the slope factor, because the calculator expects the horizontal overhang. Using the sloped length where the span tables want the horizontal span is another. And a pitch in degrees must be converted to rise per 12 first; the roof pitch calculator does that.
Sources: International Residential Code 2021, sections R802.3 and R802.4.1 (ICC, codes.iccsafe.org, read October 27, 2026); I. S. Griffith, Carpentry, section 17, “To Find the Length of a Common Rafter” (framing-square table, 13.42 inches per foot of run at quarter pitch); NIST Voluntary Product Standard PS 20, American Softwood Lumber Standard (dressed sizes). Related: roof pitch calculator, roof calculator, framing calculator, pergola calculator. How we check our calculators.