How the calculator works
Enter the building's span from the outside of one wall to the outside of the other, the roof pitch as rise per 12 inches of run, the level overhang and the ridge board thickness.
- Run: span ÷ 2 − ridge thickness ÷ 2. The rafter stops at the face of the ridge board, not its center.
- Slope factor: √(1 + (pitch ÷ 12)²).
- Wall to ridge: run × slope factor, along the rafter's measuring line.
- Overhang: level overhang × slope factor.
- Rafter length: wall to ridge + overhang. The board to buy is the next stock length with at least 6 inches to spare for the ridge plumb cut and squaring the tail.
- Roof angle: arctan(pitch ÷ 12). Ridge height above the top of the walls is run × pitch ÷ 12.
- Rafters: (building length ÷ spacing, rounded up, + 1) × 2, one at each gable end on both sides.
Roof pitch chart
| Pitch | Angle | Slope factor | Rafter per foot of run |
|---|---|---|---|
| 3 in 12 | 14° | 1.031 | 12 ⅜ in |
| 4 in 12 | 18.4° | 1.054 | 12 ⅝ in |
| 5 in 12 | 22.6° | 1.083 | 13 in |
| 6 in 12 | 26.6° | 1.118 | 13 7/16 in |
| 7 in 12 | 30.3° | 1.158 | 13 ⅞ in |
| 8 in 12 | 33.7° | 1.202 | 14 7/16 in |
| 9 in 12 | 36.9° | 1.25 | 15 in |
| 10 in 12 | 39.8° | 1.302 | 15 ⅝ in |
| 12 in 12 | 45° | 1.414 | 17 in |
On a miter saw, the plumb cut at the ridge is a miter of the roof angle from square, and a speed square set to the pitch number on its common scale draws the same line.
Rafter length chart
With a 12-inch overhang and a 1 ½-inch ridge board. The board length leaves at least 6 inches for the cuts.
| Span | 4 in 12 | 6 in 12 | 8 in 12 | 12 in 12 |
|---|---|---|---|---|
| 12 ft | 7 ft 3 ¾ in (8 ft) | 7 ft 9 1/16 in (10 ft) | 8 ft 4 1/16 in (10 ft) | 9 ft 9 ¾ in (12 ft) |
| 16 ft | 9 ft 5 1/16 in (10 ft) | 9 ft 11 15/16 in (12 ft) | 10 ft 8 ⅞ in (12 ft) | 12 ft 7 11/16 in (14 ft) |
| 20 ft | 11 ft 6 ⅜ in (14 ft) | 12 ft 2 ¾ in (14 ft) | 13 ft 1 ¾ in (14 ft) | 15 ft 5 ⅝ in (16 ft) |
| 24 ft | 13 ft 7 ⅝ in (16 ft) | 14 ft 5 9/16 in (16 ft) | 15 ft 6 9/16 in (18 ft) | 18 ft 3 9/16 in (20 ft) |
| 28 ft | 15 ft 8 15/16 in (18 ft) | 16 ft 8 7/16 in (18 ft) | 17 ft 11 7/16 in (20 ft) | 21 ft 1 ½ in (22 ft) |
| 32 ft | 17 ft 10 ¼ in (20 ft) | 18 ft 11 ¼ in (20 ft) | 20 ft 4 ¼ in (22 ft) | 23 ft 11 7/16 in (over 24 ft) |
Example: a 12 × 16 ft shed at 5 in 12
The walls are 12 feet apart outside to outside and 16 feet long, the roof pitch is 5 in 12, the overhang is 12 inches and the ridge is a 2×8, 1 ½ inches thick. Rafters go 16 inches on center.
- Run: 144 ÷ 2 − 1.5 ÷ 2 = 71 ¼ inches.
- Slope factor: √(1 + (5 ÷ 12)²) = 1.083.
- Wall to ridge: 71.25 × 1.083 = 77 3/16 inches, or 6 ft 5 3/16 in.
- Overhang: 12 × 1.083 = 13 inches along the slope.
- Rafter length: 77 3/16 + 13 = 90 3/16 inches, or 7 ft 6 3/16 in. That leaves under 6 inches on an 8-foot board, so buy 10-foot boards, or shorten the overhang a little to use 8-footers.
- Ridge height: 71.25 × 5 ÷ 12 = 29 11/16 inches above the top plates, plus the height of the rafter above its seat cut.
- Rafters: 192 ÷ 16 = 12 spaces, so 13 rafters per side and 26 in all. At 24 inches on center it would be 18.
Tips
- Cut one pattern rafter. Lay out the ridge plumb cut, the birdsmouth and the tail on one board, test it on both walls, then trace it for the rest.
- Measure the span at several places. Walls are rarely perfectly parallel. Use the actual span at each rafter pair if they differ by more than ¼ inch.
- Crown up. Sight down each board and install it with the bow, the crown, facing up so the roof load straightens it.
- Mark with a speed square. Pivot it on the board's edge to the pitch number on the common scale and draw the plumb line.
- Size rafters from the code tables. Span tables give the largest span for each size, spacing, species, grade and snow load.
Frequently asked questions
How do you calculate rafter length?
Take half the building span, subtract half the ridge board's thickness to get the run, then multiply the run by the slope factor, √(1 + (pitch ÷ 12)²). For an overhang, multiply its level distance by the same factor and add it. A 24-foot span at 6 in 12 with a 1 ½-inch ridge has a 143 ¼-inch run and a 160 3/16-inch rafter before the overhang.
What length rafters do I need for a 24-foot span?
At 6 in 12 with a 12-inch overhang, each rafter is about 14 feet 5 ½ inches, so buy 16-foot boards. At 4 in 12 it is 13 feet 7 ⅝ inches, also 16 feet with room for the cuts, and at 12 in 12 it is 18 feet 3 9/16 inches, which takes a 20-foot board.
What angle is a 6/12 roof pitch?
26.6 degrees. A 4/12 pitch is 18.4 degrees, 8/12 is 33.7 degrees, 9/12 is 36.9 degrees and 12/12 is 45 degrees. The angle is the arctangent of rise ÷ run, so 6 ÷ 12 = 0.5 and arctan 0.5 = 26.6°.
How far apart should rafters be?
Usually 16 or 24 inches on center, so 4-by-8 roof sheathing lands on a rafter at every edge. Rafter size depends on the span, the spacing, the wood species and grade, and the snow and dead loads, so pick it from the rafter span tables in your local building code.
What is a birdsmouth cut?
The notch near the bottom of a rafter where it sits on the wall. It has a level seat cut that rests on the top plate and a plumb heel cut against the outside of the wall. Keep it shallow; the seat only needs to bear fully on the plate, and local code limits how deep a notch can be.
What is the slope factor?
The length along the rafter for each unit of level run, √(1 + (pitch ÷ 12)²). It is 1.118 for 6 in 12, so each foot of run takes 13 7/16 inches of rafter. Framing squares print the same number in the rafter table as "length of common rafter per foot of run".
Last updated October 20, 2026.