Roof Rafter Length Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/9/2026

The rafter length is calculated with (span ÷ 2) ÷ cos(pitch angle). For an 8 m span and a 30% pitch, the rafter measures about 4.18 m.

Explanation

The rafter (common rafter) of a symmetrical two-sided roof is the length of the sloped side, measured from the ridge down to the eave — that is, the actual length of a rafter once the pitch is taken into account, always longer than simply half the building's ground span, since the roof is sloped rather than horizontal. The calculation relies on basic trigonometry: half the building's span forms the adjacent side of a right triangle, the rafter is its hypotenuse, and the pitch angle (directly derivable from the percentage pitch via our roof pitch calculator) lets you go from one to the other by dividing by the cosine of that angle. This rafter length is exactly the starting figure expected by the rafter count calculation and the batten count calculation needed for the framing and roofing, two calculators that assume you already know this length rather than helping you obtain it. The steeper the pitch, the longer the rafter relative to the ground span: at zero pitch (flat roof), the rafter equals exactly half the span, while at 45° (100% pitch), it equals about 1.41 times that half — a difference with a real impact on the amount of roofing material to order.

Example: 8 m span, 30% pitch

Inputs

Total building span: 8 m. Roof pitch: 30%.

Calculation

Angle = atan(30 ÷ 100) ≈ 16.7°. Rafter length = (8 ÷ 2) ÷ cos(16.7°) = 4 ÷ 0.9578 ≈ 4.176 m.

Result

Each side of this roof is about 4.18 m long, from ridge to eave.

Frequently asked questions

Why divide the span by 2 before the calculation?

Because this calculator assumes a symmetrical two-sided roof, with the ridge exactly at the center of the building: each side therefore covers half of the total ground span. For an asymmetrical roof (sides of different lengths), enter the span of each side directly rather than the building's total span.

Does this length include the roof overhang?

No, this calculation gives the rafter length between the ridge and the wall face (the theoretical eave), without the roof overhang (the extension beyond the wall, typically 30 to 60 cm) that protects the facades from rain. Add this overhang, divided by the same angle's cosine, to the length obtained if you're ordering roofing materials.

What is the difference between a rafter and a hip rafter?

The rafter (common rafter) is the standard rafter of a two-sided roof, running perpendicular to the ridge. The hip rafter, on the other hand, is the diagonal line formed where two sides meet on a four-sided (hip) roof: its length is calculated differently, see our hip rafter length calculator.

Related resources

Similar calculators