Rafter Calculator

Plan a gable roof frame. Enter the building span, the roof pitch, the overhang and the ridge board thickness, and the calculator gives you the rafter length, the height of the ridge above the walls, the roof angle, the number of rafters and the board length to buy.

Your measurements

ft
ft
in
in

Results

Rafter length (with overhang)14.46ft
Ridge height above walls5.97 ft
Roof angle26.6 °
Rafters (both sides)62 rafters
Board length to buy16 ft boards

Estimate only. Quantities are rounded up. Check product labels, your supplier and local building code before you buy or build.

How to use the rafter calculator

  1. Enter the span: the distance between the outside faces of the two walls.
  2. Enter the building length along the ridge and choose the rafter spacing.
  3. Pick the roof pitch (rise per 12 inches of run).
  4. Enter the overhang, measured level from the wall, and the ridge board thickness.
  5. Prefer metric? Tap Metric above the form to enter meters, centimeters and millimeters and get results in cubic meters, square meters and tonnes.

Formula

Run = span ÷ 2 − ridge thickness ÷ 2

Rafter length = (run + overhang) × √(1 + (rise ÷ 12)²)

Ridge height = run × rise ÷ 12. Rafters per side = building length × 12 ÷ spacing, rounded down, + 1

Worked example

A 24 ft span with a 6/12 pitch, 12 inch overhang and 1.5 inch ridge board gives a run of 11.94 ft and a rafter length of 14.46 ft (about 14 ft 5-1/2 in), so buy 16 ft boards. The ridge sits 5.97 ft above the walls. A 40 ft building at 16 inches on center needs 62 rafters.

Tips before you buy

  • The length shown is the line length along the slope. Seat cuts and plumb cuts are marked from it on the board.
  • Rafter size depends on span, spacing, wood species and snow load. Use span tables or your local building department.
  • Add rafters for gable overhangs (barge rafters) if your design uses them.
  • Always check the result against a test rafter before cutting the whole set.

Frequently asked questions

How do I calculate rafter length?

Find the run (half the span minus half the ridge), add the level overhang, and multiply by √(1 + (pitch ÷ 12)²).

How many rafters do I need?

Divide the building length in inches by the spacing, round down, add one, and double it for both sides of the roof.

What is the run of a rafter?

The level distance the rafter covers, from the outside of the wall to the center of the ridge, minus half the ridge board.

Can rafters be spaced 24 inches apart?

Sometimes. It depends on the rafter size, span, roof load and sheathing. Check span tables and local code.

Last updated: