Roof Pitch & Rafter Length Calculator

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

Ad placeholder (leaderboard)

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.

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.

Example and notes

A 24 ft wide building at 6-in-12 has a 12 ft run. The common rafter line length is 12 x sqrt(1 + 0.25) = 13.4 ft, plus the sloped overhang. The ridge sits 6 ft above the plate (26.57 degrees). The hip rafter is 12 x sqrt(2.25) = about 18 ft. Add the ridge board thickness deduction at the peak when cutting, and remember these are line lengths measured along the rafter top edge.

Ad placeholder (rectangle)