Rafter Calculator

Enter the building width, roof pitch and overhang to get the common rafter length for a gable roof, the board length to buy, the plumb and seat cut angles, and how many rafters the roof takes.

24 ft12 in6 in 12

Your measurementsRoofing & siding

Outside of wall to outside of wall
in 12
Rise in inches per 12 in of run
Usually 16 or 24 in

What to order

  • Rafter length14 ft 5 9/16 in
  • Lumber to buy16 ft boards
  • Without the overhang13 ft 4 3/16 in
  • Rafters62 rafters (31 per side)
  • Roof angle (plumb cut)26.57°
  • Seat cut angle63.43°
  • Rise, wall to ridge6 ft 0 in

What to measure

Diagram: measure the building width, roof pitch and overhang
Measure the building width, roof pitch and overhang.

How to use the rafter calculator

  1. Enter the building width from the outside of one wall to the outside of the other.
  2. Enter the roof pitch as the rise in inches per 12 in of run (6 for a 6/12 roof).
  3. Enter the overhang measured level out from the wall, and the ridge board thickness (1 1/2 in for a 2× board).
  4. For a rafter count, enter the building length and the spacing on center.

The lengths are along the rafter’s measuring line, from the face of the ridge board to the end of the overhang. Lay out the birdsmouth and tail cuts on the board itself.

The formula

  • Run = building width ÷ 2 − ridge thickness ÷ 2
  • Slope factor = √(12² + pitch²) ÷ 12
  • Rafter length = (run + overhang) × slope factor
  • Plumb cut = arctan(pitch ÷ 12); seat cut = 90° − plumb cut, both from a square cut across the board
  • Rafters = (building length ÷ spacing, rounded up, + 1) × 2

Worked example: 24 ft wide, 6/12 pitch, 12 in overhang

  • Run: 144 in − 0.75 in = 143.25 in
  • Slope factor: √(144 + 36) ÷ 12 = 1.118
  • Rafter: (143.25 + 12) × 1.118 = 173.57 in = 14 ft 5 9/16 in → buy 16 ft boards
  • Angles: 26.57° plumb cut, 63.43° seat cut
  • 40 ft building at 16 in on center: 31 per side = 62 rafters

Pitch, angle and slope factor

Pitch Angle Rafter per foot of run
4/12 18.43° 1.054 ft
6/12 26.57° 1.118 ft
8/12 33.69° 1.202 ft
10/12 39.81° 1.302 ft
12/12 45° 1.414 ft

Frequently asked questions

How do I calculate rafter length?

Take half the building width, subtract half the ridge board, and multiply by the slope factor for your pitch. For a 24 ft wide building at 6/12 with a 1 1/2 in ridge, the run is 143.25 in; × 1.118 = 160.16 in. Add the overhang the same way (12 in × 1.118 = 13.42 in) for 173.57 in, or 14 ft 5 9/16 in.

What does a 6/12 roof pitch mean?

The roof rises 6 inches for every 12 inches it runs level. That is a 26.57° angle, and each foot of run needs 1.118 ft of rafter.

What size rafters do I need?

It depends on the span, the spacing, the snow and dead loads and the lumber species and grade, so this calculator doesn't size them. Use the rafter span tables in your local building code or the American Wood Council's span calculator, and follow your building department.

How many rafters do I need?

Divide the building length by the spacing, round up, add one, and double it for the two sides. A 40 ft building at 16 in on center needs 31 rafters per side, 62 in all. Gable-end overhangs (rake ladders) need extra framing on top of that.

What length lumber should I buy for rafters?

The next even length at or above the rafter length, since framing lumber is sold in 2 ft steps. A 14 ft 5 9/16 in rafter is cut from a 16 ft board, which leaves room for the plumb cut at the ridge.

What are the plumb cut and seat cut angles?

Measured from a square cut across the board, the plumb cut at the ridge and tail is the roof angle — 26.57° for a 6/12 roof, or the 6 mark on a speed square's common scale — and the birdsmouth seat cut is 90° minus that, 63.43°.

Sources

Formulas and defaults last reviewed October 30, 2026. How we check our math.