Calculator

Rafter Length Calculator

Enter the building span, roof pitch, ridge board and overhang. You get the rafter length to the wall, the length with the overhang, the board length to buy, both cut angles, the hip rafter length and how many rafters a gable needs. Every formula is shown.

Formulas shown Feet and inches to 1/8 No signup

Your roof

ft

Outside of wall to outside of wall.

/12

Rise in inches per 12 inches of run.

in

Thickness. 1.5 for a 2x board, 0 for none.

in

Measured level, out from the wall.

Used for the board length only.

For the rafter count.

ft

Along the ridge. Optional.

Common pitches

run rise rafter tail
Rafter, ridge to wall
13′ 4-1/8″

143.25 × 1.1180 = 160.16 in

With overhang
14′ 5-5/8″

160.16 + 12 × 1.1180 = 173.57 in

Board to buy
16 ft

173.57 + 7.25 × 6 ÷ 12 = 177.20 in

Plumb cut angle
26.57°

atan(6 ÷ 12)

Lengths are measured along the rafter, to the nearest 1/8 inch. Need your pitch first? Measure it with the roof pitch calculator.

Your cut listResultWorking
Pitch multiplier1.1180√(pitch² + 144) ÷ 12
Rafter run11′ 11-1/4″144 − 1.5 ÷ 2 = 143.25 in
Rise over that run5′ 11-5/8″143.25 × 6 ÷ 12 = 71.62 in
Overhang (tail) length1′ 1-3/8″12 × 1.1180 = 13.42 in
Seat (birdsmouth) cut angle63.43°90° − plumb cut angle
Hip or valley rafter, theoretical18′ 0″144 × √(2 + (6 ÷ 12)²) = 216.00 in
Common rafters, gable roof62 (31 per side)(40 ft × 12 ÷ 16 in, rounded up, + 1) × 2 sides

How the rafter length calculator works

A common rafter is the sloped side of a right triangle whose other two sides are the run and the rise. Once you know the run and the pitch, the length follows from the Pythagorean theorem.

  • Span is the width of the building from the outside of one wall to the outside of the other. On a simple gable, each rafter covers half of it.
  • Pitch is the rise in inches for every 12 inches of run, written 6/12 or 6:12. The roof pitch calculator converts a measured rise and run, or an angle, into this form.
  • Ridge board is the board the rafters meet at the top. Its thickness matters because each rafter stops at the face of the board, not at its center.
  • Overhang is how far the roof projects past the wall, measured level. It is added to the rafter as a tail.

The calculation runs in three steps:

run = span ÷ 2 − ridge thickness ÷ 2
multiplier = √(pitch² + 144) ÷ 12
rafter length = run × multiplier

The multiplier is the length of sloped rafter for every inch of level run, the same factor that turns a roof’s footprint into its surface area. The tail length is the level overhang times the same multiplier.

A worked example

Take the calculator’s starting values: a 24-foot span, a 6/12 pitch, a 1.5-inch ridge board and a 12-inch overhang.

  • Half the span is 144 inches. Take off half the ridge board, 0.75 inch, and the run is 143.25 inches.
  • The 6/12 multiplier is √(36 + 144) ÷ 12 = 1.1180.
  • The rafter from ridge to wall is 143.25 × 1.1180 = 160.16 inches, which is 13′ 4-1/8″.
  • The tail is 12 × 1.1180 = 13.42 inches, or 1′ 1-3/8″.
  • The full rafter is 173.57 inches, which is 14′ 5-5/8″.

Span goes in feet; ridge board and overhang go in inches. Results are rounded to the nearest 1/8 inch.

Board length and the two cuts

A rafter is cut square to the ground at both ends, not square to the board. Those plumb cuts make the piece a parallelogram, so the board has to be longer than the rafter by the depth of the board times the pitch divided by 12. For a 7.25-inch-deep 2×8 at 6/12 that allowance is 3.625 inches, so the example needs 177.20 inches of board, 14′ 9-1/4″. Dimensional lumber is sold in 2-foot steps, which means buying 16-foot stock. Over 24 feet, the calculator says so rather than naming a length.

