How do I calculate rafter length from the pitch and span?

Published · Updated · By

Rafter line length is the run divided by the cosine of the roof angle. The run is horizontal and includes the eaves overhang. For an 8000 mm span at 22.5° with a 450 mm overhang, the run is 4450 mm and the rafter line length is 4450 ÷ cos 22.5° = 4816.6 mm, before any cutting allowances.

What do I need before I start?

  • The span, measured across the building between the wall lines the rafters bear on.
  • The pitch as an angle in degrees. If you have a ratio instead, roof pitch to degrees converts it, and how to calculate roof pitch shows how to get it from rise and span.
  • The horizontal overhang: how far the eaves stick out past the wall, measured level, not along the rafter.

The run is the horizontal distance the rafter covers. On a gable roof with a ridge in the middle it is half the span. On a skillion (shed) roof that falls one way, it is the full width. One trap: pitch and slope are not the same thing. Pitch is the rise over the whole span, slope is the rise over the run, so a pitch of 1/6 is a slope of 1/3 (Wikipedia, Roof pitch, checked on 28 October 2026). Use the angle and the confusion goes away.

The rafter length formula

The rafter, the run and the rise make a right-angled triangle, so trigonometry or Pythagoras gives the sloped side:

  • length = run ÷ cos(angle)
  • length = √(rise² + run²), if you know the rise instead of the angle
  • rise = run × tan(angle)

The pitch must go in as an angle or a ratio, never as a percentage. A 33 per cent grade is a rise of 0.33 per unit of run, not 33. The sum underneath is the one in Pythagoras in construction.

Right triangle with a run of 4450 mm made of 4000 mm to the wall line plus a 450 mm overhang, a roof angle of 22.5 degrees and a rafter line length of 4816.6 mm
The worked example below, drawn to scale: the rafter line is the sloped side.

Worked example: 8000 mm span, 22.5°, 450 mm overhang

  1. Find the run to the ridge. Half the span: 8000 ÷ 2 = 4000 mm.
  2. Add the horizontal overhang. 4000 + 450 = 4450 mm.
  3. Divide by the cosine. cos 22.5° = 0.9239, so 4450 ÷ 0.9239 = 4816.6 mm.
  4. Or multiply by the slope factor. 1 ÷ cos 22.5° = 1.0824, and 4450 × 1.0824 = 4816.6 mm.

That is 4.82 m along the top edge, from the ridge centre-line to the tail. The rise over that run is 4450 × tan 22.5° = 1843 mm (1657 mm of it from the ridge down to the wall line, over a run of 4000 mm).

How do I work out the length with an overhang?

Add the horizontal overhang to the run, then divide by the cosine once. Don't add the overhang to the answer without converting it: 450 mm of level overhang is 450 ÷ cos 22.5° = 487.1 mm along the slope. The two routes agree:

  • Run to the wall line: 4000 ÷ cos 22.5° = 4329.6 mm
  • Plus the overhang along the slope: 487.1 mm
  • Total: 4816.7 mm (4816.6 mm from the single division; the 0.1 mm is rounding)

Adding 450 straight onto 4329.6 would give 4779.6 mm, which is 37 mm short.

How do I calculate it from rise and run?

Use Pythagoras. Say the rise is 1500 mm over a run of 4000 mm. The line length is √(1500² + 4000²) = √18,250,000 = 4272.0 mm, and the angle is arctan(1500 ÷ 4000) = 20.56°. To add a 450 mm overhang at the same slope, the run becomes 4450 mm and the rise 4450 × 0.375 = 1668.75 mm, so the length is 4450 × 1.0680 = 4752.6 mm.

Slope factor table: one multiplier, no trig keys

The slope factor is 1 ÷ cos(angle). Multiply the horizontal run by it to get the length along the slope.

Roof angleSlope factorLength for a 4000 mm run
15°1.03534141.1 mm
20°1.06424256.7 mm
22.5°1.08244329.6 mm
25°1.10344413.5 mm
30°1.15474618.8 mm
35°1.22084883.1 mm
40°1.30545221.6 mm
45°1.41425656.9 mm

How do I do it for a shed (skillion) roof?

The same way, with the run being the full width from the high wall to the low wall, plus the overhang at the low end. A 3000 mm run at 15° gives 3000 × 1.0353 = 3105.8 mm.

How do I calculate rafter length in Australia?

The maths is the same. The conventions differ: Australian plans usually give the pitch in degrees and lengths in millimetres, and call the overhang the eaves overhang. Rafter sizes and spans do not come from this sum. They come from the span tables in AS 1684 and the Housing Provisions of the NCC, or from the engineer or truss supplier. See the NCC on the ABCB site and Standards Australia (checked on 28 October 2026). This page gives no size or span figures, so take them from those sources and your plans.

What is rafter length, and what is a cut length?

The number above is the line length: the straight distance along the top edge of the rafter, from the ridge centre-line to the tail. It is not a cut list. Before you cut, allow for:

  • The ridge. If a ridge board sits between the rafters, the rafter stops short by half the ridge thickness, measured along the slope: half the thickness ÷ cos(angle). For a 42 mm ridge board at 22.5°, that is 21 ÷ 0.9239 = 22.7 mm off each rafter. Check your plans.
  • The birdsmouth. The notch that seats the rafter on the top plate. As a general rule, no more than a third of the rafter depth is removed (a third of a 190 mm rafter is 190 ÷ 3 = 63 mm) (Wikipedia, Birdsmouth joint, checked on 28 October 2026). For Australian work the limit comes from AS 1684 and the span tables.
  • The plumb cut. The angle at the ridge and the tail depends on the pitch. Measured from the vertical, it equals the roof angle.
  • Waste, hips and valleys. Hip and valley rafters are longer again and have their own cut angles, and you will want spare length.
  • Trusses. A truss is designed and supplied by the truss maker, not worked out from a pitch.

How do I measure a rafter length on site?

Measure the span and the overhang with a tape, find the angle with a level or an angle finder, then use the formula. To check an existing rafter, run a tape along its top edge from the ridge centre-line to the tail and compare the number with the formula.

Common mistakes

  • Using a percentage as the pitch in the formula.
  • Adding the overhang along the slope to a horizontal run, or the other way round.
  • Using the full span as the run on a gable roof.
  • Treating the line length as the cut length.

Doing it in MeisterCalc

MeisterCalc has no rafter calculator yet. What it does have is Pitch and Triangles, which solve the triangle and give the line length. You add the overhang yourself.

  1. Open MeisterCalc and tap Pitch on the home screen.
  2. Choose the Run + Angle mode (the default is Rise + Run), then enter Run = 4450 (4000 plus the 450 overhang) and Angle = 22.5.
  3. Read the Hypotenuse row on the result card: 4816.6 mm, the rafter line length. The card also shows Pitch 5", Angle 22.50°, % Grade 41.42% and Slope Ratio 0.4142.

Or use Triangles: choose the Base + ∠A mode (the default is Base + Rise), enter Base = 4450 and Angle A = 22.5, and Hyp shows 4816.6 mm. Everything is in millimetres by default, and calculations run offline on Android 7.0 or later. Pitch and Triangles are not in the free set (Concrete, Stairs and Check Square are free): they unlock with a weekly subscription that starts with a 3-day free trial, or a one-time lifetime unlock. Google Play shows the prices in your currency. MeisterCalc is Android only; there is an iOS waitlist.

The app does not do ridge deductions, birdsmouths, plumb-cut angles, hips or valleys, or any rafter sizing. Roofing calculators are planned. Rules and sizes are set by the NCC, the NZ Building Code or Approved Documents, and your local council, not by the app.