Rafter length and roof pitch calculator

Calculate rafter length, roof rise, pitch angle and number of rafters from building width and pitch.

Quick sizes:
ft
in
ft

The numbers start with a worked example. Change any box and the result updates instantly. Your last entries are remembered on this device.

Rafter length (with overhang)

14.53

ft rafters

Roof rise6.00 ft
Pitch angle26.6°
Pitch factor1.118
Rafters needed48
Buy boards of16 ft

Estimate only. Check product labels and local codes. Updated December 2026.

How to use the rafter length & roof pitch calculator

A rafter runs from the wall to the ridge at the roof angle. Enter the building width and pitch to get the rafter length, roof height, angle and how many rafters to buy.

Enter your measurements in the boxes above. Every result updates as you type, and you can add a price to see the total cost. Use Copy result to save the numbers to your phone before you go to the store.

Formula

Run = span ÷ 2
Pitch factor = √(1 + (rise ÷ 12)²)
Rafter length = (run + overhang) × pitch factor

Worked example

With building width (span) 24 ft, roof pitch: 6/12, overhang (level) 12 in, building length 30 ft, rafter spacing: 16 in on center, you need 14.53 ft rafters (roof rise: 6.00 ft; pitch angle: 26.6°).

Quick reference chart

Common sizes worked out with the same formula and the default settings above.

PitchAngleRafter (24 ft span)
3/1214.0°13.40 ft
4/1218.4°13.70 ft
5/1222.6°14.08 ft
6/1226.6°14.53 ft
8/1233.7°15.62 ft
10/1239.8°16.92 ft
12/1245.0°18.38 ft

Tips before you buy

  • The result is measured along the top edge. Subtract half the ridge board thickness when you cut.
  • Lumber comes in even lengths, so buy the next even size up.
  • Check rafter size against a span table for your snow load.

Frequently asked questions

How long is a rafter for a 24 ft building with a 6/12 pitch?

About 14.5 ft including a 12 inch overhang, so buy 16 ft boards.

What is roof pitch?

How many inches the roof rises for every 12 inches of horizontal run. 6/12 rises 6 inches per foot.

How do I convert pitch to degrees?

Angle = arctan(rise ÷ 12). A 6/12 pitch is about 26.6°.

Add this calculator to your website

Run a blog, a store or a contractor website? Paste this code to give your visitors this free rafter length & roof pitch calculator.

Rafter Length & Roof Pitch Calculator by HatCalc – more free calculators →