We believe math and science education should be free and accessible to everyone. Why education matters >

Roof Rafter Calculator

This roof rafter calculator sizes every rafter in your frame: total length (ridge to tail), plumb cut angle at the ridge, seat cut angle for the birdsmouth, and total rafter count across the building. It handles gable and shed roofs, accounts for ridge board thickness, and outputs the birdsmouth depth so you can mark each rafter with a framing square.

How the Roof Rafter Calculator Works

For any rafter, the layout is a right triangle:

  • Run = horizontal distance from the wall plate to the ridge (half the span on a gable, full span on a shed, minus half the ridge board thickness)
  • Rise = vertical distance from the wall plate to the ridge
  • Rafter length = square root of (run squared + rise squared)

The roof pitch connects run and rise: rise = run x (pitch / 12). A 6:12 pitch means 6 inches of rise per 12 inches of run.

Roof Rafter Length Calculator Example

For a 24-foot-wide building with a 6:12 pitch and 1.5 in (2x) ridge board:

  • Run = 24/2 - 1.5/24 = 11.9375 ft
  • Rise = 11.9375 x (6/12) = 5.97 ft
  • Common rafter length = sqrt(11.9375^2 + 5.97^2) = 13.34 ft
  • With 12 in overhang (1 ft): overhang rafter = sqrt(1 + 0.25) = 1.118 ft
  • Total rafter length = 13.34 + 1.118 = 14.46 ft per rafter

You'd order 16 ft lumber to have waste margin.

Shed Roof Rafter Calculator

A shed roof rafter calculator uses the same math but with the full building span as the run (no ridge, slope goes from low wall to high wall). For a 12 ft wide shed at 4:12 pitch:

  • Run = 12 ft
  • Rise = 12 x (4/12) = 4 ft
  • Common rafter = sqrt(144 + 16) = 12.65 ft
  • Add 12 in overhang on low end = 13.77 ft total

Roof Rafter Calculator with Birdsmouth

The birdsmouth is the L-shaped notch at the bottom of the rafter that sits on the top plate of the wall. It has two cuts:

  • Seat cut (horizontal): bearing surface that sits flat on the wall plate. Minimum 1.5 in for a 2x4 plate, 3.5 in is standard, 5.5 in for a 2x6 plate.
  • Plumb cut (vertical): back of the notch that faces inward. Depth = seat length x (pitch / 12). For 3.5 in seat at 6:12 pitch: 3.5 x 0.5 = 1.75 in plumb depth.

IRC code requires you leave at least 2/3 of the rafter depth uncut above the birdsmouth. For a 2x8 rafter (7.25 in actual depth), max birdsmouth depth is 7.25 - (7.25 * 2/3) = 2.42 in.

Plumb Cut and Seat Cut Angles

  • Plumb cut angle (at the ridge and tail) = arctan(pitch / 12)
  • Seat cut angle = 90 minus plumb cut angle

For common pitches:

Pitch Plumb Cut Seat Cut
3:12 14.0 deg 76.0 deg
4:12 18.4 deg 71.6 deg
6:12 26.6 deg 63.4 deg
8:12 33.7 deg 56.3 deg
10:12 39.8 deg 50.2 deg
12:12 45.0 deg 45.0 deg

Roof Rafter Calculator App - What to Use

Several free roof rafter calculator app options exist for phones (Ridgid, Construction Master Pro). They give similar outputs to this calculator. For quick field math, a Speed Square (combination rafter square) with the pitch scribed gives plumb and seat cuts without any app at all. Set the Speed Square to the pitch, slide along a board, mark the cut line.

How Many Rafters Do You Need?

Count = (building length in inches / spacing in inches) + 1, times two for gable (both sides).

For a 40 ft long building at 16 in on-center:

  • 40 x 12 / 16 = 30 spaces
  • 30 + 1 = 31 rafters per side
  • Gable roof: 31 x 2 = 62 rafters total
  • Add 2-3 extras for waste and swap pieces

Rafter Sizing Tables (Span Limits)

Maximum rafter spans at 16 in on-center, live load 30 psf, SPF grade #2:

Rafter 3:12-6:12 7:12-12:12
2x6 13 ft 2 in 14 ft 4 in
2x8 17 ft 5 in 18 ft 11 in
2x10 22 ft 2 in 24 ft 1 in
2x12 26 ft 0 in 28 ft 4 in

Always verify with your local code and a span calculator before buying lumber. Snow loads in cold climates require larger rafters.

Did this solve your problem?

Frequently Asked Questions

Search Calculators

Search across all calculator categories