Rafter Length Calculator

Get the exact rafter length for a gable or shed roof from the building width, pitch and overhang. You also get rise, run, plumb and seat cut angles, how many rafters to order, and the stock length to buy.

Framing & LumberUpdated Free, no sign-upInstant results

Everything is calculated in your browser. Nothing you type is sent or stored.

Quick answer

Rafter length = run × √(1 + (pitch ÷ 12)²), plus the overhang × the same factor. For a 24 ft wide gable at 6/12 with a 1½ in ridge and 12 in overhang, the run is 143¼ in. That gives 160⅛ in to the ridge plus a 13⅜ in tail: 14 ft 5⅝ in, so buy 16 ft rafters.

How to use this rafter calculator

  1. Choose gable or shed. A gable rafter runs from the wall to a central ridge. A shed rafter runs the full width from a low wall to a high wall or ledger.
  2. Enter the building width (outside of wall to outside of wall) and the pitch in inches of rise per 12 in of run.
  3. Add the overhang as a level distance, and the ridge board thickness for gables (1½ in for 2× lumber).
  4. Enter building length and spacing to get the rafter count.
  5. Read the cuts: line length, tail, plumb and seat angles, and the stock length to buy.

Rafter length per foot of run

PitchAnglePitch factorRafter per ft of run
3/1214.0°1.03112⅜ in
4/1218.4°1.05412⅝ in
5/1222.6°1.08313 in
6/1226.6°1.11813⅜ in
7/1230.3°1.15813⅞ in
8/1233.7°1.20214⅜ in
9/1236.9°1.25015 in
10/1239.8°1.30215⅝ in
12/1245.0°1.41417 in

These are the same figures printed on the rafter table of a framing square (“length of common rafter per foot run”).

Plumb cut, seat cut and birdsmouth

  • Plumb cutThe vertical cut at the ridge and usually at the tail. Set a framing square to the pitch (6 and 12 for a 6/12 roof) and mark along the 6 side.
  • Seat cutThe level cut that sits on the wall plate. Together with a short plumb cut it forms the birdsmouth.
  • Birdsmouth depthCommon practice is no deeper than one third of the rafter depth, so plenty of wood stays above the plate.
  • Measure along one lineLine length is measured along the same line from the ridge plumb cut to the wall’s outer face, then the tail continues past it.

How many rafters, and what size

Rafters per side = building length (in) ÷ spacing + 1. A 36 ft building at 16 in on center needs 28 per side, or 56 for a gable roof. At 24 in on center it needs 19 per side.

The lumber size (2×6, 2×8, 2×10…) depends on the span, spacing, species, grade and your local snow and dead loads. Take it from the rafter span tables in your local building code, or use engineered trusses designed for your site.

Worked example

24 ft wide gable, 6/12, 1½ in ridge
Run = 144 − ¾ = 143¼ in
Line length (× 1.118)
160⅛ in (13 ft 4⅛ in)
12 in overhang (× 1.118)
13⅜ in tail
Total rafter length
14 ft 5⅝ in, so buy 16 ft
36 ft long at 16 in o.c.
28 per side, 56 rafters

Frequently asked questions

How do you calculate rafter length?

Run × √(1 + (pitch ÷ 12)²). For a gable, run is half the width minus half the ridge thickness. Add the overhang × the same factor.

How many rafters do I need?

Building length (in) ÷ spacing, rounded up, + 1 per side. A gable needs twice that.

What angle is a 6/12 roof pitch?

About 26.6°, with a pitch factor of 1.118.

What size lumber do I need for rafters?

It depends on span, spacing, species, grade and loads. Use your local code’s span tables, or engineered trusses.

How deep can a birdsmouth cut be?

Common practice is no more than one third of the rafter depth. Check your local code.

What this calculator assumes

  • Common rafters with the same pitch on both sides. Hip and valley rafters need different lengths.
  • Overhang is measured level from the outside of the wall. Stock length adds 6 in for trimming and rounds up to the next even length.
  • The calculator does not size rafters. Use your code’s span tables or a design professional.