Reviewed · Prices checked October 2026 · How we calculate

Rafter Calculator: How Long Are My Rafters?

Enter the span wall to wall, the roof pitch, the overhang and the building's length. You get the rafter length, the rise and roof angle, and how many rafters to buy.

Inputs

Units
ft
ft
in
in 12

Inches of rise for every 12 in of run; 6 means a 6/12 roof.

Rafter spacing
$

Shopping list

Updates as you type
14 ft 5 9/16 inrafters

for a 24 ft span at 6 in 12 (26.6°) with a 12 in overhang: 48 rafters at 16 in on center, cut from 16 ft boards.

Rafter details
Rafter length13 ft 4 3/16 in ridge to wall line + 1 ft 1 7/16 in tail = 14 ft 5 9/16 in
Rise to the ridge6 ft 0 in (roof angle 26.6°: set the plumb and seat cuts from it)
Rafters24 per side × 2 = 48 at 16 in on center
Code limits (IRC R802, R502.8.1)With an overhang the birdsmouth notches the cantilevered part: leave at least 3 1/2 in of rafter above the seat cut, and keep the overhang to 24 in or less (R802.7.1.1). Other notches: no deeper than 1/6 of the rafter, no longer than 1/3 of its depth, and not in the middle third of the span. At least 1 1/2 in of bearing on the wall; a ridge board at least 1 in thick and as deep as the cut end. Size the rafters from the span tables.
Rafters at your price—
Show the math
Run: 24 ft × 12 ÷ 2 − 1.5 ÷ 2 (ridge board) = 143.25 inSlope factor: √(1 + (6 ÷ 12)²) = 1.1180(143.25 + 12 in overhang) × 1.1180 = 173.57 in

The price you type is used for this estimate only; it isn't saved.

How it works

The formula

run = span ÷ 2 − half the ridge board
slope factor = √(1 + (pitch ÷ 12)²)
rafter length = (run + overhang) × slope factor · roof angle = arctan(pitch ÷ 12)
  • A common rafter is the hypotenuse of a right triangle: the run across and the rise up. The slope factor turns any level distance into the length along the rafter.
  • We stop each rafter half of a 1 1/2 in ridge board short of the ridge line, and measure the overhang level from the wall.
  • Code limits from the 2021 IRC: with an overhang, the birdsmouth notches the cantilevered part of the rafter, which must keep at least 3 1/2 in above the cut with an overhang of 24 in or less (R802.7.1.1); with no overhang it's an end notch, no deeper than 1/4 of the rafter (R502.8.1). Other notches are limited to 1/6 of the depth and kept out of the middle third. At least 1 1/2 in of bearing on wood (R802.6); a ridge board at least 1 in thick and as deep as the cut end (R802.3).
  • This finds length and count. Pick the rafter size (2×6, 2×8…) from the IRC rafter span tables for your snow load and spacing.

Rafter length by pitch, 24 ft span, 12 in overhang

Rafter length, rise and angle by roof pitch for a 24 ft span
PitchAngleRiseRafter
3/1214.0°3 ft 0 in13 ft 4 in
4/1218.4°4 ft 0 in13 ft 8 in
5/1222.6°5 ft 0 in14 ft 0 in
6/1226.6°6 ft 0 in14 ft 6 in
7/1230.3°7 ft 0 in14 ft 12 in
8/1233.7°8 ft 0 in15 ft 7 in
9/1236.9°9 ft 0 in16 ft 2 in
10/1239.8°10 ft 0 in16 ft 10 in
12/1245.0°12 ft 0 in18 ft 4 in

Questions people ask

How do I calculate rafter length?

Take half the span, less half the ridge board, add the level overhang, and multiply by the slope factor √(1 + (pitch ÷ 12)²). At 6/12 the factor is 1.118.

What angle is a 6/12 roof?

26.6°. A 4/12 roof is 18.4°, 8/12 is 33.7° and 12/12 is 45°.

How deep can the birdsmouth be?

With an overhang, deep enough to sit on the wall but leaving at least 3 1/2 in of rafter above the seat cut, with the overhang no more than 24 in. With no overhang, the notch is at the end of the rafter and may be no deeper than 1/4 of its depth, about 1 3/8 in on a 2×6. Either way, give it at least 1 1/2 in of bearing on the wall plate.