Rafter calculator
Calculate rafter length, count, and total timber for a simple gable roof. Calculations stay local in the browser and the assumptions are adjustable.
Project settings
Calculate rafter length and estimate pairs and total timber for a simple gable roof.
Quantity estimate only: adapt the values to the product, the site, and the applicable technical rules.
Was this tool useful?
On this page
How does this tool work?
For a gable roof the practical question is twofold: how long must each rafter be, and how many are needed along the building? This calculator takes the building width, the pitch in degrees, the overhang and the spacing to return the ridge rise, the length of one rafter, the number of pairs and the linear metres of timber with an allowance.
The half span is half the building width. Ridge rise comes from the tangent of the pitch: half span × tan(pitch). The horizontal overhang is added to the half span to form the rafter run, which is divided by the cosine of the pitch to get the sloped length.
Pairs are the gaps along the building (length ÷ spacing, rounded up) plus one end pair. Rafters are twice that number, and the linear metres are the count multiplied by one rafter’s length, plus the allowance.
Geometric rafter length comes from half span, pitch and overhang and can be checked with trigonometry or Pythagoras. Timber section, allowable span, loads and connections remain a separate structural-design task.
How to use this tool
Enter the building size
Give the width measured between rafter bearings and the length covered by the roof.
Enter the pitch in degrees
If you know the pitch as a ratio, convert it: a 6 in 12 pitch is about 26.6°, 12 in 12 is 45°.
Add overhang and spacing
The overhang is measured horizontally from the wall; spacing is the centre-to-centre distance between rafters.
Adjust the allowance
The allowance covers end cuts, birdsmouth notches and rejected pieces.
Rafter trigonometry
The rafter is the hypotenuse of a right triangle whose base is the horizontal run.
Ridge rise
H = (W ÷ 2) × tan α
W is the building width, α the pitch.
Rafter length
Lr = (W ÷ 2 + o) ÷ cos α
o is the horizontal overhang. Same as √(run² + rise²).
Rafter pairs
P = ⌈L ÷ s⌉ + 1
L is the building length, s the spacing.
- α
- roof pitch (degrees)
- o
- horizontal overhang (m)
- s
- rafter spacing (m)
- L
- building length (m)
The calculation applies to a symmetrical gable roof. It does not subtract the ridge board thickness, add gable-end overhangs or handle hips and valleys.
Use cases
Shed or garage
Know the rafter length of a small gable roof before ordering timber.
Extension with a new roof
Compare how a 30° or 45° pitch changes ridge height and timber volume.
Checking a roofing quote
Confirm the order of magnitude of the rafter count and linear metres quoted.
Examples
8 × 10 m house at 35°
The run is 4 + 0.40 = 4.40 m; 4.40 ÷ cos 35° = 5.37 m. Along 10 m, 10 ÷ 0.60 = 16.7, rounded to 17 gaps, so 18 pairs.
Input
Width 8 m, length 10 m, pitch 35°, overhang 40 cm, spacing 60 cm, 10% allowanceResult
Rise 2.80 m, rafter 5.37 m, 18 pairs, 36 rafters, 193.37 m then 212.71 m with allowance6 × 9 m workshop at 45°
At 45° the rise equals the half span. 9 ÷ 0.50 = 18 gaps, so 19 pairs.
Input
Width 6 m, length 9 m, pitch 45°, overhang 50 cm, spacing 50 cm, 10% allowanceResult
Rise 3.00 m, rafter 4.95 m, 19 pairs, 38 rafters, 188.09 m then 206.90 m with allowanceTips and best practices
- Order rafters by the piece in the next stock length above the calculated length, rather than in linear metres.
- Check the minimum pitch allowed by the chosen covering: it depends on the tile or slate model and the local exposure.
- Mark out one pattern rafter, test it in place, then copy its cuts onto the others.
- Keep the spacing required by the battens or roof sheathing to avoid needless trimming.
Sources and references
- Weisstein E.W., Pythagorean Theorem (opens in a new tab), Wolfram MathWorldPage in English
- Wienerberger — Minimum pitch for tiled roofs explained (calculating slope in %) (opens in a new tab)Page in French
Frequently asked questions
How do I calculate rafter length?
Add the horizontal overhang to the half span, then divide by the cosine of the pitch. For a 4 m half span, 40 cm overhang and 35°, that is 4.40 ÷ 0.819 ≈ 5.37 m.
How do I convert a pitch ratio or percentage to degrees?
Take the arctangent of rise divided by run: 12 in 12 (100%) is 45°, 70% is about 35° and 6 in 12 (50%) is about 26.6°. The slope calculator does this conversion.
Which rafter spacing should I use?
400, 450 or 600 mm centres are common, but spacing depends on timber size, span between purlins, snow and wind loads and the covering. It is set by a structural design, for example under Eurocode 5 or local span tables.
Does the calculator size the rafters?
No. It works out geometry and quantities. Section size, strength grade and connections come from a structural calculation or a manufacturer’s span tables.
Why add one pair to the number of gaps?
Each end of the building needs a rafter. Over 9 m at 50 cm spacing there are 18 gaps and therefore 19 pairs.
Is the overhang measured along the rafter?
No, horizontally from the outer face of the wall. If you know the overhang along the slope, multiply it by the cosine of the pitch before entering it.
Related tools
Keep going with these tools
Tools similar or complementary to this one.
Works well with
Calculate sloped roof area and the number of tiles required.
Convert slope between percent, degrees, rise, length and ratio.
Estimate studs, plates, and timber length for a framed wall.
Read next
Wall, roof and framing materials: studs, rafters, rebar and mortar
A practical guide to dimensions, spacing, lengths and waste allowances when estimating studs, rafters, rebar and mortar.
How many roof tiles do you need? Area, pitch and waste
Estimate roof-tile quantities from the true roof area, pitch, effective tile coverage and an appropriate waste allowance.
Plan a project: how to calculate the right material quantities?
A practical method for turning project dimensions into quantities to buy: areas, volumes, waste allowances, packaging and final checks.
Calculate stairs: risers, rise, tread depth and slope
Learn how to size a staircase from total rise, number of risers, tread depth, available run and the Blondel relationship.