Rafter Length Calculator

Enter the building span and the pitch and this returns the common rafter length with the ridge board deducted and the overhang added, plus the plumb and seat cut angles, the largest birdsmouth the rafter depth allows, and how many rafters the roof takes.

Outside face of wall to outside face
6 = 6/12. Decimal pitches work: 5.5 = 5½/12
1.5 for a 2×, 0.75 for a 1×, 1.75 for LVL
Past the outside of the wall, measured level
12, 16 or 24 — set by the span tables
Along the ridge, for the rafter count
Actual depth: 2×6 = 5.5″, 2×8 = 7.25″, 2×10 = 9.25″
Rafter length, wall to ridge13 ft 4.1 in
Length including overhang14 ft 5.6 in
Order stock at16 ft
Horizontal run to ridge face11.938 ft
Ridge rise above the wall5 ft 11.6 in
Roof angle26.57° · factor 1.118
Plumb cut / seat cut63.4° / 26.6°
Max birdsmouth notch2.313″ deep × 4.63″ wide
Rafters, gable roof25 per side · 50 total

Lengths run along the top edge, from the plumb cut at the ridge board to the tail. Both plumb cuts are square to that edge, so the stock length is the rafter length — the cuts come out of the width of the board, not the length.

How the rafter length is calculated

A common rafter is the hypotenuse of a right triangle. The horizontal leg is the run — half the building span, less half the ridge board. The vertical leg is the rise, which is the run times the pitch divided by 12. The rafter length is the line that closes the triangle.

The formula, both ways
rise = run × pitch ÷ 12
rafter = √(run² + rise²) = run × √(1 + (pitch ÷ 12)²)
with overhang: (run + overhang) × √(1 + (pitch ÷ 12)²)

The second form is the one carpenters use, because the square root depends only on the pitch. That number — the slope factor, or roof multiplier — is the rafter length per foot of run, and it is why a rafter can be priced before anyone measures anything: at 4/12 every foot of run needs 1.05409 ft of rafter, at 6/12 1.11803 ft, at 12/12 1.41421 ft.

Check the 6/12 factor by hand. A 6/12 pitch is 6″ of rise in 12″ of run, so the triangle is 6 – 12 – ? and the hypotenuse is √(36 + 144) = √180 = 13.4164″ for 12″ of run — that is 1.11803 ft per foot. Nothing about the building is in that step; the angle is the only input.

Worked example: 24 ft span, 6/12 pitch, 12″ overhang

A 24 ft wide house with a 2× ridge (1½″ actual) and a 12″ overhang. Every number below is checkable on a calculator.

Note what the 13 ft 4.2 in figure is not. It is not the length of a board measured on the ground — it is the distance along the top edge from the plumb cut at the ridge to the plumb cut at the wall plate, and the plumb cuts are square to that line. Cut them and the board still measures 13 ft 4.2 in; the cuts eat the width of the stock, not the length.

Rafter length for a 24 ft span, by pitch

Same building each time: 24 ft span, 1½″ ridge, 12″ horizontal overhang. The run is 11.9375 ft on every row, so the only thing changing is the angle.

PitchAngleSlope factorRafter to ridgeWith 12″ overhangRidge rise
2/129.46°1.013812 ft 1.3 in13 ft 1.4 in1 ft 11.9 in
3/1214.04°1.030812 ft 3.6 in13 ft 4.0 in2 ft 11.9 in
4/1218.43°1.054112 ft 7.0 in13 ft 7.6 in3 ft 11.8 in
5/1222.62°1.083312 ft 11.3 in14 ft 0.3 in4 ft 11.8 in
6/1226.57°1.118013 ft 4.1 in14 ft 5.6 in5 ft 11.6 in
7/1230.26°1.157713 ft 9.9 in14 ft 11.8 in6 ft 11.6 in
8/1233.69°1.201914 ft 4.1 in15 ft 6.6 in7 ft 11.5 in
9/1236.87°1.250014 ft 11.1 in16 ft 2.1 in8 ft 11.5 in
10/1239.81°1.301715 ft 6.5 in16 ft 10.1 in9 ft 11.4 in
12/1245.00°1.414216 ft 10.6 in18 ft 3.5 in11 ft 11.3 in

