Roof Truss Calculator · Truss Count & Rafter Length

Roof Truss Calculator

Calculate truss count or rafter length from roof dimensions

I want to calculate…
Truss layout
Truss count = ⌈Roof length ÷ On-center spacing⌉ + 1 + extra end trusses. Typical spacing: 16 in (41 cm), 24 in (61 cm) or 60 cm.
Rafter geometry
:12
deg
Rafter length = (Span ÷ 2 + Overhang) ÷ cos(pitch). This is the sloped length from ridge center to eave edge.
Results
✅ Standard Layout
Truss Count
—
—
Roof length
—
On-center spacing
—
Spans (bays)
—
Truss count
—
Estimate only. Confirm spans, loads and design with a licensed truss manufacturer.
Expenses
$/truss
Total Expenses
—
—
\n';var escaped = toolHtml.replace(/&/g, '&').replace(/"/g, '"');embedCodeTextarea.value = ''; }window.toggleEmbedPanel = function () { if (embedPanel.style.display === 'none' || embedPanel.style.display === '') { generateEmbedCode(); embedPanel.style.display = 'block'; } else { embedPanel.style.display = 'none'; } };window.copyEmbedCode = function () { embedCodeTextarea.select(); if (navigator.clipboard) { navigator.clipboard.writeText(embedCodeTextarea.value).then(function () { alert('Embed code copied!'); }).catch(function () { alert('Press Ctrl+C'); }); } else { alert('Press Ctrl+C'); } };/* ─────────── Events ─────────── */ function bindAll() { [roofLengthInput, spacingInput, extraTrussesInput, spanInput, overhangInput, pitchRatioInput, singleTrussCostInput, installPerTrussInput].forEach(function (el) { el.addEventListener('input', calculate); el.addEventListener('change', calculate); });currencySelect.addEventListener('change', function () { updateCurrencyLabels(); calculate(); });calcModeRadios.forEach(function (r) { r.addEventListener('change', function () { updateModeVisibility(); calculate(); }); });installRadios.forEach(function (r) { r.addEventListener('change', function () { updateInstallVisibility(); calculate(); }); });attachUnitConversion(roofLengthInput, roofLengthUnit); attachUnitConversion(spacingInput, spacingUnit); attachUnitConversion(spanInput, spanUnit); attachUnitConversion(overhangInput, overhangUnit); }if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { bindAll(); updateCurrencyLabels(); updateModeVisibility(); calculate(); }); } else { bindAll(); updateCurrencyLabels(); updateModeVisibility(); calculate(); }})();

Creator & Maintainer

Image of Faiq Ur Rahman, CEO & Founder Toolraxy

Faiq Ur Rahman

Founder & CEO, Toolraxy

Faiq Ur Rahman is a web designer, digital product developer, and founder of Toolraxy, a growing platform of web-based calculators and utility tools. He specializes in building structured, user-friendly tools focused on health, finance, productivity, and everyday problem-solving.

Share:

Rate this Tool

User Ratings:

0
0 out of 5 stars (based on 0 reviews)
Excellent
Very good
Average
Poor
Terrible

ADVERTISEMENT

ADVERTISEMENT

Roof trusses and rafters are the two structural approaches to framing a roof, and each has its own estimating question. With trusses, the question is how many: they arrive pre-built, are craned into position at a specified spacing, and a miscount means a second delivery or a stranded gap at one end of the building. With rafters cut on site, the question is how long: each board has to reach from the ridge to the eave, with the pitch angle determining the exact sloped length. This calculator handles both questions in one place. It is built for carpenters preparing a cut list, for owner-builders ordering trusses from a fabricator, and for anyone trying to work out whether a change of pitch will push a rafter past the stock length available at their timber yard.

 

How to Use the Roof Truss Calculator

  1. Select Truss count or Rafter length from the mode selector at the top.

  2. For truss count, enter the Roof length measured along the ridge or eaves.

  3. Set the On-center spacing your truss design specifies, 60 cm and 61 cm are the common values.

  4. Add any Extra end trusses needed for hips or gable ends, then note the truss count in the hero display.

  5. For rafter length, enter the Building span, the full width from wall to wall.

  6. Add the Overhang for one side, measured horizontally from the wall.

  7. Enter the Roof pitch as an X:12 ratio and read the pitch angle in the adjacent field.

  8. Review the rafter length in the hero display, with span, half span, rise and pitch angle listed below.

 

How the Roof Truss Calculator Formula Works

The two modes use unrelated formulas. Truss count is a simple division with a rounding rule; rafter length is a right-triangle calculation that depends on the pitch angle.

Formula (Truss Count): Trusses = ⌈Roof Length ÷ On-center Spacing⌉ + 1 + Extra End Trusses

Formula (Pitch Angle): θ = atan(Pitch Ratio ÷ 12)

Formula (Rafter Length): Rafter = (Span ÷ 2 + Overhang) ÷ cos(θ)

Formula (Total Rise): Rise = (Span ÷ 2) × tan(θ)

Formula (Total Cost): Cost = Truss Count × (Material Cost + Install Cost if included)

