Framing & structure

Rafter length & span calculator

Work out common rafter length, overhang, stock length and rafter count from run and pitch, then check the rafter span for your size, species and roof load.

Free to use & exportNo signupLocal processingImperial & metric

Loading the local tool…

What a rafter calculator does

A rafter calculator turns the horizontal run and the roof pitch into the length of a common rafter. Enter the run from the wall to the centre of the ridge, the pitch, the eave overhang and the ridge thickness, and it returns the rise, the roof angle, the rafter length to the ridge, the tail length, the overall length, the stock length to order and the number of rafters for the roof.

It also checks whether the rafter size can span the run. Using the same method as the AWC rafter span tables, it works on the horizontal projection with the roof live or snow load, the dead load and the deflection limit for a roof with or without a ceiling attached. For Douglas Fir-Larch No.2 at 20 psf live and 10 psf dead with a ceiling (L/240), it matches the IRC span table to the inch up to the table's 26 ft limit.

Lengths are line lengths along the top edge before the plumb cut and the birdsmouth are marked. The span check is preliminary and does not cover rafter thrust, ceiling ties, wind uplift, hips and valleys or the ridge beam.

How to use the rafter length & span calculator

  1. Choose Imperial or Metric. Imperial is the default, and your choice carries across the free tools.
  2. Enter the Horizontal run (wall to ridge centre), choose the Pitch format (rise per 12 or degrees) and enter the Pitch value.
  3. Add the Eave overhang (horizontal), the Ridge board thickness, the Roof length along the ridge, the Rafter spacing and the number of Roof sides.
  4. For the span check, pick the Species and grade and Rafter size, the Roof load case, the Roof live or snow load, the Dead load and the Live-load deflection limit.
  5. Read the rafter length, stock length and count, then the maximum horizontal span and whether the run passes. Download the result or the SVG roof triangle.

Worked example

Imperial: A 12 ft run at 6:12 with an 18 in overhang and a 1½ in ridge needs 15.02 ft rafters (16 ft stock), 62 for a 40 ft gable at 16 in centres; Douglas Fir-Larch No.2 2x8 spans 18′-5″ under 20 psf live and 10 psf dead at L/240.

Metric: A 3.6 m run at 30° with a 0.45 m overhang and a 45 mm ridge needs 4.65 m rafters (4.8 m stock); 45 × 190 mm C24 at 600 mm centres spans up to 5.32 m under 1.0 kPa live and 0.5 kPa dead.

Rafter length by pitch

The slope factor is the length of rafter per unit of horizontal run: √(1 + (rise ÷ 12)²). Multiply the run (less half the ridge thickness) and the overhang by it to get the line length. The table uses a 12 ft run, an 18 in overhang and a 1½ in ridge.

Slope factor and rafter length: 12 ft run, 18 in overhang, 1½ in ridge
PitchRoof angleSlope factorOverall rafter length
3:1214.0°1.030813.85 ft
4:1218.4°1.054114.16 ft
5:1222.6°1.083314.56 ft
6:1226.6°1.118015.02 ft
7:1230.3°1.157715.56 ft
8:1233.7°1.201916.15 ft
9:1236.9°1.250016.80 ft
10:1239.8°1.301717.49 ft
12:1245.0°1.414219.00 ft

Rafter span table: Douglas Fir-Larch No.2

Rafter spans are horizontal distances from the wall to the ridge, so they apply at any pitch. The calculator matches IRC Table R802.4.1(2) for 20 psf roof live load, 10 psf dead load and a ceiling attached (L/240). The IRC tables stop at 26 ft; the calculator does not.

Without a ceiling attached, the deflection limit relaxes to L/180, which lengthens deflection-governed spans for 2x6 rafters at close spacing; bending governs most other cases, so their spans do not change.

Maximum horizontal rafter spans, Douglas Fir-Larch No.2, 20 psf live, 10 psf dead
Size and spacingL/240 (ceiling)L/180 (no ceiling)
2x6 at 16 in14′-1″14′-7″
2x6 at 24 in11′-11″11′-11″
2x8 at 16 in18′-5″18′-5″
2x8 at 24 in15′-1″15′-1″
2x10 at 16 in22′-6″22′-6″
2x10 at 24 in18′-5″18′-5″
2x12 at 16 in26′-1″26′-1″
2x12 at 24 in21′-4″21′-4″

Rafter spans under snow

Snow is a heavier, longer load than roof live load, so the duration factor drops from 1.25 to 1.15 and spans shorten. The table uses 30 psf snow and 15 psf dead load at L/240. Use the design roof snow load for the site; it can be several times higher in mountain and northern regions.

