REMODEL FIT
SURVEY BLUE · CALCULATOR · CA-04

Rafter calculator

Enter the building width, roof pitch and overhang. You get the rafter length, the birdsmouth and ridge cuts, and how many boards to buy, drawn to scale.

Your roof
ft
Outside of wall to outside of wall.
ft
Along the ridge. Sets the count.
in
Level distance past the wall.
in
1½ in for a 2x ridge board.
Roof pitch (rise per 12 in of run)
in 12
Rafter size
Actual depth 7¼ in (1½ in thick).
Rafter spacing, on center

Plumb cuts 26.6° off square, seat cut 63.4° off square.

GABLE END VIEW · DRAWN TO SCALE
Run11 ft 11¼ in
Rise6 ft
Rafter line length13 ft 4 3/16 in
With overhang14 ft 5 9/16 in
Pitch angle26.6° · 6/12
Cut anglesplumb 26.6°, seat 63.4°
Rafters62 (31 a side)
Lumber to buy62 × 16 ft2x8 boards, 31 per side.
Your rafter listSURVEY BLUE · CA-04
THE ANSWER

Rafter line length is the run × the slope factor, where run is half the span less half the ridge. For a 24 ft span at 6/12: run 11 ft 11¼ in × 1.118 = 13 ft 4 3/16 in (4.07 m), plus 13 7/16 in (34 cm) for a 12 in overhang. Cut it from a 16 ft board.

How to measure for the calculator

The tool works out common rafters for a simple gable roof: two equal slopes meeting at a ridge board.

  1. Building width: outside face of one wall's top plate to the outside face of the other. Use the framing, not the siding; the rafter heel lines up with that face.
  2. Pitch: inches of rise per 12 in of level run. On an existing roof, touch one end of a level to the underside of a rafter, hold it level, and measure straight up from the 12 in mark. In cm mode the pitch is in degrees.
  3. Eave overhang: the level distance from the wall to the end of the tail, measured flat, not along the slope.
  4. Ridge thickness: 1½ in for a 2x ridge board.
  5. Rafter size and spacing: from your plan or the span tables (below). A 2x8 is 7¼ in (184 mm) deep (PS 20-20, Table 3).
  6. Building length: along the ridge, for the count. Gable overhang rafters are not included.

The math, with your numbers

A common rafter is the long side of a right triangle: run is the level leg, rise the upright leg, and by Pythagoras the line length is the square root of run² + rise². It is the same triangle as a stair stringer in the stair calculator. The slope factor, sqrt(12×12 + rise×rise) ÷ 12, does it in one step: at 6/12 every foot of run takes 1.118 ft of rafter.

  • Half the ridge comes off the run, measured level, because the rafter stops at the ridge face, not its center (Swanson Tool Co.).
  • The tail adds overhang × slope factor.
  • The board is longer than the rafter by depth × rise ÷ 12, because the plumb cuts at both ends lean.
Run = 288 ÷ 2 − 1.5 ÷ 2 = 143.25 in (11 ft 11¼ in)Line = 143.25 × 1.118 = 160.16 in (13 ft 4 3/16 in)

Lengths run along the measuring line, from the outside top corner of the plate to the ridge. Between two plumb cuts both edges are the same length, so you can hook the tape on the top edge.

Rafter length per foot of run

Multiply the run in feet by the last column to get the line length in inches. In metric, multiply the run by the slope factor.

PitchAngleSlope factorRafter per ft of run
3/1214.0°1.030812.37 in
4/1218.4°1.054112.65 in
5/1222.6°1.083313.00 in
6/1226.6°1.118013.42 in
7/1230.3°1.157713.89 in
8/1233.7°1.201914.42 in
9/1236.9°1.250015.00 in
10/1239.8°1.301715.62 in
11/1242.5°1.356616.28 in
12/1245.0°1.414216.97 in

Computed by Remodel Fit; the per-foot values match the framing square table in Swanson's Blue Book.

Worked example: a 24 × 40 ft garage at 6/12