In truss count mode, roof length and spacing must both be greater than zero, and the extra-truss field accepts zero. In rafter length mode, span must be positive, overhang is treated as zero if left blank or negative, and pitch must be greater than zero. The truss count always rounds up before adding the closing truss, since a partial bay is not buildable.

 

Worked Example

A carpenter is ordering trusses for a 15.5 m gable roof at 600 mm on-centre spacing, with one extra truss for a gable end detail. Each truss costs $155, and installation is quoted at $65 per truss.

  • Bays = ⌈15.5 ÷ 0.6⌉ = ⌈25.83⌉ = 26

  • Truss count = 26 + 1 + 1 = 28 trusses

  • Material cost = 28 × $155 = $4,340

  • Installation cost = 28 × $65 = $1,820

  • Total = $6,160

The takeaway: a 15.5 m roof at 600 mm centres requires 26 bays, which means 27 trusses to close both ends, plus one extra for the gable detail, 28 in total. The single closing truss is the most commonly forgotten line item in a manual count, and on this job it is worth $220 once installation is added.

Why Truss Count and Rafter Length Are Different Questions

A truss is a pre-engineered frame that spans from wall to wall, replacing both the rafters and the ceiling joists of a traditional cut roof. Because it is manufactured to order, the estimating question is quantity: how many units are needed at what spacing. A rafter, by contrast, is a single board cut on site, so the question is length: how far is it from the ridge to the eave along the slope. Both questions arise on almost every roof project, but they are answered with completely different arithmetic, which is why this calculator separates them into two modes.

Frequently Asked Questions

How do I calculate how many roof trusses I need?

Divide the roof length by the truss spacing, round up, then add one for the closing truss. A 12 m roof at 600 mm centres gives 20 bays and 21 trusses. Add any extra trusses for hips, valleys or gable ends.

 

What is the standard truss spacing for a house?

600 mm (24 inches) on centre is the most common residential spacing, with 400 mm (16 inches) used where snow loads are heavy or the roof covering is substantial. The truss manufacturer’s design specifies the maximum spacing, and it should not be exceeded.

 

Why does the calculator add one extra truss?

Because the division gives the number of spaces between trusses, not the trusses themselves. Two trusses create one bay, so a roof with 20 bays needs 21 trusses to close both ends. Omitting this step leaves the roof one truss short.

 

How do I work out rafter length from span and pitch?

Halve the span, add the overhang, and divide by the cosine of the pitch angle. For an 8 m span with a 400 mm overhang at a 6:12 pitch, that is (4.0 + 0.4) ÷ 0.8944 = 4.92 m.

 

What is the difference between span and half-span?

The span is the full width of the building from wall to wall. The half span is half that distance, measured from the wall to the ridge centreline on a symmetrical gable roof. Rafter length calculations use the half span, not the full span.

 

Does the calculator account for the ridge board?

No. The rafter length given is from the ridge centreline to the outer edge of the wall plate plus overhang. If your rafter butts against a ridge board rather than crossing the centreline, reduce the run by half the board’s thickness before cutting.

 

How much does a roof truss cost?

Prices vary widely by region, span and complexity, but residential trusses typically cost between $100 and $250 each in North America. Long spans, unusual shapes and high snow-load regions push the price higher. The calculator’s material cost field is editable so you can use your supplier’s quote.

 

Can I cut rafters instead of ordering trusses?

Yes, and on some projects it is cheaper, particularly for small or irregular roofs. Site-cut rafters require more labour and careful layout, but avoid the lead time and delivery constraints of manufactured trusses. The rafter length mode in this calculator supports that decision.

 

What pitch should I use for a truss roof?

Between 4:12 and 9:12 covers most residential roofs, with 6:12 the most common. Pitches below 4:12 restrict the roofing materials that can be used, and pitches above 9:12 increase cost and installation difficulty.

 

How do I account for the overhang in a rafter calculation?

Measure the horizontal projection of the overhang from the wall face, then divide it by the cosine of the pitch angle to get the sloped distance. Add that sloped figure to the rafter’s ridge-to-wall length.

 

Does the calculator include truss design or engineering?

No. It calculates the count and the layout dimensions only. Truss design, the member sizes, connection details and load capacity must be carried out by the truss manufacturer or a structural engineer.

 

Can I use this calculator for a hip roof?

The rafter length calculation applies to the common rafters of a hip roof, which are the same as the rafters of a gable. Hip rafters run diagonally to the corners and are longer, so they must be calculated separately. The truss count mode does not apply to hip roofs, which are usually stick-framed rather than trussed.

Disclaimer

This roof truss calculator provides a layout estimate based on the dimensions, spacing and pricing you enter. It does not perform structural design, does not verify truss span ratings or load capacities, and does not account for hips, valleys, dormers or other complex roof features. Trusses are engineered components and their specification must be confirmed by the truss manufacturer or a qualified engineer. Rafter lengths are geometric figures and do not include allowances for the birdsmouth notch, ridge board thickness or cutting tolerance. Always verify dimensions against the approved drawings and your local building code before ordering materials or cutting timber.

ADVERTISEMENT

ADVERTISEMENT