Read the 4/12 row as the check: 11.9375 × 1.05409 = 12.5832 ft, which is 12 ft 7.0 in almost exactly — a good row to sanity-check a tape against. The 12/12 row is the 45° case, where the factor is √2 and the rise equals the run, 11 ft 11¼ in. No row changes by more than about 1 ft per step of pitch, which is why a gable’s rafter length is sensitive to the pitch you actually built rather than the one on the plan.

The ridge board is not zero thickness

Nearly every hand calculation starts with half the span and stops there. That is the run to the centre of the ridge, and the rafter dies against its face. The difference is half the ridge thickness — ¾″ for a 1½″ ridge, ⅜″ for a 1× ridge, ⅞″ for 1¾″ LVL.

It looks like a rounding error until you see what it does at the top. On the 24 ft / 6/12 example, skipping the deduction makes each rafter 13 ft 5.0 in instead of 13 ft 4.2 in — 0.84″ long. Both rafters are long by that much, so the pair closes 1.7″ beyond where the 1½″ ridge sits: the plumb cuts ride past each other and the ridge has to be pushed up, or the heels lift off the plate. Deduct half the ridge thickness from the run on the first line of the calculation and the problem never happens.

The other half of this convention is where the run starts. It starts at the outside face of the wall, because that is where the plumb cut at the tail of the wall bearing sits in plan. If you measured to the inside face instead, you would add the wall thickness to every rafter — 5½″ on a 2×6 wall, more than the ridge deduction by a factor of seven.

Overhang is measured level, not along the roof

Plans call out an overhang as a horizontal distance: “12 inch overhang” means the roof edge sits 12″ out from the wall in plan, the way you would see it on a drawing. To get the length of rafter that produces, multiply by the slope factor like any other horizontal distance.

At 6/12, 12″ of projection is 13.42″ of rafter. At 12/12 it is 16.97″. Reverse the mistake — cut 12″ along the slope — and the overhang becomes 12 ÷ 1.11803 = 10.73″: the fascia line runs 1¼″ inside the rest of the roof, which is exactly the kind of error a gutter installer finds for you.

Measure the overhang to the outside of the sub-fascia if you are cutting the tail to the fascia plane, or to the plumb cut line if the gutter hangs on the tail. Either way it is one horizontal number, and it goes inside the bracket with the run.

Cut angles: plumb and seat

The top edge of the rafter rises at the roof angle θ, where tan θ = pitch ÷ 12. The plumb cut at the ridge is a vertical plane, so the angle it makes with the top edge is the complement, 90° − θ. The seat cut at the birdsmouth is horizontal, so it makes the angle θ with that same edge.

Set a bevel gauge or a miter saw to those numbers and there is nothing to remember. The pitch number on a speed square is the same relationship expressed on a scale — it is doing the arctangent for you — but the degrees are what you need for a miter saw or a protractor.

How deep can the birdsmouth be?

IRC 2021 R802.7.1 applies the sawn-lumber notch limits of R502.8.1 to rafters, and R502.8.1 says “Notches at the ends of the member shall not exceed one-fourth the depth of the member.” A birdsmouth is a notch at the end: the limit is a quarter of the actual depth.

Those depths translate into seat widths, because the seat cut is the horizontal side of the notch: width = depth × 12 ÷ pitch. At 6/12 a full-depth notch on a 2×10 gives a 4⅝″ seat — wide enough that on a 3½″ 2×4 plate the rafter would bear on the outer edge only, which is not bearing at all. Either use a 2×6 plate (5½″), or notch only as deep as the plate is wide: a 3½″ seat at 6/12 needs just 1¾″ of notch. Both numbers are inside the quarter-depth limit, so the plate width, not the code, is what sets the cut.

What this calculator does not do: size the rafter

