“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
- Span: the building width, outside of wall plate to outside of wall plate.[5]
- Run: half the span, the level distance from the outside of the wall to the center of the ridge.[5][6]
- Rise: how far the roof climbs over the run. Pitch is the rise per 12 in of run (6/12 = 6 in per foot).[7]
- Ridge deduction: a ridge board takes up space at the peak, so each rafter stops at the ridge’s face, half the ridge thickness short of the center.[5][7]
- Overhang (projection) and tail: the overhang is the level distance from the outside of the wall to the end of the rafter. The tail is the length of rafter that covers it.[5]
- Plumb cut: the vertical cut at the top that sits against the ridge. The tail end is often cut plumb too, or square across.[5][6]
- Seat cut and bird’s mouth: the level seat cut rests on the wall plate; together with a short plumb cut (the heel) it forms the notch called the bird’s mouth.[5][6]
The formulas
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
- Run: 24 ft ÷ 2 − 1.5 in ÷ 2 = 144 − 0.75 = 143.25 in
- Slope factor: √(1 + (6 ÷ 12)²) = 1.11803
- Ridge to wall line: 143.25 × 1.11803 = 160.16 in = 13 ft 4 3/16 in
- Tail: 12 × 1.11803 = 13.42 in = 1 ft 1 7/16 in
- Total: 160.16 + 13.42 = 173.57 in (added before rounding) = 14 ft 5 9/16 in
- 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
- Plumb cuts: arctan(6 ÷ 12) = 26.57° from square
- 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
- Run: 120 − 0.75 = 119.25 in; slope factor 1.05409
- Ridge to wall line: 119.25 × 1.05409 = 125.70 in = 10 ft 5 11/16 in
- Tail: 18 × 1.05409 = 18.97 in = 1 ft 7 in
- Total: 12 ft 0 11/16 in, from a 14 ft board
- 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.
| Span | 4/12 | 6/12 | 8/12 | 10/12 | 12/12 |
|---|---|---|---|---|---|
| 12 ft | 7 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 ft | 9 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 ft | 11 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 ft | 13 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 ft | 15 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 ft | 17 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:
notch depth (square to the edge) = w × sin(angle)
| Pitch | Heel, 3½ in seat | Notch, 3½ in seat | Heel, 5½ in seat | Notch, 5½ in seat |
|---|---|---|---|---|
| 3/12 | 0.88 in | 0.85 in | 1.38 in | 1.33 in |
| 4/12 | 1.17 in | 1.11 in | 1.83 in | 1.74 in |
| 5/12 | 1.46 in | 1.35 in | 2.29 in | 2.12 in |
| 6/12 | 1.75 in | 1.57 in | 2.75 in | 2.46 in |
| 8/12 | 2.33 in | 1.94 in | 3.67 in | 3.05 in |
| 10/12 | 2.92 in | 2.24 in | 4.58 in | 3.52 in |
| 12/12 | 3.50 in | 2.47 in | 5.50 in | 3.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
- 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]
- 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.
- 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.
- 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.
- 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]
- 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
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
- A ridge board must be at least 1 in nominal thick and no shallower than the cut end of the rafter. A 2×8 rafter at 6/12 has a plumb cut 8.1 in tall, more than the 7.25 in of a 2×8, so it needs a 2×10 ridge board. Without ceiling joists or rafter ties to hold the walls together, the ridge must be supported by a wall or a ridge beam (R802.3).[1]
- Collar ties near the top of the attic do not replace rafter ties or ceiling joists near the bottom (R802.4.6); ceiling joists or rafter ties set above the lower third of the attic take the roof outside the simple tables (the ridge designed as a beam, or engineered connections; R802.5.2 and its tables), and even within the lower third, the higher they sit, the shorter the allowed rafter span (the adjustment factors in Table R802.4.1(9)).[1]
- Rafters must be attached to the wall with connections that resist wind uplift (R802.11); plain nailing is allowed only in limited cases.[1]
- Rafters on opposite sides of the ridge should line up; the IRC allows them to be offset by no more than 1½ in (R802.4.2).[1]
- An overhang notched where it sits on the wall needs at least 3½ in of rafter left above the notch, and the overhang can be no more than 24 in (R802.7.1.1). Hip and valley rafters must be at least 2 in nominal thick (R802.4.3).[1]
- Hip and valley rafters are longer per foot of run than common rafters; the roof pitch calculator gives both.
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
- 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.
- 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.
- American Wood Council, Span Tables for Joists and Rafters, 2021 Edition. Sloping rafter spans are measured along the horizontal projection. Checked 2026-10-05.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.