The mistake I see most often on job sites is a builder buying 2x6s for a span they have not checked. The lumberyard will happily sell you whatever you carry out. The size of the rafter, meaning the depth of the board, is not a material-count decision. It is a structural call driven by span, snow load, and local code.
What this tool actually gives you
Two numbers. The first is the cut length of one rafter, measured along the slope from ridge to eave. The second is the count of rafters you need to stand up. Those are the numbers you buy and cut with. It stops there on purpose.
How length is set
Half the span is the run. Pitch tells you the rise over that run. The rafter is the sloped side of the triangle between them. Add the eave overhang, because rafters stick past the wall to shed water clear of the siding. A 24 ft span at 6/12 with 1 ft overhang cuts near 14.5 ft.
How count is set
Rafters sit on the wall at either 16 in or 24 in on center. 24 in spacing means one rafter every 2 ft, which halves the lumber list compared with 16 in. But wider spacing demands a deeper board, and that board size comes from a span table, not from guesswork.
For a gable roof there are two sloped sides, so whatever you count on one side doubles. A 20 ft wall at 24 in spacing puts up about 11 rafters per side, or 22 total.
Rafters versus trusses
Trusses are engineered in a factory, lifted into place whole, and cost less per pound than stick-built rafters. They leave the attic below open, but they limit you to the truss shape you ordered. Rafters let you frame a vaulted ceiling and pick the pitch on site, but every birdsmouth cut is done by hand.
The red line
Do not read a rafter length and assume a 2x6 will carry it. Pull the span table from the building code, or ask a structural engineer. The calculator counts boards; it does not certify them. You also need a ridge board along the peak, and a birdsmouth notch at every wall, neither of which changes the rafter length but both of which take time to cut.
Worked example
24 ft span, 6/12 pitch, 1 ft overhang, 20 ft building length, 24 in on center: rafters cut near 14.5 ft, about 11 per side, 22 total. Board size is on you.
Rafter Calculator
This tool cuts rafter length and counts rafters at 16 or 24 in on center, while leaving board size to a span table or local code.
How to use
- Enter the wall-to-wall span of the building
- Pick the roof pitch, such as 6/12
- Set the eave overhang, usually about 1 ft
- Enter the building length along the ridge
- Choose rafter spacing, 16 or 24 in on center
Supported formats and limits
- Length and count only, it does not pick 2x6 versus 2x8 versus 2x10
- Common gable rafters only, no hip or valley cuts
- Double the per-side count for a full gable roof
Examples
A 24 ft span at 6/12 with 1 ft overhang and 24 in spacing on a 20 ft wall lands near 14.5 ft rafters, 11 per side, 22 total.Common errors
- Span must be a positive number of feet
- Spacing must be either 16 or 24 in on center
Privacy and browser support
All calculations run locally in your browser. No building dimensions are uploaded.
FAQ
How long is a rafter?
It runs from the ridge to the outside wall, plus the eave overhang. A 24 ft span at 6/12 with 1 ft overhang cuts near 14.5 ft, measured along the slope.
16 in or 24 in on center?
16 in spacing uses more rafters but lets you use narrower boards. 24 in spacing halves the count, but the rafters themselves must be deeper and are sized by code.
How many rafters do I need?
Divide the wall length by the on-center spacing, round up, add one for the end, then double for a gable roof with two sloped sides.
Rafters or trusses?
Trusses are prefab, cheaper per pound, and leave the attic open below. Rafters let you finish a vaulted ceiling, but they need field cuts and a ridge board.
Can I use a 2x6 on a 24 ft span?
Do not guess. Board size is structural engineering governed by span tables and snow load. This calculator stops at length and count on purpose.