Home › Rafter Calculator

Rafter Calculator

Rafter lengths from the roof span and pitch: common rafter with the ridge deduction and eave overhang, hip rafter, the board length to buy, and the rafter count.

Roof span, pitch and length

Rafter length is just the slope, walked out

A common rafter is the hypotenuse of the roof's right triangle: the run is half the building's span, the rise is the pitch applied to that run, and the rafter's length is the run stretched by the slope factor, √(1 + (pitch/12)²). Two honest adjustments turn that line on paper into the board you cut: the tail — the eave overhang adds its own sloped length — and the ridge, where half the ridge board's thickness comes back off, because paired rafters meet the board, not each other. The result rounds up to a stock length, which is the calculator's cut allowance: the difference between the math and the lumber is your room for the plumb and seat cuts.

Common rafter = (run + overhang − ½ ridge thickness) × slope factor  ·  Hip rafter = (run + overhang) × √(2 + (pitch/12)²)  ·  Count = 2 × (building length ÷ spacing + 1)
Example: a 24 ft span at 6/12 — the textbook roof — with a 1 ft overhang and a 2× ridge: the common rafter measures 14.46 ft, so you buy 16 ft boards; hips run 19.5 ft (20 ft boards); a 40 ft building at 16 in centers takes 62 common rafters. Without the overhang and ridge adjustments, the pure geometry is the classic 13.42 ft.

Lengths here are the rafter's line length along its top edge, the number layout starts from. The birdsmouth — the notch that seats the rafter on the wall plate — is laid out from that line on site; its depth is limited (commonly to a quarter of the rafter's depth) so the board keeps its strength, and it does not change the stock length you buy. Hip rafters on a real hip roof also want a small ridge-end adjustment and drop/shoulder cuts the calculator does not model; treat the hip figure as the buying length, not the cut list. Roof framing is structural — sizes, spans and connections follow your local code's rafter tables, and long spans, snow country and cathedral ceilings are engineer territory. The roof pitch calculator untangles pitch, angle and slope percent if the numbers on a plan are in the other dialect.

Frequently asked questions

Why is the rafter longer than half the building width?

Because it climbs as it crosses. At a 6/12 pitch every foot of horizontal run becomes 1.118 ft of rafter; at 12/12 it becomes 1.414 ft. The slope factor is the whole story — plus the overhang's tail, which is rafter too, just rafter that hangs past the wall in the air.

What is the ridge deduction?

Paired rafters nail to opposite faces of the ridge board, so each rafter stops half the board's thickness short of the roof's centerline. For a standard 2× ridge that is 3/4 in measured horizontally, which the calculator converts along the slope. Skip it and every rafter is a hair long and the ridge stands crooked — a small number with an outsized temper.

How many rafters does a roof need?

One pair per spacing step along the building, plus the closing pair at the far end — at 16 in centers a 40 ft building takes 31 pairs, 62 rafters. Gable ends usually close with a gable-end rafter or ladder lookouts in the same count class; hips replace the end commons with jack rafters down each hip, which a hip roof's cut list works out on site.

What size lumber are rafters?

Commonly 2 × 6 to 2 × 12, chosen from the code's rafter span tables by span, spacing, species and snow load — the same family of tables as the joist span check, but for roofs. The calculator counts lengths and pieces; the depth of the board is a table (and local snow) decision, and it drives the birdsmouth layout too.