Skip to main content
Gravel Calculator

How to calculate rafter length: pitch, run and the hypotenuse

Published 3 min read

Key Takeaways

  • Rafter length is the hypotenuse of the horizontal run and the rise the pitch produces over it
  • Pitch is entered as rise per 12 inches of run, the standard notation for roof pitch
  • A steeper pitch produces a longer rafter over the same run
  • Rafter size and span capacity depend on span tables and local code, not on this calculation

A rafter runs from the wall plate up to the ridge, and its length is not the same as the horizontal distance it covers. That distance, the run, only tells part of the story; the pitch adds a rise, and the rafter itself is the diagonal line connecting the two.

Rafter length as a right triangle

Pitch is entered as rise per 12 inches of run, for example 6 in 12, meaning the roof climbs 6 inches for every 12 inches of horizontal run. Dividing that number by 12 gives the pitch ratio, and multiplying the ratio by the actual run in feet gives the rise. From there, the rafter length before overhang is the square root of run squared plus rise squared, the Pythagorean theorem applied to the run and rise as the two legs of a right triangle. The overhang past the wall plate, converted from inches to feet, is added on top, since the number needed is the length of board to cut, not just the distance to the wall plate.

What pitch does to the length

A steeper pitch means more of that triangle goes into rise rather than run, so the rafter gets longer for the same run even though the horizontal distance covered has not changed. A 4 in 12 roof and a 12 in 12 roof spanning the same building need noticeably different rafter lengths and different amounts of lumber, which is why entering the actual pitch, rather than a rounded guess, matters for a usable length estimate.

Rafter count and total lumber

Rafter count follows the same spacing logic as joists and studs: building length in inches divided by rafter spacing, rounded up, plus one. Multiplying that count by the per-rafter length gives the total linear footage of rafter lumber the roof needs.

Sizing lumber versus converting pitch

This calculator does a different job from the site’s roof pitch and roof slope calculators. Those tools convert a pitch between notations, for example rise-per-12 to a slope percentage or an angle, without sizing any lumber. This calculator instead takes a pitch you already know and uses it to answer a framing question: how long a board to buy and how many. Neither tool checks whether a given rafter size can actually span the distance: rafter size, ridge beam sizing and span capacity depend on span tables, snow and roof load, and local building code, none of which this calculation checks. Treat the length and count here as a material estimate to shop from, and confirm actual rafter sizing against your local code before building.

Use the rafter calculator to work out rafter length and count from your own run, pitch and spacing. To convert that same pitch between notations, see the roof pitch calculator or the roof slope calculator.