Rafter Length Calculator
Enter your building span and roof pitch and the calculator lays out a common rafter: the line length from wall to ridge, the overhang tail, the total board length to buy, and the plumb (ridge) and seat (birdsmouth) cut angles. It also counts how many rafters the roof needs. The rafter is just the long side of the roof triangle — run and rise are the other two.
Your measurements
Total width of the building, outside wall to outside wall. The run is half of this.
Inches the roof rises per 12 in of run. 4–9-in-12 is the common residential range; 6-in-12 is a walkable standard.
How far the rafter tail extends past the wall to form the eave. 12–24 in is typical; set 0 for no overhang.
Length along the ridge — used only to count how many rafters you need.
Rafter length (each)
14.46 ft
line 13.35 ft + 1.12 ft overhang · plumb cut 26.6° · buy 16 ft boards
What to buy
- Rafters — 2×8
- 62 rafters(16 ft boards)
Two slopes at 16 in on center over a 40 ft building, plus a rafter at each end. Buy the next stock length up (16 ft) and cut each to 14.46 ft.
Estimates only. Verify against your supplier's coverage figures before ordering.
Footprint
Pitch to scale
6-in-12 · 26.6° · 50% grade
The cuts
- Plumb cut (ridge & tail)
- 26.6°
- Seat cut (birdsmouth)
- 63.4°
- Birdsmouth max depth
- 2.42 in(1/3 of the 2×8)
- Ridge deduction
- 0.75 in(shortened at the peak)
The vertical cut where the rafter meets the ridge (and the matching tail cut). Set your saw to this off square.
The level cut that sits on the wall top plate. Plumb and seat cuts always add to 90°.
Code limits the seat cut to one-third of the rafter depth so it doesn't weaken the rafter — at most 2.42 in into a 2×8.
Each rafter is cut back half the ridge-board thickness so the pair seats against the ridge instead of overshooting the center.
The geometry
- Run (wall to ridge)
- 11.94 ft(half the span, less ½ ridge)
- Rise (to the ridge)
- 5.97 ft
- Slope factor
- 1.118×
- Line length
- 13.35 ft(wall to ridge, no tail)
- Overhang (along slope)
- 1.12 ft(12 in level)
- Total rafter length
- 14.46 ft
The horizontal distance from the outside wall to the center of the ridge.
How high the ridge sits above the wall top plate, from run × pitch ÷ 12.
Rafter length per unit of run — √(pitch² + 144) ÷ 12. Multiply any run by this for the sloped length.
The rafter from the birdsmouth to the ridge — the hypotenuse of the run/rise triangle.
The eave tail measured along the rafter, which is longer than the level overhang because it runs down the slope.
Line length plus the overhang — the full board you cut for each rafter.
The formula
Run = Span ÷ 2 − ridge ÷ 2 · Rise = Run × pitch ÷ 12 · Line length = √(Run² + Rise²) · Total = Line length + Overhang × slope factor · Slope factor = √(pitch² + 144) ÷ 12
Example: A 24 ft span at 6-in-12 with a 12 in overhang (1½ in ridge): run 11.94 ft, rise 5.97 ft, line length 13.35 ft, plus a 1.12 ft overhang = 14.46 ft per rafter — buy 16 ft boards. Plumb cut 26.6°, seat cut 63.4°.
How it works
- 1A common rafter is the long (sloped) side of the roof triangle. Its run and rise are the other two sides.
- 2Find the run: half the building span, minus half the ridge-board thickness (so the rafter seats against the ridge).
- 3Find the rise: run × pitch ÷ 12. A 6-in-12 roof rises 6 in for every 12 in of run.
- 4The line length is √(run² + rise²) — equivalently, run × the slope factor √(pitch² + 144) ÷ 12.
- 5Add the overhang along the slope (level overhang × slope factor), then buy the next stock board length up and cut to size. The plumb cut equals the roof angle; the seat cut is its complement.
Frequently asked questions
How do I calculate rafter length?
Rafter length is the hypotenuse of the roof triangle: √(run² + rise²). The run is half the span minus half the ridge thickness, and the rise is run × pitch ÷ 12. For a 24 ft span at 6-in-12, the run is about 12 ft and the rise 6 ft, so the line length is √(12² + 6²) ≈ 13.4 ft — then add the overhang for the total board length.
What is the slope factor (rafter multiplier)?
The slope factor is √(pitch² + 144) ÷ 12 — how many inches of rafter you get per inch of horizontal run. For a 6-in-12 pitch it's 1.118, so every foot of run is 1.118 ft of rafter. Multiply your run by it for the line length, or multiply a level overhang by it for the sloped overhang.
How deep can a birdsmouth cut be?
Building code (IRC R802.7) limits the seat cut to no more than one-third of the rafter's depth. That's about 1.83 in on a 2×6 (5.5 in), 2.42 in on a 2×8 (7.25 in), and 3.08 in on a 2×10. A deeper notch weakens the rafter over the wall.
What angle do I cut the rafter?
The plumb cut (against the ridge and at the tail) is arctan(pitch ÷ 12) — 26.6° for a 6-in-12 roof. The seat cut on the birdsmouth is the complement, 63.4°. The two always add up to 90°. Set the angle off the square line on your speed square or saw.
How many rafters do I need?
Divide the building length by the spacing and add one for the closing rafter, then double it for both roof slopes. A 40 ft building at 16 in on center needs 31 rafters per side, or 62 total — before any hip, valley or jack rafters.