Skip to main content
DatumSpot

Code Corner

How do you calculate rafter length?

A common rafter's line length is √(run² + rise²) — the diagonal of the right triangle formed by the horizontal run and the vertical rise. Run is half the building span; rise is run × (pitch ÷ 12). For a 24-foot span at 6:12, run = 12 ft and rise = 6 ft, so line length = √(12² + 6²) ≈ 13.42 ft. Then add the overhang and subtract half the ridge thickness.

Source: Roof geometry (Pythagorean theorem) · Verify against your AHJ and the adopted code edition.

A common rafter is the hypotenuse of a right triangle: the horizontal run and the vertical rise are the two legs, and the rafter follows the slope between them.

line length = √(run² + rise²)

Getting the pieces:

  1. Run = half the building span (for a symmetric gable). A 24-ft-wide building has a 12-ft run per side.
  2. Rise = run × (pitch ÷ 12). At 6:12, that’s 12 × (6 ÷ 12) = 6 ft.
  3. Line length = √(12² + 6²) = √180 ≈ 13.42 ft.

A shortcut is the per-foot factor: √(12² + pitch²) ÷ 12 gives the rafter length per foot of run. For 6:12 it’s √180 ÷ 12 ≈ 1.118, so 12 ft of run × 1.118 = 13.42 ft — same answer.

Two adjustments turn line length into a cut rafter:

  • Add the overhang (tail) — the horizontal eave projection, run through the same slope factor.
  • Subtract half the ridge-board thickness at the peak (½ of 1½ in = ¾ in for a 2x ridge).

Work it out: the rafter calculator returns run, rise, line length, the plumb and seat cut angles, and the per-foot factor from a span and pitch.

Calculate it →

Related questions