Introduction
A roof truss calculator looks like a black box — you enter a length and a spacing, and out comes a truss count — but there is no black box. The entire tool is five short formulas from basic geometry: a division for the truss count, a unit conversion for the spacing, the Pythagorean theorem for rafter length, a sum for the ridge board, and an area division for sheathing. Once you’ve worked each one by hand, you’ll never misread a result again.
The Roof Truss Calculator runs all five in both metric and imperial. This guide derives each formula, shows exactly where every number comes from, and works two full examples — one imperial, one metric — so you can verify the calculator against your own tape measure.
Formula 1: Truss Count
Trusses = (Building length ÷ On-center spacing) + 1
The division gives the number of spaces between trusses; the +1 accounts for the truss at the zero mark. A fence with 10 eight-foot sections needs 11 posts — same idea. Units must match: convert the building length to inches (feet × 12) or millimeters (meters × 1000) before dividing by the spacing.
Imperial: 30 ft building, 24 in o.c. → 360 ÷ 24 = 15 spaces → 15 + 1 = 16 trusses.
Metric: 9.14 m building, 600 mm o.c. → 9140 ÷ 600 = 15.23 → +1 = 16.23 → round to 16 trusses (bay spacing adjusts to 9140 ÷ 15 ≈ 609 mm).
Always round fractional results up for the space count and re-check the resulting bay spacing against the design maximum. Rounding down would stretch bays past the engineered spacing.
Formula 2: Spacing Conversion
Spacing (in) = Spacing (mm) ÷ 25.4 and Spacing (mm) = Spacing (in) × 25.4
This is how the calculator accepts either system. The standard spacings pair up as 16 in ≈ 406 mm (commonly rounded to 400 mm) and 24 in ≈ 610 mm (commonly rounded to 600 mm). Note the rounding: a “600 mm” layout is actually 10 mm tighter than true 24-in spacing, which is fine — tighter never violates the design.
Why it matters: sheathing panels are manufactured to break on these modules — 4×8 ft (1220×2440 mm) sheets land on 24-in/600-mm multiples. If your spacing doesn’t divide the sheet size evenly, panel edges fall between trusses and every sheet needs blocking.
Formula 3: Rafter Length (Stick Framing)
Rafter = √(run² + rise²), where run = span ÷ 2 and rise = run × (pitch ÷ 12).
Pitch in the US is expressed as rise over a 12-inch run: 6/12 means 6 inches of vertical rise for every 12 inches horizontal. The rafter is the hypotenuse of that right triangle. This formula covers the rafter from ridge to wall plate — the eave overhang (“tail”) is a second, smaller triangle added afterward.
Imperial: 24 ft span, 6/12 pitch → run = 12 ft; rise = 12 × 0.5 = 6 ft; rafter = √(144 + 36) = √180 = 13.42 ft.
Metric: 7.32 m span, 6/12 pitch → run = 3.66 m; rise = 1.83 m; rafter = √(13.40 + 3.35) = √16.75 = 4.09 m.
Overhang tail: for a 2 ft (610 mm) horizontal overhang at 6/12 — tail rise = 2 × 0.5 = 1 ft; tail = √(4 + 1) = 2.24 ft (0.68 m). Total cut length ≈ 13.42 + 2.24 = 15.66 ft, minus half the ridge board thickness where the rafter meets the ridge. Cutting rafters is covered step-by-step in the complete guide.
Formula 4: Ridge Board Length
Ridge length = Building length (plus gable overhangs if the ridge extends past the end walls).
For stick-framed roofs, the ridge board runs the full length of the building at the peak, and rafter pairs nail to each side. The board is typically 1 inch (25 mm) thick and at least as deep as the rafter cut — a 2×8 ridge for 2×8 rafters is the common pairing. Length-wise, buy the building length plus any gable-end overhang (usually 12–24 in / 300–600 mm per end for ladder lookouts), and splice over a rafter pair if one board won’t span it.
Note the distinction: a ridge board is non-structural (the rafters support each other through ceiling joists or ties), while a ridge beam is a structural member that carries the rafters and needs engineering. The calculator returns the board length; a beam needs a design professional.
Formula 5: Sheathing Quantity
Sheets = (2 × Rafter length × Building length) ÷ Sheet area, rounded up, + waste
Each roof plane is a rectangle: slope length (rafter + overhang tail) times building length. Two planes make the gable roof. Divide by the sheet area — 32 ft² for a 4×8 sheet (2.98 m² for 1220×2440 mm) — round up, then add 10% waste for cuts at valleys, hips, and edges.
Worked example: 30 × 40 ft building, 13.42 ft rafter + 2.24 ft tail = 15.66 ft slope. One plane = 15.66 × 40 = 626.4 ft²; two planes = 1252.8 ft²; ÷ 32 = 39.15 → 40 sheets; +10% = 44 sheets. Metric: same roof is 9.14 × 12.19 m with 4.77 m slope → 2 × 4.77 × 12.19 = 116.3 m² ÷ 2.98 = 39.0 → 40 sheets + 10% = 44 sheets. Both systems agree, as they must.
Putting It All Together
One pass through every formula for a 30 × 40 ft garage, 24 ft truss span, 6/12 pitch, 24 in o.c.:
- Trusses: (40 × 12) ÷ 24 + 1 = 480 ÷ 24 + 1 = 21 trusses (+ 2 gable ends).
- Spacing check: 24 in = 610 mm; sheathing 4×8 ft breaks every 2 trusses. ✓
- Rafter (if stick-framed): run 12 ft, rise 6 ft → 13.42 ft + 2.24 ft tail.
- Ridge board: 40 ft + gable overhangs.
- Sheathing: 44 sheets of 4×8 (7/16 in OSB typical) with waste.
That five-line takeoff is the entire output of the calculator, verified by hand. For turning it into a purchase list with fasteners and connectors, see the estimating guide; for what each result costs, the cost guide.
Related Guides
- Complete Guide — truss types, spacing, loads, and gable vs. hip layouts.
- Estimating Guide — from these formulas to a full material list.
- Ordering & Install Checklist — verify every number before the truck arrives.
- Common Mistakes — the input errors that break otherwise good math.
- FAQ — quick answers on counts, spacing, and rafter math.
Get Your Number
Five formulas, no black box: count = length ÷ spacing + 1, spacing converts at 25.4 mm per inch, rafter = √(run² + rise²), ridge = building length, sheathing = roof area ÷ sheet area plus waste. The Roof Truss Calculator runs all five instantly in metric or imperial — work one example by hand using this guide, confirm it matches, and you’ll trust every result after that.
Disclaimer: Calculator results are planning estimates based on the dimensions you enter. Roof trusses are engineered structural products — always order from a manufacturer that supplies sealed engineering drawings, verify spans and loads with a licensed engineer, and check your local building code before construction.
