Yard & BuildMaterial Calculators List 0

Aisle 6, Roofing & framing

Rafter Length Calculator

On a 24 ft wide building with a 6/12 roof, a 1½ in ridge board and a 12 in overhang, each common rafter is 13 ft 4 3/16 in from the ridge to the wall line plus a 1 ft 1 7/16 in tail: 14 ft 5 9/16 in overall, cut from a 16 ft board. Enter your span, pitch and overhang to get your cut list.

Roof
Outside of one wall’s framing (top plate) to the outside of the other, across the ridge.
Rise in inches per 12 in of level run: 6, 6/12 or 6:12. Not sure? Use the roof pitch calculator.
Measured level, from the outside of the wall to the end of the rafter. 0 for none.
1½ in for a 2× ridge board; 0 if the rafters meet with no ridge board.
Lumber and count
Only used for the bird’s mouth and board length. Size your rafters from the span tables in your code.
Rafter cut list
14′ 5 9/16″per rafter
Ridge to wall line13 ft 4 3/16 in
Overhang (tail)1 ft 1 7/16 in
Board to buy2×8 × 16 ft
Plumb cuts (ridge and tail)26.57° from square
Bird’s mouthseat 3.5 in, heel 1 3/4 in, notch 1 9/16 in deep
Rise to the ridge6 ft
Rafters31 per side, 62 total at 16 in on center

This calculator finds lengths and angles only. Rafter size and spacing come from the span tables in IRC R802.4.1 (they depend on species, grade, spacing and snow load) or from an engineer; check with your building department.

Lengths run along the rafter between the plumb cuts, so they read the same on the top or bottom edge. Rounded to the nearest 1/16 in. The ridge is subtracted level (half its thickness from each run).

rise 6 ftoverhangwall lineridge board13 ft 4 3/16 in
Half of the roof in section: one 2×8 rafter from the eave to the ridge board.

How this was calculated

  1. Run = span ÷ 2 − ridge ÷ 2 = 24 ft ÷ 2 − 1.5 in ÷ 2 = 143.25 in
  2. Slope factor for 6/12 = √(1 + (6 ÷ 12)²) = 1.11803
  3. Ridge to wall line = 143.25 in × 1.11803 = 160.16 in = 13 ft 4 3/16 in
  4. Tail = overhang 12 in × 1.11803 = 13.42 in = 1 ft 1 7/16 in
  5. Total = 173.57 in = 14 ft 5 9/16 in
  6. Board: the two plumb cuts are offset along the board by depth × pitch ÷ 12 = 7.25 × 6 ÷ 12 = 3.63 in; 173.57 + 3.63 + 1 in to square the ends = 178.20 in (the 1 in is our allowance), so the shortest stock that fits is 16 ft
  7. Plumb cut angle = arctan(6 ÷ 12) = 26.57°; the seat cut is level, square to the plumb cut
  8. Bird’s mouth on a 3.5 in plate: heel = 3.5 × 6 ÷ 12 = 1.75 in; notch depth = 3.5 × sin 26.57° = 1.57 in (22% of 7.25 in)
  9. Rise = (span ÷ 2) × 6 ÷ 12 = 72.00 in
  10. Rafters per side = building length 40 ft ÷ 16 in, rounded up, + 1 = 31
Lengths and angles only. This calculator does not size rafters. Rafter size and spacing come from the span tables in IRC R802.4.1, which depend on wood species and grade, spacing, dead load, snow load and whether a ceiling is attached, or from an engineer; check with your building department.[1] Below a 3/12 pitch the IRC requires the ridge, hips and valleys to be designed as beams (R802.4.4). End notches are limited to one quarter of the rafter depth (R802.7.1, which points to R502.8.1); the IRC does not name the bird’s mouth, so ask your building department whether that limit applies to it.[1][2] Never cut, notch or alter a roof truss to fit these numbers (R802.10.4).[1]

“Span” means two different things. Here it is the building width, from the outside of one wall to the outside of the other. The IRC span tables use the clear span measured level, from the inside of the wall to the face of the ridge.[1][3][4] For a 24 ft building with 2×6 walls and a 1½ in ridge (the University of Massachusetts example), that is (288 − 2 × 5.5 − 1.5) ÷ 2 = 137.75 in, or 11 ft 5 3/4 in, not 12 ft; with the 2×4 walls the calculator assumes by default it is (288 − 2 × 3.5 − 1.5) ÷ 2 = 139.75 in (11 ft 7 3/4 in). Use the clear span in the tables.

