How to use the rafter calculator
- Enter the building span: the outside-to-outside width of the walls the rafters sit on.
- Enter the pitch as rise per 12 inches of run (6 for a 6/12 roof). Not sure? Use the roof pitch calculator.
- Enter the overhang — the horizontal distance the eave sticks out past the wall.
- Enter the ridge board thickness: 1.5 in for a 2× ridge board, 0 if rafters meet each other directly.
- Enter the building length and spacing to count rafters.
The rafter length formula
Run = span ÷ 2 − ridge thickness ÷ 2
Line length = run × √(1 + (pitch ÷ 12)²)
Overhang length = overhang × √(1 + (pitch ÷ 12)²)
Rafter length = line length + overhang length
The square-root term is the Pythagorean theorem expressed per foot of run, and is the same "pitch multiplier" printed on the rafter tables of a framing square. The line length runs from the outside edge of the wall plate (where the bird's-mouth seat cut sits) to the face of the ridge board, measured along the top edge of the rafter.
Worked example
A 24 ft wide garage with a 6/12 roof, 12-inch overhang, 1.5-inch ridge board, 40 ft long, rafters 16 inches on center:
- Run: 12 ft − 0.75 in = 11.94 ft
- Multiplier for 6/12: √(1 + 0.25) = 1.118
- Line length: 11.94 × 1.118 = 13.35 ft = 13 ft 4¼ in
- Overhang: 1 ft × 1.118 = 1 ft 1½ in
- Total rafter: 14.46 ft = 14 ft 5½ in → buy 16 ft lumber
- Rise at ridge: 12 × 6/12 = 6 ft; plumb cut angle 26.6°, seat cut angle 63.4°
- Count: 40 × 12 ÷ 16 = 30 spaces + 1 = 31 per side → 62 rafters
Lumber is sold in 2 ft increments (8, 10, 12 … 24 ft). Always leave a few inches for squaring the ends and the plumb cut, which is why 14 ft 5½ in rounds up to 16 ft.
Cutting the rafter
- Plumb cut at the ridge: angle equal to the roof angle, marked with a speed square set to the pitch number on the "common" scale.
- Bird's mouth at the wall: a seat cut that sits flat on the top plate plus a plumb heel cut. A widely used framing rule is to cut no deeper than one-third of the rafter's depth.
- Tail cut at the overhang: usually plumb, so fascia boards hang vertically.
- Cut one rafter as a pattern, test-fit it on both sides, then use it to mark the rest.
Rafter size and spans
This calculator finds length, not structural size. The allowable span for 2×6, 2×8, 2×10 or 2×12 rafters depends on wood species and grade, spacing, snow load and dead load; use the rafter span tables in IRC Section R802 or the American Wood Council span tables, and check with your local building department. Rafter ties or ceiling joists are needed to resist outward thrust on the walls.
Tips
- Crown every board (sight down its edge) and install all crowns up.
- On long buildings, measure the actual wall width at both ends and the middle — walls are rarely perfectly parallel.
- Add rafters for gable overhangs (ladder framing) and doubled rafters around skylights or openings.
Frequently asked questions
How do I calculate rafter length?
Take half the span minus half the ridge board, multiply by √(1 + (pitch ÷ 12)²), then add the overhang multiplied by the same factor.
How long is a rafter for a 24 ft span with a 6/12 pitch?
About 13 ft 4 in from wall to ridge, or 14 ft 5½ in with a 12-inch overhang, so you would buy 16 ft boards.
How many rafters do I need?
Divide the building length in inches by the spacing, round up and add one for each side, then double it. A 40 ft building at 16 inches on center needs 31 per side, 62 total.
What is the plumb cut angle on a rafter?
The plumb cut angle equals the roof angle, for example 26.57 degrees for a 6/12 pitch. The seat cut is 90 degrees minus that.
Does rafter length include the overhang?
This calculator shows both: line length from wall to ridge and total length including the overhang tail.