Length and depth are separate questions. IRC 2021 R802.4.1 sends rafter size to Tables R802.4.1(1) through (8): maximum span by species group, grade, nominal size and spacing. Table R802.4.1(1) covers a 20 psf roof live load with a 10 psf or 20 psf dead load and L/Δ = 180 for the no-ceiling case; tables (3) through (8) carry ground snow loads of 30 to 70 psf, interpolating between them for other snow loads.

One sentence in R802.4.1 is worth carrying to the lumber yard: “Rafter spans shall be measured along the horizontal projection of the rafter.” The span the tables expect is the run — the number this calculator prints in the second result row — not the 13 ft 4 in length you just cut. Measuring the sloped length and calling it a span overstates the capacity of every rafter on the roof, and the error grows with the pitch.

Bearing is the other prescriptive item, and R802.6 is short: at least 1½″ of bearing on wood or metal, 3″ on masonry or concrete, with the rafter or a rafter tie attached to provide the continuous tension tie. A birdsmouth that leaves less than 1½″ of seat is the usual way a perfectly sized rafter fails inspection.

For the pitch conversions behind these numbers — degrees, slope percentage, the hip and valley factor, and the roof area the pitch adds to the plan — the roof pitch chart has the full table. For what the roof weighs as dead load, the material weight chart lists shingles, sheathing and framing per square foot. And when the rafter count turns into an order, the board foot calculator converts the stock list into board feet at whatever width you buy.

Common mistakes

Rafter length FAQ

How do you calculate the length of a rafter?

Take the horizontal run from the outside of the wall to the near face of the ridge, then multiply by the slope factor for the pitch: √(1 + (pitch ÷ 12)²). At 6/12 the factor is 1.11803, so an 11.9375 ft run gives a 13.35 ft rafter. The same answer comes from √(run² + rise²).

Do you subtract the ridge board thickness from the rafter length?

Yes — deduct half the ridge thickness from the run before multiplying by the slope factor. On a 24 ft span with a 1½″ ridge the run is 11.9375 ft, not 12 ft, and the rafter is 13 ft 4.2 in instead of 13 ft 5 in. Ignore it and the two rafters meet 1½″ too far apart to close on the ridge.

Is the overhang measured horizontally or along the rafter?

Roof overhangs are quoted as horizontal projection — how far the roof extends past the wall in plan. That number is then multiplied by the slope factor to get the length along the rafter: 12″ of horizontal overhang at 6/12 is 13.4″ of rafter. Cutting 12″ along the slope only projects 10.7″.

What angle do you cut rafters at?

The pitch angle θ = arctan(pitch ÷ 12) is the seat cut; the plumb cut is 90° − θ. At 6/12, θ is 26.6°, so the plumb cut is 63.4° and the seat cut is 26.6°. At 4/12 they are 71.6° and 18.4°; at 12/12 both are 45°.

How many rafters do I need for a 24 ft roof?

At 16″ on center, 24 ft of roof takes 19 rafters per side, 38 for a gable: (24 × 12) ÷ 16 = 18 spaces, plus one for the starting rafter. At 24″ on center it is 13 per side, at 12″ it is 25 per side. The spacing itself comes from the rafter span tables, not from this count.

How deep can a birdsmouth notch be?

IRC R802.7.1 applies the sawn-lumber notch limits of R502.8.1 to rafters, and that section caps notches at the ends of a member at one-quarter of its depth. A 2×10 (9.25″ actual) may be notched 2 5/16″; a 2×6 (5.5″) 1 3/8″. The seat cut also has to fit the top plate — a deeper notch makes a wider seat, and a seat wider than the plate leaves the rafter bearing on an edge.

Does this calculator tell me what size rafter I need?

No. Rafter size comes from IRC Table R802.4.1(1) through (8), which give maximum spans by species, grade, size and spacing for 20 psf roof live load or for ground snow loads of 30 to 70 psf. R802.4.1 also says rafter spans are measured along the horizontal projection of the rafter — the run this calculator reports, not the sloped length.

Where to go next

The roof pitch chart converts the pitch into degrees, slope percentage and roof area, and the board foot calculator turns the stock list into board feet. If the rafters land on a deck rather than a house, the deck beam and joist span calculator covers that framing, and the material weight chart gives the dead loads the span tables assume.