Roof Pitch & Rafter Length Calculator

Calculate rafter length, ridge height, and board count from span and pitch

From a building width and roof pitch given as X-in-12 or degrees, compute the common rafter length including overhang, the ridge height, the hip or valley rafter length, and the number of rafters at a chosen spacing across the building span. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is roof pitch in X-in-12 terms?

Pitch is the vertical rise for every 12 units of horizontal run. A 6-in-12 pitch rises 6 inches for each 12 inches across. The angle equals the arctangent of rise divided by 12, so 6-in-12 is about 26.57 degrees.

Framing a roof starts with two numbers: how far each rafter must reach and at what angle. This calculator turns a building width and roof pitch into the common rafter length with overhang, the ridge height, the hip rafter length, and the rafter count, so you can cut and order with confidence before a single board is touched.

How it works

Pitch is a rise over a 12-unit run. From half the building width (the run) the geometry follows:

angle      = arctan(rise / 12)
common len = run × √(1 + (rise/12)²) + overhang × √(1 + (rise/12)²)
ridge ht   = run × (rise / 12)
hip len    = run × √(1 + (rise/12)² + 1)     (diagonal run uses 17-per-12)
count      = ceil(length / spacing) + 1

The factor under the square root for the hip adds a second horizontal component because the hip travels diagonally across the plan corner.

Worked example

A 24 ft wide building at 6-in-12 has a run of 12 ft (half the width):

  • Common rafter line length = 12 × √(1 + 0.25) = 12 × 1.118 = 13.4 ft, plus the sloped overhang.
  • Ridge height = 12 × (6/12) = 6 ft above the wall plate (angle = arctan(0.5) ≈ 26.57°).
  • Hip rafter = 12 × √(1.25 + 1) = 12 × 1.5 = 18 ft line length.

If the building is 40 ft long with rafters at 16 in on centre:

  • Count per side = ceil(40 / (16/12)) + 1 = ceil(30) + 1 = 31 rafters per slope.

Common pitches and their angles

PitchRise per 12 runAngleCharacter
3-in-123 in14.0°Low slope, almost flat
4-in-124 in18.4°Minimum for most shingles
6-in-126 in26.6°Common residential
8-in-128 in33.7°Steeper traditional look
12-in-1212 in45.0°Steep, equal rise and run

Most asphalt shingle manufacturers specify a minimum pitch of 4-in-12 (some allow 2-in-12 with modified installation). Metal and membrane roofs can go lower. Always check the material specification before finalising pitch.

What these are line lengths

The lengths calculated are line lengths — the measurement along the top edge of the rafter, also called the theoretical length. When you cut actual boards:

  • Deduct half the ridge board thickness at the peak (typically 3/4 in for a 1x ridge or 3/4 to 1 in for a 2x ridge board, measured horizontally then converted to the slope).
  • Add a tail cut at the eave if a rafter tail extends past the wall plate.
  • Bird’s mouth cut removes a notch where the rafter sits on the wall plate — this does not change the line length but affects the actual board length you buy.

These are line lengths measured along the rafter top edge; the tool does not apply any of these deductions automatically.