Roof Framing Calculator

Common Rafter Length and Tail, Rafter Count, Ridge Board Size, Collar Ties, Ceiling Joists and Decking for a Gable Roof

As an Amazon Associate I earn from qualifying purchases.

A stick-framed gable roof is a row of common rafter pairs leaning on a ridge board, held together by collar ties high up and by rafter ties or ceiling joists low down. The Roof Framing Calculator turns the building width, length, pitch, rafter spacing, rafter size and overhang into the framing list. Each rafter's run is half the width less half the 1 1/2 in ridge; times the pitch factor √(144 + rise²) ÷ 12 that gives the rafter on the measuring line, and the overhang times the same factor gives the tail. Rafter pairs are the length ÷ spacing + 1. The 2021 IRC (R802.3) requires the ridge board to be no shallower than the rafter's plumb cut — the rafter depth times the pitch factor — collar ties go in the upper third at 4 ft centres or closer (R802.4.6) and rafter ties or ceiling joists in the lower third (R802.5.2). A 24 × 40 ft house at 6/12 with 2×8 rafters at 16 in and 12 in overhangs needs 62 rafters 14 ft 5 9/16 in long (16 ft stock), a 42 ft 2×10 ridge, 11 collar ties, 31 ceiling joists, 42 sheets of decking and 41 bundles of shingles.

A stick-framed gable roof is a row of common rafter pairs leaning on a ridge board, tied by collar ties in the upper third (2021 IRC R802.4.6) and by rafter ties or ceiling joists in the lower third (R802.5.2). Each rafter runs half the building width less half the ridge thickness; the pitch factor √(144 + rise²) ÷ 12 converts that run to length. The ridge board must be at least as deep as the rafter plumb cut (R802.3), which is the rafter depth times the same factor.

Rafter length, stock and ridge board by width and pitch (2×8 rafters, 12 in overhang)

Full rafter length including tail, stock length and minimum ridge board
WidthPitchRafter + tailStockRidge board
20 ft4/1211 ft 6.375 in12 ft2x10
24 ft4/1213 ft 7.625 in14 ft2x10
24 ft6/1214 ft 5.5625 in16 ft2x10
24 ft8/1215 ft 6.5625 in16 ft2x10
24 ft12/1218 ft 3.5625 in20 ft2x12
28 ft6/1216 ft 8.4375 in18 ft2x10
28 ft8/1217 ft 11.4375 in18 ft2x10
32 ft6/1218 ft 11.25 in20 ft2x10

Ridge board depth by rafter size at 6/12 and 12/12 (IRC R802.3)

Plumb cut depth and the smallest ridge board at least that deep
RafterActual depthPlumb cut at 6/12Ridge at 6/12Plumb cut at 12/12Ridge at 12/12
2x65.5 in6.15 in2x87.78 in2x10
2x87.25 in8.11 in2x1010.25 in2x12
2x109.25 in10.34 in2x1213.08 inLVL

Worked example: 24 × 40 ft gable, 6/12, 2×8 at 16 in, 12 in overhangs

Frequently asked questions

How do you calculate roof framing?

Halve the building width and take off half the ridge thickness for the run, multiply by the pitch factor √(144 + rise²) ÷ 12 for the rafter length, then add the overhang times the same factor for the tail. Count one rafter pair per spacing along the roof plus one. A 24 × 40 ft house at 6/12 with rafters at 16 in needs 31 pairs (62 rafters) about 14 ft 5 9/16 in long — 16 ft stock.

How many rafters do I need?

Roof length in inches ÷ rafter spacing, rounded down, plus one — then double it for both sides. A 40 ft roof at 16 in centres has 480 ÷ 16 + 1 = 31 rafter pairs, or 62 rafters; at 24 in centres it has 21 pairs.

What size ridge board do I need?

The 2021 IRC (R802.3) requires a ridge board at least 1 in nominal thick and no shallower than the cut end of the rafters. A plumb cut is deeper than the rafter: a 2×8 (7 1/4 in) cut at 6/12 is 8.11 in deep, so the ridge has to be a 2×10. A ridge that carries load for a vaulted ceiling is a ridge beam and must be designed.

How far apart are rafters?

Usually 16 in or 24 in on centre. The rafter size, span, grade and snow load decide which — check the rafter span tables (IRC Tables R802.4.1(1)–(8)) before choosing, and pick roof sheathing rated for that spacing.

Do I need collar ties and ceiling joists?

With a ridge board, yes. Rafter ties or ceiling joists in the lower third stop the rafters pushing the walls out (IRC R802.5.2), and collar ties in the upper third at no more than 4 ft on centre hold the rafters together at the ridge (R802.4.6).

Need the whole roof at once? The free roofing calculator works out roof area, squares, shingle bundles, underlayment, drip edge, ridge cap and installed cost from one set of measurements.