Rafter Length Calculator

This rafter length calculator figures the common rafter for a gable roof from your building width and pitch, in feet and inches or meters. Pick a pitch from 1/12 to 12/12 and it returns the full ridge-to-tail length including the overhang, plus the rise, run, and slope multiplier — everything you need to order stock and set your saw.

Estimate your materials
ftin
Enter 0 or more.
inEnter 0 or more.
Ridge board thickness
inEnter 0 or more.

Rafter length (with overhang)

14' 5.56"

  • Run (half span)11' 11.25"
  • Rise at the ridge5' 11.63"
  • Slope multiplier1.118
  • Stock length to buy16 ft boards

Formulas last reviewed on .

How the rafter length is calculated

A common rafter is the hypotenuse of a right triangle, so the math is Pythagoras with a roofing accent:

run = (building width − ridge thickness) ÷ 2
rise = run × pitch ÷ 12
rafter = √(run² + rise²)
total = rafter + overhang × √(1 + (pitch ÷ 12)²)

The run is half the building width, minus half the ridge board on each side — rafters meet the face of the ridge, not each other, and skipping that 3/4″ is how ridge lines end up proud. The default 1.5″ is a standard ridge board; set it to zero if your rafters bear on a beam or meet at a plate.

Pitch is inches of rise per 12 inches of run, so a 6/12 roof climbs half as fast as it travels. Rise, run, and the square root give the rafter from ridge to the outside of the wall plate.

The slope multiplier, √(1 + (pitch/12)²), stretches any level distance along the slope. Your overhang is specified level — how far the eave sticks out in plan — but the rafter tail travels the slope, so the calculator multiplies before adding it on.

Worked example: a 24-foot-wide detached garage at 6/12

Say you’re framing a gable roof over a 24-foot-wide garage: 6/12 pitch, a standard 1.5″ ridge board, and a 12″ level overhang at the eaves. Those are the calculator’s defaults, so the result box above shows this exact roof.

  1. Run: (288″ − 1.5″) ÷ 2 = 143.25″ — that’s 11′ 11.25″ from ridge face to the outside of the plate.
  2. Rise: 143.25 × 6 ÷ 12 = 71.625″, or about 5′ 11.63″ of height at the ridge.
  3. Rafter to the plate: √(143.25² + 71.625²) = 160.16″, roughly 13′ 4.19″.
  4. Overhang along the slope: the 6/12 multiplier is √(1 + 0.5²) = 1.118, so 12″ level becomes 12 × 1.118 = 13.42″ of rafter tail.
  5. Total: 160.16 + 13.42 = 173.57″ = 14′ 5.56″ — buy 16-foot 2×8s and you’ve got comfortable trim room at the tail.

Cut one rafter, test it in place on both ends of the building, and only then gang-cut the rest. Ten minutes of checking beats twenty-five identical mistakes.

How long a rafter do I need for a 12 to 32 foot wide building?

The table below gives ridge-to-plate rafter lengths for common building widths at a shallow 4/12 and a steeper 8/12, assuming a 1.5″ ridge board and no overhang — add your overhang times the slope multiplier on top.

Common rafter lengths, ridge face to outside of plate, with a 1.5″ ridge board and no overhang.
Building widthRafter @ 4/12Rafter @ 8/12
12 ft6′ 3.13″7′ 1.63″
16 ft8′ 4.38″9′ 6.5″
20 ft10′ 5.69″11′ 11.31″
24 ft12′ 7″14′ 4.19″
28 ft14′ 8.31″16′ 9″
32 ft16′ 9.63″19′ 1.88″

Going from 4/12 to 8/12 adds about 14% to every rafter — the slope multipliers are 1.054 and 1.202. On a 32-foot building that’s over two extra feet per rafter, which is often the difference between buying 18s and buying 20s.

Frequently asked questions

How do I measure the pitch of my existing roof?

In the attic, hold a level horizontally with one end touching the underside of a rafter, measure 12 inches along the level, then measure straight up from that mark to the rafter. That vertical distance in inches is your pitch: 6 inches means 6/12. On the roof itself, the same level-and-tape trick works on the surface. Smartphone inclinometer apps work too — convert degrees back to pitch with tan(angle) × 12.

Does the birdsmouth change the rafter length I should cut?

No — the birdsmouth is a notch cut into the rafter where it seats on the wall plate, not an addition to its length. The lengths from this calculator are measured along the top edge of the rafter, which the notch doesn’t touch. What the birdsmouth does affect is strength: keep the seat cut so at least two-thirds of the rafter’s depth remains above the notch, and make sure the level seat fully bears on the plate.

Should I frame with rafters or order trusses?

For most simple gable roofs, trusses are cheaper, faster, and engineered for you — that’s why production builders use almost nothing else. Stick-framed rafters win when you want open attic space or vaulted ceilings, when the design has dormers or odd intersections, or when a crane can’t reach the site. A garage the size of our worked example could go either way; anything with living space under the roof leans rafters.

What length of lumber should I buy for my rafters?

Round the total rafter length up to the next stock size — dimensional lumber comes in 8, 10, 12, 14, 16, 18, and 20-foot lengths, and the calculator suggests one for you. Buy a size long rather than exact: the plumb cut at the ridge and the tail cut both eat length, and a rafter an inch short is firewood. Past 20 feet, look at engineered LVLs or splicing over a purlin.

What does the slope multiplier actually do?

It converts flat, plan-view distances into distances along the roof surface. At 6/12 the multiplier is 1.118, so every foot you travel horizontally is 1.118 feet of actual roof. This calculator uses it to stretch your level overhang along the slope, but it’s the same number you’d use to turn a house footprint into roof area for shingles or sheathing — which is why it’s worth writing down.

These results are planning estimates only — verify quantities with your supplier and local building code before you buy or build. See our terms of use.