Rafter Calculator — Rafter Length, Run, Rise & Total with Overhang
How long is a common rafter for a given span, pitch and overhang
A rafter calculator turns two numbers a framer already knows — the building span and the roof pitch — into the length of board to cut for a common rafter. Cut a rafter short and the ridge won't meet; cut it long and you've wasted a 2×8 and a measurement. This tool does the right-triangle math, adds your eave overhang, and rounds up the board you buy to a standard stock length, because lumber comes in even feet, not in your exact decimal.
The whole job is one right triangle. The roof is symmetrical, so each common rafter spans half the building:
• Run = span ÷ 2. A 24 ft span gives a 12 ft run — the horizontal distance from the outside wall to the ridge.
• Rise = run × (pitch ÷ 12). Pitch is written as X/12 — a 6/12 pitch climbs 6 inches of rise for every 12 inches of run. So a 12 ft run at 6/12 rises 12 × (6 ÷ 12) = 6 ft.
• Rafter line length = √(run² + rise²). This is the sloped length from the outer wall (the bird's-mouth seat cut) up to the ridge — the hypotenuse. For our example: √(12² + 6²) = √(144 + 36) = √180 = 13.42 ft.
• Total rafter length = line length + overhang. The overhang (or eave) is the part that sticks past the wall to form the soffit — typically 12 to 24 inches. The overhang runs along the same slope, so a 16 in horizontal overhang adds 16 × (line length ÷ run) of sloped board. Many framers simply add the slope-length of the overhang to the line length to get the board to cut.
A shorthand on every framing square is the per-foot multiplier: a 6/12 roof has a rafter length of 13.42 inches per foot of run (√(12² + 6²) = 13.42). Multiply that by your run in feet and you get the line length without a calculator. This tool shows that multiplier so you can sanity-check a cut on site.
From the line length, two practical numbers fall out. The board length to buy is the total rafter length rounded up to the next 2-foot lumber increment (a 13.42 ft rafter is cut from a 14 ft board). The rafter count comes from the roof length and your on-center spacing: rafters = roof length ÷ spacing + 1, then doubled for both slopes of a gable. A waste factor (default 10%) covers bad cuts, knots and the occasional cracked board. Pair this with a roof-pitch-calculator to find pitch from rise and run, and a roofing-calculator to turn the slope area into shingle squares.
Calculator
Fill in the fields and click "Calculate" for instant results.
📰 Formula
• Run (ft) = span (ft) ÷ 2 • Rise (ft) = run × (pitch ÷ 12) • Rafter line length (ft) = √(run² + rise²) • Per-foot multiplier (in/ft of run) = √(12² + pitch²) • Overhang slope length = overhang (ft) × (line length ÷ run) • Total rafter length = line length + overhang slope length • Board to buy = round total length UP to the next 2 ft lumber size • Rafter count (one slope) = ceil(roof length ÷ spacing) + 1; gable = ×2 • With waste: rafters × (1 + waste% ÷ 100), rounded up
📰 Formula
• Run (ft) = span (ft) ÷ 2 • Rise (ft) = run × (pitch ÷ 12) • Rafter line length (ft) = √(run² + rise²) • Per-foot multiplier (in/ft of run) = √(12² + pitch²) • Overhang slope length = overhang (ft) × (line length ÷ run) • Total rafter length = line length + overhang slope length • Board to buy = round total length UP to the next 2 ft lumber size • Rafter count (one slope) = ceil(roof length ÷ spacing) + 1; gable = ×2 • With waste: rafters × (1 + waste% ÷ 100), rounded up
🧪 Worked examples
Example 2
Example 3
Example 4
⚠️ Common mistakes
- Using the full span as the run — the run is half the span for a symmetrical roof.
- Treating pitch like a percent; 6/12 means rise ÷ run = 6/12 = 0.5, not 6%.
- Adding the horizontal overhang straight to the line length instead of its sloped length.
- Buying a board the exact rafter length — round up to the next 2 ft stock size for the seat and plumb cuts.
- Forgetting the +1 rafter and doubling for both slopes when counting a gable roof.
💡 Tips
- Pitch is always written X/12; convert it to a slope by dividing by 12 before you multiply the run.
- The per-foot multiplier (√(144 + pitch²)) is the fastest on-site check of a rafter cut.
- Order rafters one stock length longer than the line length so there's board for the bird's-mouth and plumb cut.
- 16 in on-center is the framing default; 24 in OC uses fewer rafters but needs thicker stock or a closer span.
- Add the waste factor before rounding to whole rafters so a couple of bad cuts don't leave you short.
Embed this calculator on your site
Copy the code below and paste it into the HTML of your site or blog.
<iframe src="https://www.calcnimbus.com/embed/rafter-calculator" width="100%" height="500" frameborder="0" style="border:1px solid #eee;border-radius:12px"></iframe>
❓ Frequently asked questions
How do I calculate rafter length?
Take half the span as the run, find the rise with run × (pitch ÷ 12), then the rafter line length is the square root of run² + rise². A 24 ft span at 6/12 pitch gives run 12, rise 6, and a rafter of √(144 + 36) = 13.42 ft before overhang.
What is the run of a rafter?
The run is the horizontal distance from the outside of the wall to the center of the ridge — half the building span for a symmetrical gable. A 28 ft span has a 14 ft run.
How does roof pitch affect rafter length?
Pitch is written as X/12, the inches of rise per 12 inches of run. A steeper pitch raises the rise, which lengthens the rafter. At 4/12 the rafter is about 8.43 ft for a 16 ft span; at 8/12 the same span needs about 9.61 ft.
How much overhang should a rafter have?
Eave overhangs are usually 12 to 24 inches. The overhang runs along the roof slope, so add its sloped length — horizontal overhang × (line length ÷ run) — to the line length to get the board you cut.
What is the rafter length per foot of run?
It is the diagonal of a 12-inch run and the pitch rise: √(12² + pitch²) inches per foot of run. A 6/12 roof is 13.42 in per foot, so a 10 ft run gives a 13.42 ft line length. This number is stamped on a framing square.
How many rafters do I need for my roof?
Divide the roof length by the on-center spacing and add one: ceil(length ÷ spacing) + 1 per slope. A 30 ft gable at 16 in (1.333 ft) OC needs 24 rafters per side, or 48 total before waste.
What length board do I buy for a rafter?
Lumber comes in even-foot lengths, so round the total rafter length (line length plus overhang) up to the next 2 ft size. A 13.42 ft rafter with a 16 in overhang (14.91 ft) is cut from a 16 ft board.
Is the rafter the same as the slope length of the roof?
The rafter line length equals the roof slope length from wall to ridge. The total board adds the overhang past the wall, so the lumber you buy is longer than the structural slope length.
What spacing should rafters be — 16 or 24 inches on center?
16 in on-center is the most common and works with smaller stock; 24 in OC uses fewer rafters but generally needs deeper lumber or a shorter span. Set the spacing before you count rafters, since it changes the total.