How the rafter length is worked out
A common rafter is the long side of a right triangle. The level side is the run and the upright side is the rise.
- Run: half the building width, minus half the ridge board thickness, because each rafter stops at the face of the ridge.
- Slope factor: √(1 + (pitch ÷ 12)²). For a 6/12 roof that's √1.25 = 1.118.
- Rafter length: run × slope factor, measured from the outside of the wall to the ridge.
- Overhang tail: the level overhang × slope factor, added to the end of the rafter.
Lengths here are measured along the top edge of the rafter on the line from wall to ridge. Leave a little extra and trim the tail on site, since walls and ridge boards are rarely exactly on plan.
Rafter length by roof pitch
| Pitch | Angle | Slope factor | Rafter for a 12 ft run |
|---|---|---|---|
| 3/12 | 14.0° | 1.031 | 12 ft 4⅜ in |
| 4/12 | 18.4° | 1.054 | 12 ft 7¾ in |
| 5/12 | 22.6° | 1.083 | 13 ft |
| 6/12 | 26.6° | 1.118 | 13 ft 5 in |
| 7/12 | 30.3° | 1.158 | 13 ft 10¾ in |
| 8/12 | 33.7° | 1.202 | 14 ft 5⅛ in |
| 9/12 | 36.9° | 1.250 | 15 ft |
| 10/12 | 39.8° | 1.302 | 15 ft 7½ in |
| 12/12 | 45.0° | 1.414 | 16 ft 11⅝ in |
Multiply your own run by the slope factor for any pitch in the table.
Birdsmouth cut: seat, HAP and the code limit
The birdsmouth is the notch that lets the rafter sit flat on the wall plate. Its seat is level and usually as wide as the plate. Its heel is plumb and sits against the outside of the wall. The rafter left above the seat is the HAP (height above plate).
- Heel cut = seat × pitch ÷ 12
- Notch depth (square to the rafter edge) = seat × sin(roof angle)
- HAP = rafter depth ÷ cos(roof angle) − heel cut
The 2021 IRC limits notches at the ends of a rafter to one-fourth of its depth (R502.8.1, applied to rafters by R802.7.1) and asks for at least 1½ in of bearing on wood (R802.6). The calculator checks both and gives the largest seat that keeps the notch within a quarter of the depth. The table shows that largest seat:
| Rafter | 4/12 | 6/12 | 8/12 | 12/12 |
|---|---|---|---|---|
| 2×6 (5.5 in) | 4¼ in | 3 in | 2⅜ in | 1⅞ in |
| 2×8 (7.25 in) | 5⅝ in | 4 in | 3¼ in | 2½ in |
| 2×10 (9.25 in) | 7¼ in | 5⅛ in | 4⅛ in | 3¼ in |
| 2×12 (11.25 in) | 8⅞ in | 6¼ in | 5 in | 3⅞ in |
Where the table is below the plate width, the rafter bears on only part of the plate. Below 1½ in, use a deeper rafter or a different bearing detail. Some codes and inspectors treat birdsmouth cuts differently, so check locally.
Worked example
A garage 24 ft wide and 30 ft long, 6/12 pitch, 1 ft overhang, 1½ in ridge board, rafters 16 in on center:
- Run: 24 ÷ 2 − 1½ in ÷ 2 = 11 ft 11¼ in
- Slope factor: √(1 + 0.5²) = 1.118
- Wall to ridge: 11 ft 11¼ in × 1.118 = 13 ft 4⅛ in
- Overhang: 1 ft × 1.118 = 1 ft 1⅜ in, total 14 ft 5⅝ in, so buy 16 ft boards
- Cuts: plumb 26.6°, seat 63.4°
- Count: 360 in ÷ 16 in = 22.5 → 23 spaces + 1 = 24 per side, 48 rafters
- Birdsmouth on a 2×8 with a 3½ in seat: heel 1¾ in, notch 1⅝ in deep (22% of the depth), HAP 6⅜ in
- Ridge: 6 ft 6 in above the wall plate, 14 ft 6 in above the floor on 8 ft walls
Common questions
How do you calculate rafter length?
Multiply the run by the slope factor: rafter length = run × √(1 + (pitch ÷ 12)²). The run is half the building width minus half the ridge board. A 24 ft wide 6/12 roof with a 1½ in ridge has an 11 ft 11¼ in run, so each rafter is 13 ft 4⅛ in from the wall to the ridge, plus 1 ft 1⅜ in for a 1 ft overhang: 14 ft 5⅝ in in total.
How many rafters do I need?
Divide the building length in inches by the spacing (16 or 24 in on center), round up and add one for the end. Do that for each side of a gable roof. A 30 ft building at 16 in on center needs 24 rafters per side, 48 in total.
What angle do I cut a rafter?
The plumb cut at the ridge is cut at the roof's pitch angle: 26.6° for a 6/12 roof. The seat cut, where the rafter sits on the wall, is square to it at 63.4°. On a rafter square, set the common scale to the rise (6 for 6/12) to mark the plumb line.
How deep can a birdsmouth cut be?
The IRC (2021, R502.8.1, which R802.7.1 applies to rafters) limits notches at the ends of a member to one-fourth of its depth, and R802.6 needs at least 1½ in of bearing. On a 2×8 (7¼ in deep) at 6/12, a 3½ in seat cuts 1⅝ in deep, 22% of the rafter, which is within the limit. Codes and inspectors can treat birdsmouth cuts differently, so check with yours.
What is HAP on a rafter?
HAP is the height above plate: the plumb distance from the birdsmouth seat up to the top edge of the rafter. It is the same on every rafter, so it keeps the roof plane flat. A 2×8 at 6/12 with a 3½ in seat has a HAP of 6⅜ in.
How do I convert roof pitch from degrees?
Rise per 12 = 12 × tan(angle). A 30° roof is 6.93/12 and a 45° roof is 12/12. The calculator accepts pitch as X/12, degrees or the total rise.
What size lumber should I use for rafters?
That depends on the span, the rafter spacing, the wood species and grade, and the snow and dead loads where you live. Rafter span tables in your local building code set it, so this calculator gives lengths and angles but does not size the lumber.
Which board lengths can I buy?
Dimensional lumber is usually stocked from 8 to 24 ft in 2 ft steps. The calculator picks the shortest of those that fits. Longer rafters usually mean engineered lumber or a different roof design, so ask your supplier.
Sources
- 2021 International Residential Code, Chapter 8: R802.6 bearing (1½ in on wood), R802.7.1 cutting and notching of rafters
- 2021 International Residential Code, Chapter 5: R502.8.1 notches at the ends of a member no more than one-fourth of its depth
- Wikipedia, Lumber: real depths of 2× lumber (American Softwood Lumber Standard)