How to use the rafter calculator
- Choose a Gable roof (two sloped sides meeting at a ridge) or a Shed roof (one slope).
- Enter the Pitch as inches of rise per 12 in of run, such as 6 for a 6/12 roof.
- Enter the Building span from outside wall to outside wall and the Building length along the ridge.
- Enter the Overhang, measured level from the wall to the rafter tail, and the ridge board thickness.
- Pick the rafter spacing and size, and optionally the price per board.
How it works
A rafter is the hypotenuse of a right triangle whose legs are the run and the rise. The slope multiplier converts any level distance into the sloped length along the rafter.
The plumb cut at the ridge is cut at the roof angle; the seat cut of the birdsmouth that sits on the wall is square to it.
Run = span ÷ 2 − ridge thickness ÷ 2 (gable) or span (shed)
Slope multiplier = √(1 + (rise ÷ 12)²)
Rafter length = (run + overhang) × slope multiplier
Rafters per side = building length ÷ spacing, rounded up, + 1
Worked example
A 24 ft wide gable building with a 6/12 pitch and 1½ in ridge board has a run of 12 ft − ¾ in = 11.94 ft.
The slope multiplier for 6/12 is 1.118, so the rafter is 13.35 ft to the wall plus 1.12 ft of tail for a 12 in overhang: 14.46 ft, cut from 16 ft boards.
A 30 ft building at 16 in on center needs 24 rafters per side, 48 in total.
Tips before you buy
- Cut one pattern rafter, test it at both ends of the building, then mark the rest from it.
- Sight down each board and install it crown side up.
- Add hurricane ties or rafter ties where your local code requires them.
Frequently asked questions
How do you calculate rafter length?
Multiply the run (half the span on a gable roof, less half the ridge board) by the slope multiplier √(1 + (rise ÷ 12)²), then add the overhang times the same multiplier.
How many rafters do I need?
Divide the building length in inches by the spacing, round up and add one for each side. A 30 ft gable roof at 16 in on center needs 24 per side, 48 total.
What size rafters do I need?
It depends on the span, snow and dead load, wood species and grade. Use the span tables your local building department follows; this calculator only labels the shopping list.
What angle do I cut rafters?
The plumb cut is the roof angle measured from vertical, 26.6° for a 6/12 roof. The seat cut is the complement, 63.4°.
Results are estimates based on the measurements you enter and typical material properties, and costs are planning estimates: actual costs vary. Products vary, so check quantities with your supplier and follow product labels and your local building codes. Read the full disclaimer. Last reviewed October 9, 2026.