Rafter Length Calculator

Calculate rafter length from rise, run, and overhang, plus rafter count for your roof.

Rafter Length Calculator: Rise, Run, Overhang & Rafter Count

A rafter is only as good as the two measurements that define it: rise (how far it climbs) and run (how far it travels horizontally to get there). Get either one wrong, or measure it from the wrong reference point, and every rafter you cut from that number is wrong the same way. This calculator takes your rise and run, adds an eave overhang if you have one, and returns the exact rafter length via the Pythagorean theorem — plus, for a whole roof, how many rafters you need at a given on-center spacing and roughly how much lumber that adds up to.

It is built to complement a roof pitch calculator rather than duplicate it: if you already know your target pitch (a ratio, an angle, or a percentage grade) but not the raw rise and run, work out the rise for your run there first, then bring those figures here to get the actual cut length, the total rafter count for your roof length, and an estimated material cost. The two numbers you get out — a single rafter's length and how many of them a full roof needs — are the two figures a cutting list and a lumber order actually depend on.

How to use the rafter length calculator

  1. Enter the rise — the vertical height from the top of the wall plate (where the rafter starts climbing) to the ridge, in your chosen unit.
  2. Enter the run — the horizontal distance from the same wall-plate reference point to the ridge centerline. For a simple gable roof this is normally half the building width.
  3. Enter the overhang — the horizontal distance the rafter tail extends past the outer wall face, if your design includes an eave overhang.
  4. Enter the roof length (the total length of the building along the ridge) and the on-center (OC) spacing between rafters — 16 in and 24 in are the most common presets, alongside 400 mm and 600 mm.
  5. Read off the results: rafter length without the overhang, rafter length with the overhang included, the number of rafters needed for the whole roof, the total lumber length, and an estimated material cost.
  6. If you only have a target pitch rather than a raw rise and run, use the roof pitch calculator first to convert that pitch into a rise for your run, then bring both numbers back here.

The rafter length formula, explained

Rise, run, and rafter length form a right triangle, so the rafter length is simply the hypotenuse: rafter length = sqrt(rise^2 + run^2), by the Pythagorean theorem. If you are including an eave overhang, add the overhang to the run before taking the square root — rafter length with overhang = sqrt(rise^2 + (run + overhang)^2) — because the overhang continues along the same slope, not as a flat extra length tacked onto the end.

Rafter count over a roof length uses the standard "fencepost" spacing convention, not a plain division: count = ceil(roof length / OC spacing) + 1. You add 1 because a run of rafters needs one more rafter than the number of gaps between them — divide the roof length by the spacing and you get the number of gaps, then add the extra rafter that closes the last gap.

Total lumber needed is then just count x rafter length (with overhang), which is also the figure the estimated material cost is based on.

Worked example: a rise of 4 ft over a run of 12 ft, a 1 ft overhang, a 30 ft roof length, and 24 in (2 ft) OC spacing. Rafter length (no overhang) = sqrt(4^2 + 12^2) = sqrt(160) ≈ 12.65 ft. Rafter length with overhang = sqrt(4^2 + 13^2) = sqrt(16 + 169) = sqrt(185) ≈ 13.60 ft. Rafter count = ceil(30 / 2) + 1 = 15 + 1 = 16 rafters. Total lumber length = 16 x 13.60 ≈ 217.6 ft.

One thing this geometric length does not account for is the ridge board. The rise-and-run triangle above is measured to the ridge centerline, but a real ridge board has thickness, so the actual on-site cut is normally shortened by half the ridge board's thickness at the top plumb cut, plus whatever the birdsmouth notch removes at the bottom bearing point. Treat the calculator's figure as the geometric rafter length and make the ridge-thickness and birdsmouth adjustments on the saw, not in the input numbers.

Rafter sizing and spacing in the UK

UK rafters are typically cut from C16 or C24 graded structural softwood, sized and spaced according to span tables in TRADA's span tables publication or the timber supplier's own tables, which factor in rafter spacing (commonly 400 mm or 600 mm centres), the roof's snow and wind loading zone, and the imposed load from the chosen roof covering. Building Regulations Approved Document A covers the structural adequacy of the roof, so a span table check (or a structural engineer's sign-off for anything non-standard) sits alongside the pure geometry this calculator provides.

Pro tips and common mistakes

Measure rise and run from the same two reference points you will actually cut to — top of the wall plate at the bottom, ridge centerline at the top — on every rafter in the roof. Mixing reference points (one rafter measured to the ridge face, the next to the ridge centerline) is the single most common source of a batch of rafters that do not sit flush against each other.

Add the overhang to the run before calculating the hypotenuse, not after calculating the rafter length. Because the overhang continues at the same pitch as the rest of the rafter, sqrt(rise^2 + (run + overhang)^2) is correct; simply adding the overhang distance on as flat extra length after the fact overstates the true tail length, since that stretch is also rising at the roof's pitch, not running level.

Do not forget the "+1" in the rafter count. Dividing roof length by OC spacing alone gives you the number of gaps between rafters, not the number of rafters — a roof needs one more rafter than it has gaps, the same fencepost-counting logic used for fence posts or evenly spaced balusters.

The birdsmouth notch cut into the underside of a rafter to seat it on the wall plate reduces the rafter's effective bearing depth at that point but does not change the overall ridge-to-tail length this calculator gives you — it is a notch out of the width of the timber, not a shortening of its length. Always order stock lumber slightly longer than the calculated length so there is enough material left for the plumb cut, birdsmouth, and tail cut angles.

Standard lumber comes in fixed stock lengths (commonly 8, 10, 12, 14, and 16 ft, or 2.4, 3.0, 3.6, 4.2, and 4.8 m). Round your calculated rafter length up to the next available stock length when ordering, rather than assuming a supplier stocks your exact decimal figure — and account for the offcut waste in your material cost estimate.

Trusses and cut (stick-framed) rafters are not interchangeable in a material takeoff: a manufactured truss package is engineered and priced as a unit per truss, while stick-framed rafters are priced and ordered as raw lumber by length. This calculator models the cut-rafter approach; if your roof uses prefabricated trusses instead, get a quote from the truss manufacturer rather than pricing raw lumber.

At a typical UK price of around £5 per linear metre of sawn rafter timber, the worked example above (16 rafters totalling roughly 65.3 m of lumber once overhang is included) would come to about £326 for the rafter timber alone, before ridge board, fixings, and any truss-clip hangers are added.