How rafter length works
A common rafter is the long side of a right triangle: its run is level, its rise is straight up, and the rafter spans the two. The pitch fixes the shape of that triangle, so every inch of run always needs the same length of rafter, and that ratio is the multiplier. Multiply the run by it and you have the rafter.
Three adjustments turn that into a board you can cut. The run is half the building span, measured from the outside of the wall. Half the ridge board's thickness comes off the run, because the rafter stops at the face of the ridge rather than its center. And any overhang adds its own length along the slope. Every line parallel to the rafter's edge has the same length between two plumb cuts, which is why a framer can measure along the top edge, the bottom edge, or a pencil line in between and get the same number.
The formula
Span is the building width, outside of wall to outside of wall, and span ÷ 2 is the run. Pitch is inches of rise per 12 inches of run, ridge is the ridge board's thickness, and overhang is measured level from the outside of the wall. The plumb cut sits at arctan(pitch ÷ 12) off square. A regular hip or valley swaps in √(2 + (pitch ÷ 12)²) because it travels corner to corner at 45 degrees in plan.
Worked example
A 24 ft wide garage with a 6 in 12 roof, a 12 inch overhang, a 2x ridge board, and 2x8 rafters your plans call for. The run is 24 ÷ 2 = 12 ft (144 in), and half the ridge takes it to 143.25 in. The multiplier at 6 in 12 is 1.1180, so the line length is 143.25 × 1.1180 = 160.16 in, or 13 ft 4 3/16 in, and the overhang adds 12 × 1.1180 = 13.42 in of tail.
Mark each rafter at 14 ft 5 9/16 in. The plumb cuts lean across the board, adding 3.63 in, so the stock has to be 177.2 in, and the next even length up is a 16 ft 2x8. The plumb cuts are 26.57 degrees off square. A 3 1/2 inch seat on a 2x4 wall gives a 1 3/4 inch heel and a notch 1.57 in deep, 21.6% of the rafter's depth, with 6 3/8 in of rafter left standing over the wall.
Frame the same garage as a hip roof and each hip is 19 ft 4 7/8 in, cut from a 20 ft 2x10 at 19.47 degrees, dropped 1/4 in at the seat.
Your ridge board has to be deeper than your rafters
Framers have a saying that the ridge goes one size up from the rafters, and the code quietly agrees. IRC R802.3 wants a ridge board at least 1 inch nominal thick and "not less in depth than the cut end of the rafter." The cut end is the plumb cut, and a plumb cut runs across the board at an angle, so it is longer than the board is deep: depth × multiplier. A 2x8 cut at 6 in 12 has a plumb cut 8.11 inches deep, more than the 7 1/4 inches of a 2x8 ridge, so the smallest ridge that meets the rule is a 1x10 or 2x10. That holds up to about 9 1/2 in 12, and past it a 2x8 rafter needs a 2x12 ridge. Hips and valleys follow the same rule at 2 inches nominal thick (R802.4.3).
| Rafter (depth) | 4 in 12 | 6 in 12 | 8 in 12 | 10 in 12 | 12 in 12 |
|---|---|---|---|---|---|
| 2x6 (5 1/2 in) | 2x8 (5.80) | 2x8 (6.15) | 2x8 (6.61) | 2x8 (7.16) | 2x10 (7.78) |
| 2x8 (7 1/4 in) | 2x10 (7.64) | 2x10 (8.11) | 2x10 (8.71) | 2x12 (9.44) | 2x12 (10.25) |
| 2x10 (9 1/4 in) | 2x12 (9.75) | 2x12 (10.34) | 2x12 (11.12) | 2x14 (12.04) | 2x14 (13.08) |
| 2x12 (11 1/4 in) | 2x14 (11.86) | 2x14 (12.58) | engineered (13.52) | engineered (14.64) | engineered (15.91) |
Each cell is the smallest standard ridge depth that covers the rafter's cut end, with the cut end in inches beside it; a 1x board of the same depth also satisfies R802.3. We stop the list at 2x14 because deeper sawn boards are rarely stocked, so a steep roof framed in 2x12s usually ends up with an engineered ridge.
The bird's mouth: seat, heel, and the one-fourth line
The bird's mouth is the notch that lets a rafter sit on the wall: a level seat cut that rests on the top plate and a plumb heel cut against its outside face. The heel is the seat times the pitch over 12, and the notch, measured square to the rafter's edge, is the seat times the sine of the roof angle. Two rules pull on it from opposite sides. R802.6 wants at least 1 1/2 inches of bearing on wood, which sets a minimum seat. R802.7.1 applies the notching rules of R502.8.1 to rafters, and those cap a notch at the end of a member at one fourth of its depth, which sets a maximum.
Cutting the seat as wide as the plate is the habit, and on a steep roof or a thick wall the habit overshoots. A 2x8 on a 2x6 wall at 6 in 12 gets a 5 1/2 inch seat and a notch 2.46 inches deep, 33.9% of the rafter; keep the seat to 4.05 inches and it stays inside one fourth. A 2x12 at 12 in 12 tops out at a 3.98 inch seat, and at 4 in 12 it can take 8.89 inches. Framers writing in the Journal of Light Construction read the rule the same way and make the same point. Whether your inspector treats a bird's mouth as an end notch is their call, which is why the calculator shows the percentage instead of a verdict. And at the extreme, a 2x4 rafter at 12 in 12 cannot meet both rules at once: one fourth of its depth allows only a 1.24 inch seat.
Hip and valley rafters: where 16.97 comes from
A regular hip runs corner to corner at 45 degrees in plan, so for every 12 inches the common rafters travel, the hip travels 12 × √2 = 16.97 inches while rising the same amount. That is why a speed square has a separate HIP-VAL scale and why hips sit at a shallower angle than the roof. At 6 in 12 the numbers come out beautifully round: 16.97 squared is 288, plus 6 squared is 324, the square of 18, so the hip measures exactly 18 inches for each foot of common run.
Two hip details catch people. A hip's top corners stick up past the roof planes on either side, so it gets dropped at the seat by half its thickness times the pitch over 16.97 (1/4 inch for a 2x at 6 in 12) or has its top edges beveled. A valley never needs dropping, because the planes slope up and away from it. And the jack rafters that land on a hip step down by the spacing times the common multiplier: at 6 in 12 that is 17 7/8 inches at 16 inches on center.
What this page does not do: size the rafter
Length and angles are geometry. Size is structure, and it lives in the IRC's rafter span tables (Tables R802.4.1(1) through (8), for a 20 psf roof live load and for ground snow loads of 30, 50, and 70 psf), or in the American Wood Council's span tables for other species, grades, and loads. One detail matters when you use them: rafter spans are measured along the horizontal projection (R802.4.1). A 12 ft run at 12 in 12 is a rafter nearly 17 ft long, 16 ft 11 5/8 in, and you look it up as 12 ft. Below 3 in 12 the ridge, hips, and valleys have to be designed as beams (R802.4.4), and the ceiling joists or rafter ties that keep the walls from spreading have their own rules (R802.5.2). If you need the pitch first, the roof pitch calculator finds it from a rise and run, and our board foot calculator prices the lumber once you know what to buy.