A rafter is the sloped beam from the ridge to the wall, and its length is always longer than the flat run it covers. The calculation is a right triangle: run across, rise up, rafter as the slope between them. Two inputs, span and pitch, give everything.
The terms
Span is the full width of the building, wall to wall. Run is half the span, from wall to ridge centre, for a symmetric gable roof. Rise is the vertical height from wall plate to ridge. Pitch is the slope, written as rise over a 12-unit run, such as 6/12, meaning 6 inches of rise per 12 inches of run. Roof angle in degrees is the same slope in angular form: 6/12 is about 26.57 degrees.
Keep units consistent. If span is in feet, keep overhang in feet. If span is in metres, keep overhang in metres. Mixing feet and inches mid-calculation is the top source of wrong cuts.
Method 1: pitch ratio
Rise = run x (pitch rise / 12). Rafter length = square root of (run squared + rise squared). Worked example: 24-foot span, 6/12 pitch, 1-foot overhang. Run = 12 feet. Pitch ratio = 6/12 = 0.5. Rise = 12 x 0.5 = 6 feet. Rafter without overhang = square root of (144 + 36) = square root of 180 = 13.42 feet.
With overhang: total horizontal distance = 12 + 1 = 13 feet. Rise at the outer edge = 13 x 0.5 = 6.5 feet. Rafter with overhang = square root of (169 + 42.25) = square root of 211.25 = 14.53 feet. That is the length to cut for each common rafter, before any ridge or birdsmouth adjustments.
Method 2: roof angle
If you know the angle instead of the ratio: rafter length = run / cos(angle), plus overhang along the slope. For the same roof, angle 26.57 degrees: 12 / cos(26.57) = 12 / 0.8944 = 13.42 feet, matching method 1. Overhang along the slope = 1 / 0.8944 = 1.12 feet, giving 14.54 feet total, matching within rounding.
Convert between pitch and angle with: angle = arctan(pitch rise / 12). A 4/12 pitch is about 18.43 degrees; an 8/12 pitch is about 33.69 degrees.
Cuts, count, and waste
Three cuts shape each rafter: the plumb cut at the ridge, angled to the pitch; the birdsmouth notch where it sits on the wall plate, with a horizontal seat cut and a vertical heel cut; and the tail cut at the eave. The seat cut depth should not exceed one third of the rafter depth, or the beam weakens badly.
Count: rafters = (roof length / spacing) + 1, for one side, doubled for both sides, plus gable-end extras. A 30-foot roof at 16-inch spacing needs about 24 rafters per side. Add 100-150 mm per rafter for cutting waste, and always check local span tables and building rules for the timber size: length is only half the design, and the other half is load.
Hip and valley rafters
Hip and valley rafters are longer than common rafters because they run diagonally. For a roof corner at 90 degrees, the hip run is the common run multiplied by the square root of 2. With a 12-foot common run and 6-foot rise, the hip run is 12 x 1.414 = 16.97 feet.
The hip length is then the square root of (hip run squared + rise squared) = square root of (288 + 36) = square root of 324 = 18 feet, before overhang. Valley rafters, where two roof slopes meet in a trough, follow the same diagonal geometry. Always calculate hips and valleys separately: using common rafter lengths for them leaves the roof short at the corners.
Try it faster with the tool
You can follow every step above by hand, but the free Rafter Calculator — Rafter Length From Span and Pitch, With Overhang and Count does the arithmetic for you. Enter your numbers and it gives the answer right away, so you can check your hand calculation or skip straight to the result.
Quick tips
- Run = span / 2; rise = run x pitch ratio.
- Rafter = square root of (run squared + rise squared).
- Add overhang before squaring, not after.
