Calculate how many roof trusses you need from roof length and on-center spacing, plus reverse-solve the spacing, max roof length, and truss cost.
Roof Truss Count Formula
The calculator works in three directions. To find how many trusses a roof needs, it divides the roof length by the on-center spacing, rounds that up, and adds one:
N = roundup(L / S) + 1
To find the spacing that a set number of trusses will sit at, it rearranges the same relationship:
S = L / (N - 1)
To find the longest roof a set number of trusses can cover, it multiplies the number of gaps by the spacing:
L = (N - 1) * S
Variables:
- N is the number of trusses
- L is the roof length measured along the ridge, in the direction the trusses repeat
- S is the on-center (OC) spacing, the distance between the centers of two neighboring trusses
- roundup means round the division up to the next whole number, because any leftover distance still needs a truss over it
- the plus one adds the truss that sits at the far end, since a truss sits at both ends of the roof
Pick what you want to find at the top of the calculator. In “Number of trusses needed” mode you enter the roof length and the OC spacing and get the truss count, with optional fields for extra trusses (gable, hip, or girder) and cost. In “On-center spacing” mode you enter the roof length and a truss count and get the spacing those trusses land at, which is useful when the number of trusses is fixed by a delivery or budget. In “Max roof length covered” mode you enter a truss count and a spacing and get the longest roof they cover. Keep L and S in the same units; the calculator converts feet, meters, inches, and centimeters for you.
Trusses Needed by Roof Length and Spacing
This table shows the truss count for common roof lengths at the four standard on-center spacings, using the formula above. Closer spacing carries more load but adds trusses and cost. Use it as a quick check before you calculate.
| Roof length | 24 in OC | 19.2 in OC | 16 in OC | 12 in OC |
|---|---|---|---|---|
| 10 ft | 6 | 8 | 9 | 11 |
| 20 ft | 11 | 14 | 16 | 21 |
| 24 ft | 13 | 16 | 19 | 25 |
| 30 ft | 16 | 20 | 24 | 31 |
| 40 ft | 21 | 26 | 31 | 41 |
| 50 ft | 26 | 33 | 39 | 51 |
| 60 ft | 31 | 39 | 46 | 61 |
Once you know the count, this table gives 2026 price ranges so you can turn the count into a budget. Multiply your truss count by the material cost, then add the install labor per truss. Steel trusses are priced separately because they do not scale the same way with span.
| Truss span | Material cost each | Install labor each |
|---|---|---|
| Up to 20 ft (wood) | $65 to $130 | $40 to $60 |
| 20 to 28 ft (wood) | $90 to $175 | $40 to $60 |
| 28 to 36 ft (wood) | $140 to $270 | $45 to $65 |
| 36 to 44 ft (wood) | $200 to $380 | $50 to $75 |
| Any span (steel) | $150 to $700 | Varies |
Whole-roof installed cost commonly lands between $5 and $14 per square foot of roof. These are 2026 estimates and change with region, lumber prices, truss type, and roof complexity.
Example Problems
Example 1: Count trusses from roof length.
Your roof is 36 ft long and you are framing at 24 in on center. Divide the length by the spacing, round up, and add one:
N = roundup(36 * 12 / 24) + 1 = roundup(18) + 1 = 19 trusses. At a wood material cost of $180 each that is about $3,420 in trusses, plus roughly $950 in labor at $50 each, for about $4,370 before extras.
Example 2: Find the spacing for a fixed truss count.
You have 17 trusses to cover a 32 ft roof and want to know the spacing. There are 16 gaps between 17 trusses, so divide the length by the gaps:
S = (32 * 12) / (17 – 1) = 384 / 16 = 24 in on center. That falls right on the standard maximum, so the layout works without adding trusses.
Frequently Asked Questions
How many trusses do I need for a 40 foot roof?
At the standard 24 in on-center spacing you need 21 trusses, because 40 ft is 480 inches, 480 divided by 24 is 20, and adding the end truss gives 21. If you tighten the spacing to 16 in for a heavier load you need 31 trusses over the same 40 ft.
Why does the formula add one truss?
Dividing the roof length by the spacing counts the gaps between trusses, not the trusses themselves. A row of trusses always has one more member than the number of gaps, because a truss sits at both ends of the roof. That is why you round the division up and then add one.
Can roof trusses be spaced more than 24 inches apart?
For engineered residential trusses, 24 in on center is the usual maximum and the most economical spacing. Wider spacing is possible only with a specific engineered design and heavier roof sheathing to span the gap. Closer spacings of 16 in or 12 in are used for higher snow, wind, or roof loads. Confirm the final spacing with the truss manufacturer and your local code.
