How Many Rafters Do I Need? (2026 Guide)

How many rafters do I need? Per slope: (length ft × 12) ÷ spacing, rounded up, plus 1 — a 30-ft roof at 24 in o.c. needs 16 per side, 32 total.

Quick answer: Rafters run eave to ridge, spaced along the building length. Per side: (length ft × 12) ÷ spacing, rounded up, plus 1. A 30-ft roof at 24 in on center takes 16 rafters per slope — 32 total for a gable. Confirm with your local building code and an engineer, then run it in the rafter calculator.

What counts as one side of the roof

On a gable roof, one slope runs from the eave (low edge) to the ridge (peak). Each rafter is a board laid along that slope; rafters are spaced along the ridge direction — the building length, not the slope's own distance.

Count one side first. A symmetric gable's slopes meet at the ridge, each carrying its own set of rafters, so the material list is 2 × the one-side count. This math is for estimating and ordering, not structural design — spacing, size and spans come from your plan and local building code.

The rafter-count formula, step by step

We'll count a 30-ft roof at 24 in on center (o.c.); any length or spacing works the same way.

1. Measure the building length in inches

Measure the wall run parallel to the ridge (the spacing direction) and convert to inches: 30 × 12 = 360 in.

2. Pick your spacing

Spacing comes from your plan and code — most roofs frame at 16 or 24 in on center. Here: 24 in.

3. Divide and round up

Divide the length by the spacing: 360 ÷ 24 = 15 bays. Not an even division? Round up — at 16 in o.c., 360 ÷ 16 = 22.5 → 23 bays.

4. Add the end rafter, then double for a gable

Each bay plus the first rafter: 15 + 1 = 16 rafters on this slope. Both gable slopes need a set: order 16 × 2 = 32 rafters. The rafter calculator handles the division, rounding and doubling for you.

Rafters for common roof lengths

Building length (ft)Per side @ 16 in o.c.Gable total @ 16 in o.c.Per side @ 24 in o.c.Gable total @ 24 in o.c.
2016321122
3024481632
4031622142
5039782652

Read across the 30-ft row: 24 per side at 16 in o.c. or 16 per side at 24 in o.c. — 48 or 32 total. Wider spacing cuts the count by about a third, which is why it stays the engineer's call.

Where to add rafters beyond the basic count

  • Gable end walls — the +1 covers the first and last stations; a rake overhang's ladder framing is counted separately.
  • Chimneys, skylights and dormers — each opening adds headers, trimmers and shortened rafters beyond the straight-run count.
  • Hip and valley roofs — hips, valleys and jack rafters follow their own rules; treat this formula as a gable-only estimate.

Add 5–10% to the final purchase for cut-offs and bows — never let savings push spacing past the approved layout.

Rafter-buying tips

  • Measure along the ridge, not the slope — spacing steps off the horizontal building length, not the rafter's run down the roof.
  • Never space beyond the plan — stretching spacing to save lumber overloads every rafter and can fail inspection; spare boards beat re-framing.

Before ordering, have the spacing, size and spans checked against your local building code and a licensed structural engineer.

Building a whole deck? Count how many deck boards you need, then plan how to stain a deck once it's up.

Calculate your exact rafter count →

FAQ

Should rafters be spaced 16 or 24 inches on center?

Both are standard: 24 in on center (o.c.) uses fewer rafters where loads allow; 16 in o.c. suits heavier roofing, bigger snow loads or longer spans. Spacing is structural — follow your plan and local building code.

Does the formula work for a shed roof with one slope?

Yes — use the one-side count and skip the doubling. A shed roof sits on one plane: divide the building length (in) by the spacing, round up, and add 1. Double it only for a symmetric gable, where both slopes meet at the ridge.

Is ordering extra rafters wasteful?

No — a few spares are cheap insurance against cut-offs and bowed lumber. The real risk runs the other way: spacing beyond your plan to save lumber overloads each rafter. Order the count plus 5–10%.

Need a different size?

Our free calculators give you the exact answer in seconds.

All Calculators