200+ free tools. No sign-up. No hidden fees.Explore the toolkit ↗
Find a tool ↗

Home›Rafter Length Calculator

Rafter Length Calculator

Work out a common rafter from the span and pitch — line length, overhang tail, total length and the stock board to buy — with the rafter count for the whole roof and a birdsmouth preview.

Calculate your rafter length

Units:

A common rafter is the hypotenuse of a right triangle: the run is half the span (minus half the ridge board, because each rafter stops at the face of the ridge, not the centre), and the rise is the run times the pitch. The line length runs from the ridge plumb cut to the heel of the birdsmouth; the tail is the overhang past the wall. The birdsmouth preview below is a layout check — the full cut is in the Birdsmouth Cut Calculator.

Your results

–
line length (ft)
–
total length with tail (ft)
–
stock board to buy (ft)
–
rafters (both sides)

How rafter length is calculated

A rafter is a right triangle. The run is the level distance from the outside of the wall to the ridge; the rise is how high the roof climbs over that run; the rafter is the hypotenuse.

Net run: run = span ÷ 2 − ridge thickness ÷ 2

Pitch factor: √(1 + (pitch ÷ 12)²) — 6/12 is 1.118, 8/12 is 1.202

Rise: rise = run × pitch ÷ 12

Line length: run × pitch factor (ridge plumb cut to birdsmouth heel)

Tail: overhang × pitch factor

Total length: line length + tail

Rafter count: (building length ÷ spacing + 1) × 2 sides

The ridge deduction is the step most people miss: each rafter stops at the face of the ridge board, not the centre, so half the ridge thickness comes off the run first. Forgetting it makes every rafter too long and pushes the peak up. This matches the ChiselJobs and GalaxyOfTools rafter formulas: line length 13 ft 4-3/16 in for a 24 ft span at 6/12 with a 1½ in ridge — this calculator gives 13.35 ft, the same number.

Worked example

A gable roof, 24 ft span, 6/12 pitch, 1½ in ridge, 12 in overhang, 2×8 rafters:

Net run: 24 ÷ 2 − 1.5 ÷ 24 = 11.94 ft

Pitch factor: √(1 + 0.25) = 1.118

Rise: 11.94 × 0.5 = 5.97 ft

Line length: 11.94 × 1.118 = 13.35 ft (13 ft 4⅛ in)

Tail: 1 × 1.118 = 1.12 ft

Total length: 13.35 + 1.12 = 14.47 ft → buy 16 ft stock

Rafters for a 40 ft building at 16 in: (40 ÷ 1.333 + 1) × 2 = 62

Birdsmouth preview: heel 1.75 in, notch 1.57 in (21.6% of 7¼ in — under the 25% IRC limit), HAP 6.36 in

A 28 ft span at the same pitch is 15.58 ft of line length and 16.70 ft total — buy 18 ft stock. A 12 ft span at 4/12 is 6.34 ft of line length and 7.45 ft total — buy 8 ft stock.

How much do rafters cost? (US, 2026)

Prices are 2026 US retail ranges for #2 SPF dimensional lumber (EZ-Estimates framing rates, 2026). Longer boards cost more per foot than short ones; prices move with the lumber market — check the week you buy.

Rafter boardTypical price (16 ft)
2×6 × 16 ft$14–$20
2×8 × 16 ft$18–$26
2×10 × 16 ft$26–$36
2×12 × 16 ft$36–$50
Ridge board, 2×8 × 16 ft$18–$26
Roof framing labour (stick-built)$3–$6 per sq ft of roof

Waste allowance

Rafter counts are exact — there is no waste % on this page, because every rafter is cut to the same length from a stock board. Buy one spare board for the pattern rafter and any miscut: a single wrong cut on a 24 ft roof costs a whole board, and a second trip to the yard costs an hour.

Frequently asked questions

How long is a rafter for a 24 foot span?

At 6/12 pitch with a 1½ in ridge board, the line length is 13.35 ft (13 ft 4⅛ in) and the total length with a 12 in overhang is 14.47 ft — buy 16 ft stock. The run is 11.94 ft and the rise is 5.97 ft.

How do you calculate rafter length?

Divide the span by 2, subtract half the ridge board thickness for the net run, and multiply by the pitch factor √(1 + (pitch ÷ 12)²). Add the overhang times the same factor for the tail. A 24 ft span at 6/12: run 11.94 ft × 1.118 = 13.35 ft of line length.

What is the rafter length for a 6/12 pitch?

It depends on the span: the pitch factor at 6/12 is 1.118, so the line length is the net run × 1.118. For a 12 ft span it is 6.65 ft, for a 24 ft span 13.35 ft, and for a 28 ft span 15.58 ft (before the overhang tail).

How many rafters do I need?

Divide the building length by the spacing and add one, then double it for both sides. A 40 ft building at 16 in spacing needs (40 ÷ 1.333 + 1) × 2 = 62 rafters; at 24 in spacing it needs (40 ÷ 2 + 1) × 2 = 42.

What size rafter do I need for a 24 foot span?

Size is not geometry — it comes from the span tables in your building code (IRC Table R802.5.1) or an engineer, and it depends on the species, grade, spacing, snow load and whether the ceiling is attached. As a rough guide, a 24 ft span at 16 in spacing usually needs 2×10 or 2×12 rafters; this calculator gives the length, not the size.

Related calculators