Rafter Length Calculator

Enter your building span and roof pitch and this rafter length calculator works out the run, rise and length of each rafter, including the tail for the overhang. It also tells you which lumber length to buy and the plumb and seat cut angles.

Jump to:Rafter partsThe formulaLength chartBirdsmouthPro notesFAQ

/ 12

Span is outside of wall to outside of wall. Use 0 for the ridge if your rafters meet at a truss-style peak or a ridge beam you measure to.

Rafter length

—

Run (one side)
Rise
Line length (plate to ridge)
Tail (overhang)
Board to buy
Plumb cut angle
Seat cut angle

Birdsmouth and heights

Seat cut (level)
Heel cut (plumb)
Notch depth into rafter
Height above plate (HAP)
Plumb cut height (ridge & tail)
Ridge height above wall
Hip / valley rafter (hip roof)

Quick answer: rafter length = run × √(1 + (pitch ÷ 12)²). The run is half the building span minus half the ridge board. Add the overhang the same way, then round up to the next standard lumber length.

The parts of a rafter

A common rafter runs from the top of the wall up to the ridge, at a right angle to both. Before you can cut one, you need to know a few terms framers use:

  • Span: the full width of the building, outside of wall to outside of wall.
  • Run: the level distance one rafter covers, from the outside of the wall to the face of the ridge board. Roughly half the span.
  • Rise: how far the rafter climbs over that run.
  • Line length: the length along the rafter from the wall plate to the ridge.
  • Tail: the part past the wall that forms the eave overhang.
Span (outside of wall to outside of wall)RunRafterTail / overhangRidge board
Span, run, rafter, tail and ridge board on a gable roof.

What to measure

  1. Span. Hook a tape on the outside edge of one top plate and read it at the outside edge of the opposite one. Measure at both ends of the building; if the walls are out of parallel, frame to the average and shim.
  2. Pitch. Take it from the plans, or find it with our roof pitch calculator if you are matching an existing roof.
  3. Overhang. Decide how far the eave should stick out, measured level from the wall. 12 in is common; 16 to 24 in gives walls and windows more shade and rain protection.
  4. Ridge board. A 2× ridge is 1½ in thick. A doubled or engineered ridge beam can be 3 in or more.

How to calculate rafter length

A rafter is the long side of a right triangle, so the length comes straight from Pythagoras. The slope factor turns any level distance into a length along the slope:

Run = span ÷ 2 − ridge ÷ 2 · Rafter = run × √(1 + (pitch ÷ 12)²)

A garage is 24 ft wide, the roof is 6/12, the ridge board is 1½ in and you want a 12 in overhang.

Run = 12 ft − ¾ in = 11 ft 11¼ in (11.94 ft). Slope factor for 6/12 = 1.118.

Line length = 11.94 × 1.118 = 13.35 ft (13 ft 4⅛ in). Tail = 1 × 1.118 = 1.12 ft.

Total = 14.47 ft, so you buy 16 ft boards and have room for a square tail cut.

The calculator also shows the rise (here 5.97 ft), which is the height from the top of the wall plate to where the top of the rafter meets the ridge along the measuring line. That is the number you need for an attic-headroom check.

Rafter length per foot of run

Framing squares print this table on the blade. Multiply the number for your pitch by the run in feet to get the line length.

PitchLength per ft of runInches per ftAngle
3/121.031 ft12.37 in14.04°
4/121.054 ft12.65 in18.43°
5/121.083 ft13.00 in22.62°
6/121.118 ft13.42 in26.57°
7/121.158 ft13.89 in30.26°
8/121.202 ft14.42 in33.69°
9/121.250 ft15.00 in36.87°
10/121.302 ft15.62 in39.81°
12/121.414 ft16.97 in45.00°

Rafter length chart by span and pitch

A quick look-up of common rafter line lengths, from the wall plate to the center of the ridge, for spans from 12 to 40 ft. These figures leave out the overhang and the ridge deduction, so use them to plan lumber, and use the calculator for cutting.

Span4/126/128/1210/1212/12
12 ft6′ 3⅞″6′ 8½″7′ 2½″7′ 9¾″8′ 5⅞″
16 ft8′ 5¼″8′ 11⅜″9′ 7⅜″10′ 5″11′ 3¾″
20 ft10′ 6½″11′ 2⅛″12′ 0¼″13′ 0¼″14′ 1¾″
24 ft12′ 7¾″13′ 5″14′ 5⅛″15′ 7½″16′ 11⅝″
28 ft14′ 9⅛″15′ 7⅞″16′ 9⅞″18′ 2⅝″19′ 9⅝″
32 ft16′ 10⅜″17′ 10⅝″19′ 2¾″20′ 9⅞″22′ 7½″
36 ft18′ 11⅝″20′ 1½″21′ 7⅝″23′ 5⅛″25′ 5½″
40 ft21′ 1″22′ 4⅜″24′ 0½″26′ 0⅜″28′ 3⅜″

