Building & DIY

Rafter Length from Run & Pitch

Works out the rafter length from the horizontal run and the roof pitch using the Pythagorean theorem, with options for overhang and hip or valley factors. It outputs length, angle, and slope.

Reviewed and updated

How to use
  1. Enter the horizontal run and the roof pitch.
  2. Add an overhang length if the rafter extends past the wall.
  3. Switch on the hip or valley factor for those rafters.
Pitch
Total rafter length

base rafter + sloped tail

Base rafter (no tail)
Vertical rise
Roof angle
Rafter multiplier
Estimates only, allow for waste and confirm against local building codes and supplier specs.
Was this helpful?

A rafter is the hypotenuse of run and rise

The rafter, run and rise form a right triangle. Fix the run (half the building width) and the pitch, and the rest follows.

rafter = run² + rise² ,   rise = run × pitch ⁄ 12

Pitch is written x:12 — x inches of rise for every 12 inches of run. At 6:12 with a 20 ft run, rise = 20 × 6⁄12 = 10 ft, so the rafter is √(400 + 100) = 22.36 ft. That length runs ridge to wall and does not yet include the overhang.

Run is half the span — the number people get wrong

A rafter reaches from the ridge in the center to the wall, so it spans the run, not the full building width. Use the whole width and your rafter comes out twice as long as it should.

Run per side20 ft
Full span40 ft

On a 40 ft building each rafter covers the 20 ft run, from the center ridge out to one wall — never the full span.

Rafter multiplier by pitch

Skip the square root: rafter length per foot of run is a fixed factor for each pitch. Multiply the run by it, then add the tail.

PitchAngleMultiplier (per ft of run)
3:1214.0°1.031
4:1218.4°1.054
6:1226.6°1.118
8:1233.7°1.202
10:1239.8°1.302
12:1245.0°1.414

A 20 ft run at 6:12 is 20 × 1.118 = 22.36 ft — the same answer. Hip and valley rafters run diagonally, so multiply the common rafter by about 1.06.

Common questions

How do I calculate rafter length?

It is the hypotenuse of the run and the rise. Take the square root of run squared plus rise squared, where rise equals run times pitch over 12. For a 20-foot run at 6:12 pitch, rise is 10 feet and the rafter is the square root of 400 plus 100, about 22.36 feet.

Is run the same as the width of the roof?

No, and this is the most common mistake. Run is half the building width, measured from the outside wall to the center ridge. A 40-foot-wide building has a 20-foot run per side.

Does the overhang add to rafter length?

Yes. The tail past the wall is its own small hypotenuse: the square root of the overhang squared plus (overhang times pitch over 12) squared. A 2-foot overhang at 6:12 adds about 2.24 feet.

From the blog

Guides & how-tos

All articles →