Maximum horizontal spans, Douglas Fir-Larch No.2, 30 psf snow, 15 psf dead, L/240
Spacing2x62x82x102x12
12 in13′-2″16′-8″20′-4″23′-7″
16 in11′-5″14′-5″17′-8″20′-5″
24 in9′-4″11′-9″14′-5″16′-8″

Worked example: a 6:12 gable

A 24 ft wide gable has a 12 ft run to the ridge centre. At 6:12 the rise is 6 ft and the slope factor 1.1180. Deducting half a 1½ in ridge leaves 11.94 ft of run, or 13.35 ft of rafter; the 18 in overhang adds 1.68 ft, for 15.02 ft overall, so 16 ft stock is ordered.

A 40 ft roof at 16 in centres needs 31 rafters per side, 62 in all. Douglas Fir-Larch No.2 2x8 rafters span up to 18′-5″ under 20 psf live and 10 psf dead with a ceiling attached, so the 12 ft run passes at 42% utilisation.

Who it is for and when to use it

Ordering rafters

Get the stock length and count for a gable or lean-to roof before calling the lumberyard.

Checking a rafter size

Confirm a rafter can span the run under the roof load and ceiling condition, and see what a closer spacing changes.

Laying out a roof

Use the rise, angle and line length to set out the pattern rafter and the ridge height.

Comparing pitches

See how much extra rafter length and material a steeper pitch adds.

Method, formulas & assumptions

Slope factor = √(1 + (rise/12)²) = 1 ÷ cos(angle). Rafter length to ridge = (run − half the ridge thickness) × slope factor; tail = horizontal overhang × slope factor. Count = (roof length ÷ spacing, rounded up, + 1) per side. Span check on the horizontal projection, as in AWC rafter tables: w = (roof live or snow + dead) × spacing, Fb′ = Fb × CF × Cr 1.15 × CD (1.25 roof live, 1.15 snow), deflection on live load at L/240 with a ceiling attached or L/180 without.

Imperial inputs are converted with exact factors (1 ft = 0.3048 m, 1 lb = 0.45359237 kg, 1 US gal = 3.785411784 L) before the calculation runs in SI, then results are converted back.

Common mistakes to avoid

  • Measuring the run to the outside of the ridge instead of its centre, then deducting the ridge twice.
  • Using the sloped length as the span. Rafter span tables use the horizontal projection.
  • Forgetting the overhang when ordering, then finding the stock is a foot short.
  • Choosing L/180 when a ceiling is fastened to the rafters; cracks follow.
  • Ignoring outward thrust. Rafters need ceiling joists, rafter ties or a structural ridge to hold the walls together.

Scope & limits

Line lengths along the top edge before the plumb cut and birdsmouth are marked. The span check covers a simple rafter with uniform load on plan; it excludes the overhang, rafter thrust and ceiling ties, wind uplift, point loads, hips and valleys, and the ridge beam. Confirm with the adopted rafter span tables or an engineer.

Frequently asked questions

How do I calculate rafter length?

Multiply the horizontal run (less half the ridge thickness) by the slope factor √(1 + (rise/12)²), then add the overhang times the same factor. For a 12 ft run at 6:12 with an 18 in overhang and a 1½ in ridge, that is 15.02 ft.

How far can a 2x8 rafter span?

Douglas Fir-Larch No.2 2x8 rafters at 16 in centres span 18′-5″ horizontally under 20 psf live and 10 psf dead load with a ceiling attached, and 14′-5″ under 30 psf snow and 15 psf dead.

Is rafter span measured along the slope?

No. Span tables and this calculator use the horizontal distance from the wall to the ridge, which lets one table cover every pitch.

What is the slope factor for a 6/12 roof?

1.1180. Every foot of run needs about 1.118 ft of rafter.

How many rafters do I need?

Divide the roof length by the spacing, round up and add one for each side. A 40 ft gable at 16 in centres needs 31 per side, 62 in all.

Does the calculator include the birdsmouth and plumb cut?

No. It returns line lengths along the top edge. Mark the plumb cut at the ridge and the birdsmouth at the wall from the pattern rafter.

Does it work for hip and valley rafters?

No. Hip and valley rafters run at 45° in plan and carry different loads. Use it for common rafters only.

Do I need an account to download the result?

No. All calculations, local file processing and exports on this page are free, without an account.

Where are my inputs stored?

The tool keeps inputs in this browser tab. It does not upload them or create a cloud copy. Save or download anything you want to keep before leaving the page. Standard site analytics may operate independently of the tool.

Can I work in metric instead of imperial?

Yes. Use the Imperial / Metric switch above the inputs. Imperial (feet, inches, pounds, gallons) is the default; switching converts every dimensional field and result, and your choice is remembered across the free tools in this browser.

Further reading

In this category

Keep developing your project in Harth.

Bring your ideas, models and project research into one workspace. Downloaded results are yours to take with you.