Worked example: birdsmouth, HAP and ridge height

The calculator also lays out the birdsmouth and tells you how high the roof will finish. Using the 24 ft garage from above (6/12 pitch, 2×8 rafters on a 2×4 wall):

  1. Plumb cut height = rafter depth ÷ cos(angle) = 7.25 ÷ 0.894 = 8.11 in. That is the height of the cut at the ridge and at the tail.
  2. Seat cut = the wall width, 3½ in. Heel cut = 3.5 × 6 ÷ 12 = 1¾ in.
  3. Notch depth into the rafter = 3.5 × sin(26.57°) = 1⅝ in, well under a third of 7¼ in (2⅜ in), so the rafter keeps its strength.
  4. Height above plate (HAP) = 8.11 − 1.75 = 6⅜ in.
  5. Ridge height above the top of the wall = rise + HAP = 5 ft 11⅝ in + 6⅜ in ≈ 6 ft 6 in to the top of the rafters at the ridge.

On a hip roof with the same 6/12 pitch, the hip rafter covers the same common run at 45° in plan, so its line length is run × hip factor = 11.94 × 1.5 = 17.91 ft (17 ft 10⅞ in), before its own ridge deduction and tail.

Plumb cut, seat cut and birdsmouth

Every common rafter has a plumb cut at the top where it meets the ridge, and a birdsmouth notch where it sits on the wall. The birdsmouth is two cuts: a level seat cut that bears on the top plate, and a plumb heel cut that sits against the outside of the wall.

Wall top plateHeel (plumb) cutSeat (level) cutPlumb cut at the ridge uses the same angle
The seat cut bears on the plate; the heel cut is parallel to the ridge plumb cut.

With a speed square, pivot it on the edge of the rafter until the “common” scale reads your pitch number, and draw along the edge: that is the plumb line. Mark the seat square to it. The calculator gives the angles in degrees too, for setting a circular saw or miter saw. As a rule of thumb, don’t cut the seat deeper than about a third of the rafter depth, so enough wood is left above the notch to carry the tail.

Choosing lumber length, size and spacing

Dimensional lumber comes in 2 ft steps, from 8 to 24 ft at most yards. Always buy the next size up from your total length; you need a few inches to square the ends and remove checks. If your rafter is longer than 20 ft, check availability first, since 22 and 24 ft boards cost more per foot.

Rafter size (2×6, 2×8, 2×10…) depends on the span, the spacing, the wood species and grade, and your snow and dead loads. Look it up in the rafter span tables of the International Residential Code (Tables R802.4.1) or ask your lumber yard. Rafters are usually set at 16 or 24 in on center; enter your building length to count them.

Heading on to sheathing and shingles? The roof pitch calculator converts your footprint into roof squares, and if you would rather buy factory trusses, our roof truss calculator counts them for you.

Worked example: a 12 × 16 ft shed

You are building a 12 ft wide by 16 ft long gable shed with a 4/12 pitch, an 8 in overhang and a 2×6 ridge board (1½ in thick). Rafters go 24 in on center.

  1. Run = 6 ft − ¾ in = 5 ft 11¼ in, or 5.94 ft.
  2. Slope factor for 4/12 = 1.054, so the line length is 5.94 × 1.054 = 6.26 ft (6 ft 3⅛ in).
  3. Tail = 8 in × 1.054 = 8.4 in. Total = 6.96 ft, so 8 ft boards work with plenty to spare.
  4. 16 ft × 12 ÷ 24 = 8 spaces, + 1 = 9 rafters per side, 18 rafters in total.
  5. Rise = 5.94 × 4 ÷ 12 = 1.98 ft: the ridge sits about 2 ft above the wall plates.

Enter those numbers in the calculator above and use the share buttons to send yourself the cut list for the lumber yard.

Hip, valley and jack rafters

This calculator handles common rafters on a gable roof. A hip roof adds three more kinds. Hip rafters run diagonally from the corners up to the ridge; on a roof with the same pitch on all sides, a hip covers 1.414 times the run of a common rafter, so it is longer and shallower. Valley rafters do the same where two roofs meet in an inside corner. Jack rafters are the shortened commons that land on a hip or valley, each one shorter than the last by the same step.

