Rafter Length Calculator

Enter the building span, roof pitch, overhang, and ridge board thickness to get the rafter length to mark to the nearest 1/16 inch, the board length to buy, the plumb and seat cut angles, a bird's mouth guide, and the same for a hip or valley rafter. It measures and marks; it does not size rafters.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Rafter Length Calculator.

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

multiplier = √(1 + (pitch ÷ 12)²)  ·  rafter = (span ÷ 2 − ridge ÷ 2 + overhang) × multiplier  ·  hip or valley = (span ÷ 2 − ridge ÷ 2 + overhang) × √(2 + (pitch ÷ 12)²)

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 126 in 128 in 1210 in 1212 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.

Sources

Where the numbers on this page come from. We go to the body that publishes the figure, not to another calculator. See how we verify.

Frequently asked questions

How do you calculate rafter length?

Find the run (half the building span), take half the ridge board's thickness off it, add the level overhang, and multiply by the pitch multiplier, the square root of 1 + (pitch / 12) squared. For a 24 ft span at 6 in 12 with a 2x ridge and a 12 inch overhang: (144 - 0.75 + 12) x 1.1180 = 173.57 inches, or 14 ft 5 9/16 in.

How long are the rafters for a 24 foot span?

At 6 in 12 with a 12 inch overhang and a 2x ridge board, each common rafter measures 14 ft 5 9/16 in, and with the lean of the plumb cuts a 2x8 needs 177.2 inches of stock, so buy 16 ft boards. Without the overhang the rafter is 13 ft 4 3/16 in. A steeper pitch or a wider overhang adds length, so run your own numbers.

How do you calculate hip rafter length?

A regular hip runs at 45 degrees in plan, covering 16.97 inches (12 x the square root of 2) for every 12 inches of common run, so its multiplier is the square root of 2 + (pitch / 12) squared. On a 24 ft wide building at 6 in 12 with a 12 inch overhang and a 2x ridge, that is (144 - 0.75 + 12) x 1.5 = 232.88 inches, or 19 ft 4 7/8 in. The plumb cut sits at 19.47 degrees, and the hip is dropped 1/4 inch at the seat.

How deep can a bird's mouth cut be?

The IRC applies its notching rule to rafters (R802.7.1 pointing to R502.8.1): a notch at the end of a member may not exceed one fourth of its depth, measured square to the edge. It also wants at least 1 1/2 inches of bearing (R802.6). A 2x8 at 6 in 12 can take a seat up to 4.05 inches; a full 5 1/2 inch seat on a 2x6 wall would notch 33.9% of the rafter. Inspectors differ on reading a bird's mouth as an end notch, so ask yours.

What size ridge board do I need?

At least as deep as the rafter's cut end, by IRC R802.3, and the cut end is the rafter depth times the pitch multiplier. A 2x8 rafter at 6 in 12 has an 8.11 inch plumb cut, so the ridge must be at least a 1x10 or 2x10. A 2x8 rafter stays with a 2x10 ridge up to about 9 1/2 in 12, then needs a 2x12.

What size rafters do I need?

That depends on span, spacing, species, grade, and roof and snow loads, and it comes from the IRC's rafter span tables (Tables R802.4.1(1) through (8)) or the American Wood Council's span tables. Look up the horizontal run, not the rafter length: R802.4.1 measures rafter spans along the horizontal projection. This calculator deliberately does not size rafters.

Do I measure the overhang along the rafter or level?

Level, from the outside of the wall, the way the plans show it. The rafter tail is longer than that by the pitch multiplier: a 12 inch overhang at 6 in 12 takes 13.42 inches of rafter. The calculator takes the level figure and does the multiplying.

What is the ridge deduction for a rafter?

Half the ridge board's thickness, measured level, comes off the run, because the rafter stops at the face of the ridge rather than its center. For a 2x ridge that is 0.75 inch of run, which at 6 in 12 shortens the rafter by 0.84 inch along its length. A hip deducts half the ridge's 45 degree thickness instead.

Related calculators