Rafter Length Calculator
Use this rafter length calculator to find the length of a common rafter from the building span (or run) and the roof pitch. Add the horizontal overhang and the ridge board thickness, pick the rafter spacing and building length, and read the rise, roof angle, rafter length, number of rafters and the board length to buy. To work out pitch from rise and run use the roof pitch calculator, and for shingles and underlayment see the roofing calculator.
Math runs in your browser. Nothing is uploaded.
Total rafter length
—
Rafter length to the ridge (no overhang)
—
Overhang tail length
—
Total rise (wall top to ridge center)
—
Pitch, plumb cut / seat cut
—
Board length to buy
—
Rafters for both sides
—
Total rafter length, all rafters
—
Run = span ÷ 2 for a symmetrical gable roof. Rise = run × pitch ÷ 12. Rafter length = (run − half the ridge thickness) ÷ cos(angle), and the tail = horizontal overhang ÷ cos(angle). Lengths are line lengths along the rafter, before the plumb and seat (birdsmouth) cuts, which you mark with a speed square set to the pitch or angle. Rafters = 2 × (building length ÷ spacing, rounded up, + 1); gable-end framing, hips, valleys and collar ties are not included. Lumber is commonly sold in 2 ft steps, so the board length is rounded up to the next even foot. This tool does not size rafters: check the span tables in your building code or ask an engineer.
Roof Pitch Calculator · Roofing Calculator · Lumber Calculator · Board Foot Calculator · Stair Calculator
More in this group
How it works
- How do I calculate rafter length?
- Halve the span to get the run, then divide the run by the cosine of the roof angle, or use the Pythagorean theorem: √(run² + rise²). A 24 ft span at 6/12 has a 12 ft run and 6 ft rise, so the rafter is √(144 + 36) = 13.42 ft to the ridge, before the overhang.
- How do I add the overhang to a rafter?
- Measure the overhang horizontally from the outside of the wall, then divide it by the cosine of the roof angle to get the tail length along the rafter. At 6/12 a 1 ft overhang adds 1.12 ft, so the 24 ft span example becomes 14.53 ft in total.
- Do I subtract the ridge board from the rafter length?
- Yes. Each rafter stops at the face of the ridge board, so take half the ridge thickness off the run, measured level. A 1½ in ridge shortens the run by ¾ in, which at 6/12 shortens the rafter by about 0.84 in. Leave the field at 0 for rafters that meet each other.
- How many rafters do I need?
- Divide the building length by the spacing, round up and add 1 for each side, then double it. A 40 ft building at 16 in on center needs 31 rafters per side, or 62 in total. Add any extra rafters your plans show for gable overhangs or openings.
- What size lumber should I use for rafters?
- It depends on the span, spacing, wood species and grade, roof load and snow load, so this calculator does not pick a size. Use the rafter span tables in the International Residential Code (IRC) or your local code, the lumber grading agency's tables, or an engineer, and check with your building department.