To size a hip, multiply the common run by the hip/valley factor shown on our roof pitch calculator (1.5 for a 6/12 roof). Hip and valley rafters also get a double-bevel “cheek” cut at the top and usually need to be one size deeper than the commons, so the jacks have full bearing.

Common rafter mistakes

  • Measuring span from the inside of the walls. That makes every rafter several inches short. Span is always outside to outside of the top plates.
  • Forgetting the ridge deduction. Skipping it raises the peak by the slope factor × half the ridge, enough to throw off a long roof.
  • Laying out on the top edge. Lengths are measured along the measuring line through the birdsmouth, not along the top of the board.
  • Over-cutting the birdsmouth. A deep seat cut weakens the tail. Keep at least two thirds of the depth above the notch.
  • No ceiling ties. Without ties or a structural ridge, rafters push the walls outward. Tie them in per code.

Notes for framers and estimators

Measuring line. These lengths are along the measuring line, which runs from the outside top corner of the wall plate (where the heel cut meets the seat cut) to the ridge. Lay out from that point, not from the top edge of the board.

Ridge deduction. Deduct half the ridge thickness measured level, then convert: shorten the line length by (ridge ÷ 2) × slope factor. The calculator does it in the run, which comes to the same number.

Raised heel / HAP. Height above plate doesn’t change the line length, but it changes where the roof surface sits. Account for it when you check headroom or match an existing roof plane.

Code. Size rafters and ceiling joists from IRC R802 tables for your load, species and grade, and tie them per R802.5 to resist outward thrust. When in doubt, have an engineer stamp it.

Tips

  • Cut one pattern rafter, test it at both ends of the building, then use it to mark the rest.
  • Crown up. Sight down each board and install it with the bow facing the sky.
  • Leave tails long and snap a line to cut them all at once after the rafters are up.
  • Share the cut list with your helper or the yard using the buttons under the result.

Frequently asked questions

How do I calculate rafter length?

Find the run (half the building span, minus half the ridge board thickness), multiply it by the slope factor for your pitch, then add the overhang length the same way. For a 24 ft span at 6/12 with a 1½ in ridge board, the run is 11.94 ft and the rafter is 13.35 ft to the plumb cut, before the tail.

What length rafter do I need for a 24 ft wide building?

At a 6/12 pitch with a 1 ft overhang and a 1½ in ridge board, each rafter is about 14.5 ft along the slope, so you would buy 16 ft boards. Steeper pitches need longer boards; use the calculator for your exact pitch.

Do I measure span from the outside of the walls?

Yes. Span is measured from the outside of one wall top plate to the outside of the other. The run of each rafter is half of that, minus half the ridge board.

Why subtract half the ridge board?

Rafters butt against the face of the ridge board, not its center line. Taking half the ridge thickness off each run keeps the peak at the right height. With a 1½ in ridge, that is ¾ in per side.

What is the plumb cut angle?

The plumb cut (at the ridge and the heel of the birdsmouth) is the roof angle measured from a square cut. On a 6/12 roof it is 26.57°. The seat cut is 90° minus that, 63.43°, measured the same way. Most framers just set a speed square to the pitch number.

How long should the rafter overhang be?

Common eave overhangs are 12 to 24 inches measured level. The calculator converts the level overhang into the length along the rafter tail, which is longer on steeper roofs.

How deep should a birdsmouth cut be?

A common rule is that the notch should not cut more than about one third into the depth of the rafter, and the seat should bear fully on the wall plate. The calculator shows the notch depth and warns you when it goes past a third.

What is HAP on a rafter?

HAP (height above plate) is the vertical distance from the top of the wall plate, at the outside of the wall, to the top edge of the rafter. It sets the final roof height and must be the same on every rafter so the roof plane stays flat.

How long is a hip rafter?

For a hip roof where all sides have the same pitch, multiply the common rafter run by the hip factor. At 6/12 the factor is 1.5, so a common run of 12 ft gives a hip line length of 18 ft before deductions and the tail.

Can I use this for a shed roof?

Yes. For a single-slope shed roof, enter twice the run you need as the span and set the ridge board to 0, or simply treat the span as the horizontal distance between the two supporting walls multiplied by two.

All Roofing & Siding calculators →

Built and checked by the CalcWall team · Last updated ·How we calculate · Results are estimates; confirm quantities with your supplier.