These are the calculator's starting values: 12 in overhang, 2x8 rafters at 16 in on center, 1½ in ridge.

  1. Run: 12 ft less ¾ in = 11 ft 11¼ in (3.639 m). Rise: 12 ft × 6 ÷ 12 = 6 ft.
  2. Line length: 143.25 in × 1.118 = 13 ft 4 3/16 in (4.068 m). The 13 7/16 in tail makes it 14 ft 5 9/16 in.
  3. Board: plus 7¼ × 6 ÷ 12 = 3 5/8 in for the leaning cuts, or 14 ft 9 3/16 in. A 14 ft board is short, so buy 16 ft.
  4. Count: 480 ÷ 16 = 30 spaces, so 31 rafters a side, 62 in all.
span 24 ft12 inrun 11 ft 11¼ inrise 6 ft13 ft 4 3/16 in5 ft 9 in126span 24 ft12 inrun 11 ft 11¼ inrise 6 ft13 ft 4 3/16 in5 ft 9 in126
Figure 1. The worked example to scale, from the gable end, walls drawn 8 ft tall. The dashed measuring lines meet 6 ft above the plates at the ridge center.
line length 13 ft 4 3/16 intail 1 ft 1 7/16 inbirdsmouth: seat 3½ in, heel 1¾ inoffcut 1 ft 2 13/16 in16 ft 2x8 boardline length 13 ft 4 3/16 intail 1 ft 1 7/16 inbirdsmouthoffcut 1 ft 2 13/16 in16 ft 2x8 board
Figure 2. The same rafter laid out on a 16 ft 2x8, to scale. Put the crown up and use the first rafter as the pattern for the rest (Swanson).

The birdsmouth: how deep the seat cut can be

The birdsmouth is the notch that seats a rafter on the wall: a level seat cut on the top plate and a plumb heel cut against its outside face. The 2021 International Residential Code (IRC) limits it three ways:

  • Bearing: at least 1½ in on wood or metal, 3 in on masonry or concrete (R802.6, quoted on The Building Code Forum).
  • Depth: a notch at the end of a rafter may be at most one-fourth of its depth (R802.7.1; same limit in R502.8.1, ICC CodeNotes; LADBS).
  • Overhangs: a notched rafter may overhang at most 24 in and must keep at least 3½ in of depth (R802.7.1.1, Building Code Trainer).

The calculator starts with a 3½ in seat, the width of a 2x4 plate, and shortens it in 1/16 in steps until the notch, measured square to the rafter edge, is at most a quarter of the depth. That leaves at least 4 1/8 in of a 2x6, so the 3½ in rule is met too. Steeper roofs get shorter seats.

RafterDepthMax notchSeat at 4/126/128/1212/12
2x65½1 3/83½3 1/162 7/161 15/16
2x87¼1 13/163½3½3¼2 9/16
2x109¼2 5/163½3½3½3¼
2x1211¼2 13/163½3½3½3½

Inches. Depths from the AWC span tables; seats rounded down to 1/16 in. All exceed the 1½ in minimum bearing.

AT THE WALL PLATEseat 3½ inheel 1¾ in26.6°AT THE RIDGE½ ridge ¾ in2x10 ridge board6 inAT THE WALL PLATEseat 3½ inheel 1¾ in26.6°AT THE RIDGE½ ridge ¾ in2x10 ridge board6 in
Figure 3. The worked example enlarged, to scale (see the 6 in bar). Plumb cuts 26.6° off square, seat cut 63.4° off square. Birdsmouth notch 1 9/16 in deep, 22% of the 7¼ in rafter (limit 25%). Plumb cut at the ridge 8 1/8 in, so the ridge board must be a 2x10 (9¼ in) or deeper.

Ridge board or ridge beam

IRC R802.3: a ridge board must be at least 1 in nominal thick and no shallower than the cut end of the rafter (2021 IRC text, in the 2021 Seattle Residential Code). That cut end is the plumb cut, depth ÷ cos(angle): 8 1/8 in for a 2x8 at 6/12, so the ridge is a 2x10. Hence the habit of buying the ridge one size deeper; steep roofs need two.