The parts of a rafter

The formulas

run = span ÷ 2 − ridge thickness ÷ 2
slope factor = √(1 + (pitch ÷ 12)²)
rafter, ridge to wall line = run × slope factor
tail = overhang (level) × slope factor
total = rafter + tail

Both ends are plumb cuts, and two plumb lines are parallel, so the length between them is the same whether you measure along the top edge, the middle or the bottom of the board.[8] The ridge is taken off level, half its thickness from each run. Along the rafter that is a little more than half the thickness: 0.84 in at 6/12 for a 1½ in ridge, rather than 0.75 in.[7] Navy and Swanson tables give the length to the center of the ridge with no overhang, so you add the tail and take off the ridge yourself; the calculator does both.[5][7]

Example: 6/12, 24 ft wide, 1½ in ridge, 12 in overhang

  1. Run: 24 ft ÷ 2 − 1.5 in ÷ 2 = 144 − 0.75 = 143.25 in
  2. Slope factor: √(1 + (6 ÷ 12)²) = 1.11803
  3. Ridge to wall line: 143.25 × 1.11803 = 160.16 in = 13 ft 4 3/16 in
  4. Tail: 12 × 1.11803 = 13.42 in = 1 ft 1 7/16 in
  5. Total: 160.16 + 13.42 = 173.57 in (added before rounding) = 14 ft 5 9/16 in
  6. Board: both ends are plumb cuts, so on the board the cuts are offset by the rafter depth × pitch ÷ 12 = 7.25 × 6 ÷ 12 = 3.63 in. 173.57 + 3.63 + 1 in to square the ends (our allowance) = 178.20 in, which fits a 16 ft board
  7. Plumb cuts: arctan(6 ÷ 12) = 26.57° from square
  8. Rise from the wall line to the center of the ridge: 12 ft × 6 ÷ 12 = 72 in (6 ft)

As a check on the method, a 7/12 roof on a 16 ft span with no ridge board or overhang comes to 111.14 in (9 ft 3 1/8 in); the Navy builder’s manual works the same example to 111⅛ in.[5]

Example: 4/12, 20 ft wide, 18 in overhang, 2×6 rafters on a 2×6 wall

  1. Run: 120 − 0.75 = 119.25 in; slope factor 1.05409
  2. Ridge to wall line: 119.25 × 1.05409 = 125.70 in = 10 ft 5 11/16 in
  3. Tail: 18 × 1.05409 = 18.97 in = 1 ft 7 in
  4. Total: 12 ft 0 11/16 in, from a 14 ft board
  5. Bird’s mouth on a 5½ in plate: heel 5.5 × 4 ÷ 12 = 1.83 in; notch 1.74 in deep, 32% of the 5½ in rafter. That is over the one-quarter limit, so the calculator warns. A narrower seat or a deeper rafter fixes it; ask your building department which they accept.

Board length to buy

Total rafter length with a 12 in overhang and a 1½ in ridge, and the 2×8 board it comes from. Because both ends are plumb cuts, the board has to be longer than the rafter by its depth × pitch ÷ 12 (the offset between the top and bottom corners of the cuts); the calculator adds that and 1 in for squaring the ends (our allowance), then picks the shortest of 8 to 20 ft in 2 ft steps. Check what your lumberyard stocks.

