Introduction
Every roof framing job — a garage, an addition, a garden shed — starts with the same question: how long do you cut the rafters? Cut too short and the lumber is scrap; cut too long and every rafter lands differently at the ridge and the wall plate. Rafter calculation answers that question with arithmetic instead of guesswork: from the roof pitch and the building span, you derive each rafter’s length, its angles, and how many boards the job needs.
The Rafter Calculator handles the core calculation: enter your span, pitch, and spacing, and it returns common rafter lengths, ridge requirements, and a material count in both metric and imperial units. This guide explains everything behind those numbers — the terminology, the formulas, and a full worked example.
What Rafter Calculation Is and Where It’s Used
A rafter is the sloped framing member that runs from the ridge (the roof’s peak) down to the wall plate, carrying the roof deck above. Rafter calculation turns two inputs — the span of the building and the pitch of the roof — into every cut on the job. The people who need this math:
- Homeowners and DIYers framing garages, sheds, additions, and porch roofs.
- Carpenters and framing contractors laying out rafters, ridges, and birdsmouth cuts on site.
- Builders and estimators, where rafter counts and board footage drive the lumber order and budget.
- Lumber suppliers, who use the same numbers to quote material packages.
The main elements you’ll calculate are common rafters (identical rafters on a gable roof), hip and valley rafters (diagonal members at roof intersections), jack rafters (shortened commons meeting a hip or valley), and the ridge board they tie into.
Key Terms and Variables
Span and Run
Span is the horizontal distance from the outside of one wall to the outside of the opposite wall. A common rafter’s run is half the span: ridge centerline to the outside face of the wall plate.
Pitch
The roof’s slope as rise over a 12-unit run — 6:12 means 6 inches (150 mm) of rise per 12 inches (300 mm) of run. Higher pitch means longer rafters and steeper cuts.
Rafter Spacing
The on-center distance between rafters — almost always 16 in (406 mm) or 24 in (610 mm) o.c. Closer spacing shortens each rafter’s allowable span and increases the lumber count.
Birdsmouth
The notch where the rafter sits on the wall plate: a horizontal seat cut bearing on the plate and a vertical plumb cut against the plate’s outer face. Seat-cut depth is the most error-prone dimension in rafter layout.
Ridge Board
The horizontal board at the peak that rafter tops nail to. Lengths are measured to the face of the ridge board, so half its thickness is deducted from the theoretical length — 0.75 in (19 mm) for a 2× ridge.
| Pitch | Angle | Rafter length per foot (300 mm) of run |
|---|---|---|
| 4:12 | 18.4° | 12.65 in (321 mm) |
| 6:12 | 26.6° | 13.42 in (341 mm) |
| 8:12 | 33.7° | 14.42 in (366 mm) |
| 10:12 | 39.8° | 15.62 in (397 mm) |
| 12:12 | 45.0° | 16.97 in (431 mm) |
The last column is the unit length — multiply it by the run in feet (or meters) to get the rafter length. The full derivation is in the formula-explained guide.
The Formulas Involved
Formula 1: Common rafter length
Unit length = √(12² + pitch²), then length = unit length × run (ft). For 6:12: √180 = 13.416 in per ft. A 12-ft run gives 13.42 ft (4.090 m). Metric is identical: run 3.658 m, rise 1.829 m → √(3.658² + 1.829²) = 4.090 m.
Formula 2: Hip and valley rafter length
A hip runs diagonally at 45° in plan, so its horizontal run is √(12² + 12²) ≈ 16.97 per foot of common run. Unit hip length = √(16.97² + pitch²) — at 6:12, 18.00 in per ft, so a 12-ft run gives an 18.0-ft hip rafter.
Formula 3: Rafter count
Pairs = (ridge length ÷ spacing) + 1; total = 2 × pairs. A 36-ft ridge at 24 in o.c.: 36 ÷ 2 + 1 = 19 per side → 38 rafters, plus spares. The full takeoff — board feet, waste, hardware — is in the estimating guide.
Worked Example: From Span to Cut List
A garage: 24-ft (7.315 m) span, 6:12 pitch, 36-ft (10.973 m) ridge, 24 in (610 mm) o.c.
Step 1 — Run: 24 ÷ 2 = 12 ft (3.658 m).
Step 2 — Theoretical length: 13.416 × 12 = 160.99 in = 13.42 ft (4.090 m), ridge centerline to outside of plate.
Step 3 — Ridge deduction: 160.99 − 0.75 = 160.24 in (13.35 ft / 4.070 m) — the layout length.
Step 4 — Cut angles: plumb cut atan(6/12) = 26.6°; seat cut 90 − 26.6 = 63.4°.
Step 5 — Count: 19 per side → 38 common rafters.
Metric cross-check: √(3.658² + 1.829²) = 4.090 m — identical. Practical takeaway: 13.35 ft plus a 2-ft eave overhang (≈2.24 ft along the rafter) needs ≈15.6 ft of board, so you order 16-ft stock, not 14-ft. For pricing that cut list, see the cost guide.
Common vs Hip vs Valley Rafters
- Common rafters run square from ridge to plate — all identical; cut one pattern rafter and trace the rest.
- Hip rafters run diagonally from ridge end to the outside corner — about 34% longer than commons at 6:12, with compound cheek cuts.
- Valley rafters mirror hips at inside corners where two roof planes meet — same math, different position.
- Jack rafters are shortened commons framing into a hip or valley, stepping down one spacing’s worth of length each.
- Collar ties connect opposing pairs in the upper third of the attic, resisting outward thrust — about 8 ft (2.44 m) on this example roof.
The rule: calculate the common rafter first — everything else is a variation of that number. For lumber sizing across these members, see the material guide.
Mistakes That Distort Results
- Measuring the run to the wrong point — ridge centerline to outside face of plate, not the inside of the wall.
- Forgetting the ridge deduction — the board stops at the ridge face, not the centerline.
- Cutting the birdsmouth too deep — a seat cut past ~1/3 of the rafter depth weakens the highest-stress point; verify against local code.
- Mixing pitch conventions — 6:12 is rise-per-12, not degrees and not percent.
- Ignoring the overhang in the stock order — add the eave (measured along the rafter) before choosing board length.
- Rounding stock down — a 15.6-ft rafter needs a 16-ft board, always round up.
A fuller catalogue with fixes is in the common mistakes guide.
Related Guides
- Rafter Calculator FAQ — quick answers to the most asked questions.
- Formula Explained — the full derivation of unit rise, hip math, and cut angles.
- Cost Guide — lumber and labor budgeting for the rafter package.
- Material Guide — species, grades, and sizes for rafters, ridges, and ties.
- Estimating Guide — takeoffs, board feet, waste, and hardware counts.
- Framing Checklist — step-by-step layout, cutting, and installation checks.
Frequently Asked Questions
How long is a rafter for a 24-foot span at 6:12 pitch?
13.42 ft (4.090 m) from ridge centerline to plate — 13.35 ft (4.070 m) after the ridge board deduction.
What is standard rafter spacing?
16 in (406 mm) or 24 in (610 mm) on center. The choice depends on rafter size, span, and loads — span tables and local code govern.
How deep should a birdsmouth cut be?
Keep the seat cut shallow — about one-third of the rafter’s depth is a common guideline, but the enforceable limit is your local building code’s.
How do you calculate a hip rafter length?
√(16.97² + pitch²) per foot of common run — at 6:12, 18.00 in per ft, so a 12-ft run gives an 18-ft hip rafter.
How many rafters do I need?
(Ridge length ÷ spacing) + 1, doubled for both sides. A 36-ft ridge at 24 in o.c. needs 38 commons, plus spares.
Should I use metric or imperial mode?
Whichever matches your measurements and your lumber supplier. The math is identical; only consistency matters.
Get Your Cut List
Rafter framing is straightforward arithmetic built on two careful measurements: the span and the pitch. Get the run right, apply the unit length, deduct the ridge, add the overhang, and the cut list writes itself. The Rafter Calculator does the arithmetic — your job is the tape measure. Plug in your numbers, check the result against the formulas above, and price it out with a couple of local suppliers before you order.
Disclaimer: Calculator results are planning estimates based on the dimensions you enter. Actual rafter requirements vary with lumber sizes, site conditions, and roof design. Verify dimensions with your supplier and consult a licensed professional or your local building authority for structural or code-related decisions.