Rafter4/126/128/1210/1212/12
2x62x82x82x82x82x10
2x82x102x102x102x122x12
2x102x122x122x122x142x14
2x122x142x142x162x16deeper

Shallowest 2x ridge that covers the plumb cut. A 2x14 is 13¼ in and a 2x16 15¼ in deep (PS 20-20); few yards stock them, so 2x12 rafters often get an engineered ridge.

A ridge board is not a beam. Ceiling joists or rafter ties at the plates stop the walls spreading; the ridge only gives the rafters something to push against. Where no ties run across, as under a cathedral ceiling, R802.3 requires an engineered ridge beam carried by a wall or column at each end. Below 3/12, ridges, hips and valleys must be designed as beams (R802.4.4), and opposing rafters must line up within 1½ in (R802.4.2).

What this calculator does not do: size the rafters

It gives geometry, not strength. Whether a 2x8 can span 12 ft depends on species, grade, snow or live load, dead load, spacing and whether a ceiling hangs from the rafters.

IRC Tables R802.4.1(1) to (8) cover a 20 psf roof live load and ground snow loads of 30, 50 and 70 psf, each with the ceiling attached or not. Spans are measured along the horizontal projection: the run, not the rafter length (2021 IRC R802.4.1; AWC). For other species, grades or loads, use the free AWC span calculator.

Check your local code, and an engineer for spans. Towns adopt different IRC editions and set their own snow and wind loads. Size rafters from your local tables, and have a design professional check spans near a table limit, cathedral ceilings, ridge beams, roofs under 3/12 and overhangs past 24 in.

What to buy

  • Rafters: one board each, end rafters included, in the shortest stock length with 1 in to spare. Lumber is trimmed to at least its nominal length (PS 20-20, 5.3.2), so a 16 ft board is never short. There is little cutting waste; buy a spare or two for split or badly bowed boards.
  • Lengths: Lowe's sells lumber "usually" in 8 to 16 ft (Lowe's) and lists 20 ft 2x6 to 2x12 (20 ft lumber). Past 20 ft, ask the yard or use engineered rafters.
  • Ridge board: the size above, as long as the building plus the gable overhangs.
  • Rafter ties or ceiling joists: at least 2x4, in the lower third of the attic, nailed per IRC Table R802.5.2 (Knox County handout; AWC).
  • Collar ties, if used: upper third, at least 1x4, at most 4 ft apart; ridge straps may replace them (R802.4.6). They do not replace rafter ties.
  • Hurricane ties: IRC Table R802.11 gives the uplift each rafter-to-wall joint must resist (STRUCTURE), and FEMA says toenails alone are not acceptable for uplift in high-wind regions (FEMA 499). One per rafter: 62 here.
  • Sheathing and walls: see the plywood calculator and the stud calculator.

Questions people ask

How do you calculate rafter length?

Multiply the run by the slope factor. Run is half the span less half the ridge; at 6/12 the factor is 1.118. A 24 ft span gives 143.25 × 1.118 = 13 ft 4 3/16 in, plus overhang × 1.118 for the tail.

Do I subtract the ridge board?

Yes, half its thickness, measured level. A 1½ in ridge takes ¾ in off the run, about 13/16 in off a 6/12 rafter.

How deep can I cut a birdsmouth?

At most one-fourth of the rafter depth (IRC R802.7.1), keeping at least 3½ in on an overhanging rafter (R802.7.1.1). On a 2x8 that is 1 13/16 in.

What size rafter do I need for a 24 ft span?

It depends on load, species and grade: check IRC Tables R802.4.1(1) to (8) or the AWC calculator, using the run, about 12 ft, as the span.

What angle is a 6/12 roof?

26.6°. The slope factor is 1.118 (13.42 in per foot of run) and the seat cut is 63.4° off square.

Does this roof rafter calculator do hip roofs?

Only the common rafters. A hip or valley rafter takes 18.00 in per foot of run at 6/12, against 13.42 in for a common (Swanson).

Sources

Checked October 7, 2026. Slope factors and tables computed by Remodel Fit; metric converted from inches.