Rafter calculator
Work out how long each roof rafter needs to be and how many the roof needs, from run, pitch and overhang.
Rafter calculator
Work out how long each roof rafter needs to be and how many the roof needs, from run, pitch and overhang.
Enter the building length, rafter run and rise to see the rafter length and count.
Rafter length
Project summary
How it works
This is a material length estimate, not structural design. Rafter size, spacing and span depend on span tables, load and local code, so check both before building.
Rafter calculator
Rafter length is a right triangle
A rafter runs from the wall plate up to the ridge, and its length is the hypotenuse of a right triangle: the horizontal run along the ceiling and the rise the roof climbs over that run. The pitch you enter as rise per 12 inches of run sets that rise, and the calculator finds the hypotenuse with the Pythagorean theorem, then adds the overhang past the wall so the number matches the actual board length to cut, not just the distance to the wall plate.
What pitch does to the length
A steeper pitch makes each rafter longer for the same run, since more of the triangle goes into rise rather than run. A 4 in 12 roof and a 12 in 12 roof spanning the same building will need noticeably different rafter lengths and different amounts of lumber, which is why entering the actual pitch, not a rounded guess, matters for getting a usable length estimate.
Frequently asked questions
How do I calculate rafter length from the pitch?
Divide the rise-per-12 pitch number by 12 to get the pitch ratio, multiply that ratio by the run to get the rise, then take the square root of the run squared plus the rise squared to get the rafter length before overhang. This calculator does that math and adds your overhang automatically.
Does this size the rafters or check if they will span the roof?
No. This is a material length and count estimate only, not a structural design. Rafter size, spacing and how far a given size can span depend on span tables, snow and roof load, and your local building code, none of which this calculator checks.
How many rafters do I need for a 20 foot roof?
At 24 inch on centre spacing, you need about 11 pairs of rafters for a 20 foot span. The calculator gives you the count based on your roof dimensions and rafter spacing.
What size rafters do I need?
Rafter size depends on the span, spacing and load. 2 by 8 rafters are common for spans up to 16 feet. 2 by 10 or 2 by 12 handle longer spans. Your local code specifies the minimum.
How do I calculate rafter length?
The rafter length is the hypotenuse of the triangle formed by the span and the rise. The calculator computes this automatically from your roof dimensions and pitch.
What is the difference between a rafter and a truss?
Rafters are individual members cut on site. Trusses are pre-engineered assemblies manufactured off site. Trusses are faster to install for standard roof shapes. The calculator estimates rafter quantities for stick-framed roofs.
Do I need collar ties or rafter ties?
Yes, collar ties or rafter ties prevent the rafters from spreading apart under load. They are required by code in most areas. The calculator counts rafters, and you add ties separately.
How much waste should I add for rafters?
A 10 to 15 percent waste factor is standard. More complex roofs with valleys and hips need more. The calculator lets you set the waste percentage.