Span4/126/128/1210/1212/12
12 ft7 ft 3 3/4 in
8 ft board
7 ft 9 1/16 in
10 ft board
8 ft 4 1/16 in
10 ft board
9 ft 0 3/8 in
10 ft board
9 ft 9 3/4 in
12 ft board
16 ft9 ft 5 1/16 in
10 ft board
9 ft 11 15/16 in
12 ft board
10 ft 8 7/8 in
12 ft board
11 ft 7 5/8 in
14 ft board
12 ft 7 11/16 in
14 ft board
20 ft11 ft 6 3/8 in
12 ft board
12 ft 2 3/4 in
14 ft board
13 ft 1 3/4 in
14 ft board
14 ft 2 7/8 in
16 ft board
15 ft 5 5/8 in
18 ft board
24 ft13 ft 7 5/8 in
14 ft board
14 ft 5 9/16 in
16 ft board
15 ft 6 9/16 in
18 ft board
16 ft 10 1/16 in
18 ft board
18 ft 3 9/16 in
20 ft board
28 ft15 ft 8 15/16 in
18 ft board
16 ft 8 7/16 in
18 ft board
17 ft 11 7/16 in
20 ft board
19 ft 5 5/16 in
over 20 ft
21 ft 1 1/2 in
over 20 ft
32 ft17 ft 10 1/4 in
20 ft board
18 ft 11 1/4 in
20 ft board
20 ft 4 1/4 in
over 20 ft
22 ft 0 9/16 in
over 20 ft
23 ft 11 7/16 in
over 20 ft

“Over 20 ft” means a longer piece than common lumber. Use engineered lumber or a splice that has been designed, not a field joint.

The bird’s mouth

The seat is level and as wide as the bearing on the wall; the heel is a short plumb cut at the outside of the wall. For a seat of width w at pitch X/12:

heel height = w × X ÷ 12
notch depth (square to the edge) = w × sin(angle)
PitchHeel, 3½ in seatNotch, 3½ in seatHeel, 5½ in seatNotch, 5½ in seat
3/120.88 in0.85 in1.38 in1.33 in
4/121.17 in1.11 in1.83 in1.74 in
5/121.46 in1.35 in2.29 in2.12 in
6/121.75 in1.57 in2.75 in2.46 in
8/122.33 in1.94 in3.67 in3.05 in
10/122.92 in2.24 in4.58 in3.52 in
12/123.50 in2.47 in5.50 in3.89 in

One quarter of the actual depth is 0.88 in for a 2×4, 1.38 in for a 2×6, 1.81 in for a 2×8, 2.31 in for a 2×10, 2.81 in for a 2×12.[2] The IRC has no rule that names the bird’s mouth, so whether the end-notch limit applies to it is your building department’s call. The Navy manual says to leave at least 2 in of wood above the seat cut.[5] The seat must still give the bearing the code asks for: at least 1½ in on wood or metal and 3 in on masonry or concrete (R802.6).[1]

Laying out a rafter

With a Speed Square

  1. Lay the square on the face of the board with its lip (the T bar) over the top edge. Pivot it on the pivot point until the pitch number on the COMMON scale lines up with the same edge, and mark along the square from the pivot point. That is the plumb line at the ridge.[8]
  2. Swanson’s instructions then move that line toward the tail by half the ridge thickness, because the table length runs to the center of the ridge.[8] The calculator’s “ridge to wall line” length already has the ridge taken off, so with it you skip this step. Don’t deduct the ridge twice.
  3. Measure the ridge-to-wall-line length along the top edge and mark a second plumb line the same way.[8] This is the heel of the bird’s mouth, at the outside of the wall.
  4. Measure the heel height up this line from the bottom edge and draw the seat line square to it. It runs level to the bottom edge, and its length equals the seat width.
  5. From the heel line, measure the tail length along the top edge toward the low end and mark the tail plumb cut the same way as the ridge cut.[8] The Army carpentry manual notes the tail is often cut square across instead.[6]
  6. Cut one rafter, test it on the building at both ends, then use it as the pattern for the rest.[8]

With a framing square

Hold the square with the rise (for example 6) on the tongue, the narrow arm, and 12 on the blade, both on the same edge of the board. A line along the tongue is a plumb cut and a line along the blade is a level seat cut.[5] Many framing squares also have a rafter table stamped on them: under the number 6 it reads 13.42, the inches of rafter per foot of run.[5][9] Multiplying 13.42 by the run in feet gives the length to the ridge center. The exact figure is 13.416, so over a 12 ft run the rounded one comes out 0.04 in long (161.04 in instead of 161.00 in); the calculator works with the full figure.[10]

If you cut with the board lying flat on a miter saw, the plumb cut is a miter of 26.57° at 6/12 (the pitch angle; 18.43° at 4/12, 33.69° at 8/12).

How many rafters

rafters per side = building length ÷ spacing, rounded up, + 1
total = rafters per side × 2

