Home, Building & Energy
Rafter Length Calculator (Span, Pitch, Overhang and Count)
Rafters are the sloping timbers that form the structure of a pitched roof, running from the ridge at the top to the walls and often beyond them to form the eaves. On a simple gable roof, all the common rafters on one side are the same length, and that length follows directly from the geometry of a right triangle. The horizontal distance a rafter covers is the run, half the building's span minus half the thickness of any ridge board between the rafters. The roof pitch, expressed in many countries as the rise per 12 units of run, such as 6 in 12, or as an angle in degrees, determines the slope. The rafter length along its top edge is the run divided by the cosine of the pitch angle. If the rafters extend past the walls to form an overhang, the horizontal overhang is added to the run before dividing. This calculator returns the rafter length with and without the overhang, the rise of the roof from wall plate to ridge line, the pitch angle and, if you enter the roof length and rafter spacing, the number of common rafters for both sides. For an 8-metre span at a 6-in-12 pitch with a 0.5-metre overhang and no ridge board deduction, each rafter is about 4.47 metres to the wall line and 5.03 metres including the overhang, the roof rises 2 metres, and a 10-metre roof with rafters at 600-millimetre centres needs 34 common rafters. The calculated length is the theoretical line length; carpenters mark plumb cuts at the ridge, birdsmouth notches at the wall plate and tail cuts at the eaves, and buy timber in stock lengths with a margin. Rafter size and spacing depend on loads and spans and must meet local building codes.
How to use this calculator
- Measure the building span across the outside of the walls.
- Enter the pitch as rise per 12 or as an angle.
- Enter the horizontal eave overhang and ridge board thickness.
- Enter the roof length and rafter spacing to count rafters.
- Read the rafter lengths, rise and number of rafters.
From line length to cut length
The line length is measured along a reference line on the rafter. At the ridge, half the ridge board thickness is deducted, measured horizontally, which this calculator includes in the run. At the wall, a birdsmouth notch lets the rafter sit on the wall plate, and at the tail, the overhang is cut plumb or square depending on the fascia detail.
Using a framing square or speed square with the pitch marks makes layout faster, and cutting one pattern rafter, checking its fit, then using it as a template for the rest helps keep the roof consistent.
Structural considerations
Rafter size, grade and spacing depend on the span, roof covering weight, snow and wind loads and local codes. Span tables published by timber associations and building authorities give allowable spans for common sizes. Roofs also need ties, ceiling joists or ridge beams to resist the outward thrust of rafters on the walls.
Complex roofs with hips, valleys and dormers involve hip, valley and jack rafters with different lengths and compound cuts; this calculator covers common rafters on simple gables.
Formula & method
Run = span ÷ 2 − ridge thickness ÷ 2Pitch angle θ = arctan(rise ÷ 12) or the angle enteredRafter length (to the wall line) = run ÷ cos θ; with overhang = (run + overhang) ÷ cos θRafters = 2 × (roof length ÷ spacing + 1), roundedRun = span/2 − ridge/2. θ = arctan(rise/12) or given angle. Rafter = run ÷ cos θ; with overhang = (run + overhang) ÷ cos θ. Rise = run × tan θ. Count = 2 × (⌊length ÷ spacing⌋ + 1).
Worked example
An 8 m span at 6 in 12
- Run = 8 ÷ 2 = 4 m; θ = arctan(0.5) = 26.57°.
- Rafter = 4 ÷ cos 26.57° = 4.4721 m; with 0.5 m overhang = 4.5 ÷ 0.8944 = 5.0312 m.
- Rise = 4 × 0.5 = 2 m; rafters = 2 × (16 + 1) = 34.
Answer: Each rafter is about 5.03 m including the overhang.
Frequently asked questions
How do I calculate rafter length?
Divide the run by the cosine of the pitch angle, adding the overhang to the run if needed.
What is a 6/12 pitch in degrees?
About 26.6 degrees.
What is the run?
Half the span, minus half the ridge board thickness.
Does this include the birdsmouth cut?
No. The line length is before layout cuts and waste.
How many rafters do I need?
Roof length divided by spacing, plus one, for each side.
Can I use feet?
Yes, if all lengths are in feet; the spacing must use the same unit system.