The plumb cut is the angle at the ridge and at the end of the tail. It equals the roof angle, atan(pitch ÷ 12), which is 26.57 degrees for 6/12. The seat cut is the level cut of the birdsmouth notch that sits on the wall plate, and it is 90 degrees minus the plumb angle, 63.43 degrees. On a framing square, hold 12 on the body and the pitch on the tongue: the tongue marks the plumb line and the body the seat line.

Hip and valley rafters, and the rafter count

On a hip roof where every plane has the same pitch, the hip rafter runs at 45 degrees to the walls in plan. Its run is therefore the common rafter’s run times the square root of 2, and its length is:

hip length = common run × √(2 + (pitch ÷ 12)²)

The calculator uses the full half span here, so the result is the theoretical length to the center of the ridge, 18′ 0″ for the example. A real hip is shortened for the ridge and gets side cuts, so treat this as the line length to lay out from. Valley rafters on equal-pitch roofs follow the same formula.

For the count, divide the building length by the rafter spacing, round up, and add one for the last rafter. That gives one side of a gable. For the example’s 40-foot building at 16 inches on center, that is 30 spaces and 31 rafters a side, 62 in all. Gable-end framing and doubled rafters are extra.

What this calculator does not do

It gives geometry, not structure. Whether a 2×8 can span the distance at your spacing depends on lumber species and grade, local snow and dead loads, and whether there is a ceiling below. Those answers come from the rafter span tables in the International Residential Code or from an engineer, and your building department has the final word. It also assumes a simple gable; it does not handle jack rafters, ridge beams with hangers, or roofs with two pitches.

Rafter length chart

Rafter length from ridge to wall for common spans and pitches, with a 1.5-inch ridge board and no overhang. Add your tail length on top.

Span4/126/128/1210/1212/12
12 ft6′ 3-1/8″6′ 7-5/8″7′ 1-5/8″7′ 8-3/4″8′ 4-3/4″
16 ft8′ 4-3/8″8′ 10-1/2″9′ 6-1/2″10′ 4″11′ 2-3/4″
20 ft10′ 5-3/4″11′ 1-3/8″11′ 11-3/8″12′ 11-1/4″14′ 0-5/8″
24 ft12′ 7″13′ 4-1/8″14′ 4-1/8″15′ 6-1/2″16′ 10-5/8″
28 ft14′ 8-1/4″15′ 7″16′ 9″18′ 1-3/4″19′ 8-1/2″
32 ft16′ 9-5/8″17′ 9-7/8″19′ 1-7/8″20′ 9″22′ 6-1/2″

Rafter length FAQ

How do you calculate rafter length?

Take half the building span, subtract half the thickness of the ridge board, and multiply that run by the pitch multiplier for your roof. For a 24-foot span at 6:12 with a 1.5-inch ridge board, the run is 143.25 inches and the rafter is 143.25 x 1.1180 = 160.16 inches, or 13′ 4-1/8″, before any overhang.

Does rafter length include the overhang?

Not unless you add it. The length from the ridge to the outside of the wall is the main rafter. The overhang, or tail, is extra: multiply its horizontal projection by the same pitch multiplier and add it. A 12-inch overhang on a 6:12 roof adds 13.42 inches of rafter.

Why subtract half the ridge board?

Rafter run is measured to the center of the ridge, but each rafter stops at the face of the ridge board, not its center. Taking half the board thickness off each run, 0.75 inch for a 1.5-inch board, keeps the two rafters from meeting in the middle of the board.

What length of lumber should I buy for rafters?

Buy the next even length above the full rafter length plus an allowance for the plumb cuts, which is the board depth times the pitch divided by 12. Lumber is sold in 2-foot steps, so a rafter that needs 14′ 9-1/4″ of board means buying 16-foot stock.

How many rafters do I need for a gable roof?

Divide the building length in inches by the rafter spacing, round up and add one for the end rafter. That is the count for one side, so double it for a gable. A 40-foot building framed at 16 inches on center needs 31 rafters per side, 62 in total.

How long is a hip rafter?

When both roof planes have the same pitch, a hip or valley rafter runs at 45 degrees in plan, so its run is the common rafter run times the square root of 2. Its theoretical length is the common run times the square root of (2 + (pitch / 12) squared), before the shortening for the ridge and the side cuts.