A 40 ft building at 16 in on center: 480 ÷ 16 = 30 spaces, + 1 = 31 per side, 62 for the roof. The count does not include rafters for a gable overhang (rake), doubled rafters beside skylights or chimneys, or anything else your plans add. The spacing comes from the span table, not from this count.

Before you cut

Questions people ask

How do you calculate rafter length?

Take half the building width, subtract half the ridge thickness, and multiply by √(1 + (pitch ÷ 12)²). Add the overhang times the same factor for the tail. At 6/12 on a 24 ft building with a 1½ in ridge and 12 in overhang that is 13 ft 4 3/16 in + 1 ft 1 7/16 in = 14 ft 5 9/16 in.

How long is a rafter for a 24 ft span at 6/12?

To the center of the ridge it is 144 in × 1.11803 = 161.00 in (13 ft 5 in). With a 1½ in ridge board it is 13 ft 4 3/16 in, and a 12 in overhang adds 1 ft 1 7/16 in.

Do you measure rafter length on the top or bottom edge?

Either, as long as both ends are plumb cuts: parallel plumb lines are the same distance apart along any edge. What matters is where the run starts, which here is the outside of the wall.

How much do you deduct for a ridge board?

Half its thickness from each run, measured level: 3/4 in for a 1½ in ridge. Along the rafter that becomes 0.75 × the slope factor, 0.84 in at 6/12.

How many rafters do I need?

Divide the building length by the spacing, round up, add 1, and double it for two sides. A 40 ft building at 16 in on center needs 31 per side, 62 in all, before any extras on your plans.

What size rafter do I need?

This calculator does not size rafters. Use the rafter span tables in IRC R802.4.1 for your wood species, grade, spacing and snow load, with the clear span measured level, or ask an engineer or your building department.

Related calculators

Sources

  1. International Code Council, 2021 IRC Chapter 8 Roof-Ceiling Construction (R802). R802.3 ridge, R802.4.1 rafter span tables, R802.4.4 pitch below 3:12, R802.6 bearing, R802.7.1 notching, R802.10.4 trusses, R802.11 uplift. Checked 2026-10-05.
  2. International Code Council, 2021 IRC Chapter 5 Floors (R502.8.1). Notches at the ends of a member not over one-fourth of its depth. Checked 2026-10-05.
  3. American Wood Council, Span Tables for Joists and Rafters, 2021 Edition. Sloping rafter spans are measured along the horizontal projection. Checked 2026-10-05.
  4. University of Massachusetts Amherst, Building and Construction Technology, Understanding Loads and Using Span Tables (2003). Rafter span for span tables is the horizontal clear distance; 24 ft gable, 2×6 walls, 1½ in ridge = 11 ft 5¾ in. Checked 2026-10-05.
  5. U.S. Navy (Naval Education and Training), Builder training manual, Chapter 2 Roof Framing (copy hosted by InspectAPedia). Span, run, rise, line length, bridge measure, ridge shortening, projection and tail, bird’s mouth; 7 in 12 on a 16 ft span = 111 1/8 in; hip unit run 16.97 in. Checked 2026-10-05.
  6. Headquarters, Department of the Army, FM 5-426 Carpentry (1995), Chapter 7 Roof Systems (copy on archive.org). Glossary: pitch = rise divided by span; plumb cut, seat cut, bird’s mouth. Checked 2026-10-05.
  7. Swanson Tool Co., Blue Book: Roof Pitch Reference (master rafter length table). Rafter and hip lengths per foot of run for 1 to 30 in rise; 1/4 pitch = 6 in rise; measuring pitch with a level at 12 in; deduct ridge thickness from building width. Checked 2026-10-05.
  8. Swanson Tool Co., Blue Book: Cutting a Common Rafter. Pivot the Speed Square to the rise number on the COMMON scale to mark plumb cuts; move the ridge plumb line toward the tail by half the ridge thickness; measure along the top edge; use the first rafter as a pattern. Checked 2026-10-05.
  9. Journal of Light Construction, Framing Square Basics: Rafter Layout (2022). 6 in 12: 13.42 per foot of run; hip or valley triangle 6-16.97-18. Checked 2026-10-05.
  10. Swanson Tool Co., 6/12 Roof Pitch: rafter reference. 6/12 = 26.57°, 50%, 13.416 in per 12 in of run, multiplier 1.118. Checked 2026-10-05.