This truss calculator estimates rafter (top chord) length and truss count for standard gable roof framing. Use it to plan materials before requesting a supplier quote or building your own trusses for a shed, garage, or house.
- Choose your calculation mode. Select "Rafter length" if you only need the top chord dimension. Select "Truss count and cost" to also estimate how many trusses you need and get an optional budget number.
- Enter your roof run, which is the horizontal distance from the outside wall line to the ridge center. For a symmetric gable, this is half the building span. A common mistake is entering the full building width, which doubles your calculated rafter length.
- Pick whether you want to enter rise in feet or pitch as X:12. A 6:12 pitch means 6 inches of rise per 12 inches of run. If you know the total rise to the ridge, use the rise option instead.
- For truss count mode, enter your roof length (usually the building length) and planned on center spacing. Most residential roofs use 24 in OC, while heavier loads or longer spans may need 16 in OC.
- Add optional cost per truss and labor rate if you want a rough budget estimate. Leave these at zero to skip cost output.
- Click "Calculate trusses" for your results.
Pro tip: Always measure horizontal run from the wall plate line to the ridge, not along the sloped roof surface. Measuring the slope gives you a longer number that overestimates rafter length and truss size. Run both 16 in and 24 in spacing through the truss calculator before finalizing your order, because the truss count can jump by 10 units on a 40 ft roof.
Common truss spacing reference
Use this table to pick on center spacing based on your project type. The truss calculator compares your chosen spacing against standard options automatically.
| Spacing | Typical use | Trusses per 40 ft roof |
|---|---|---|
| 16 in OC | Heavy snow loads, longer spans, tile roofs | 31 |
| 24 in OC | Standard residential shingle roofs | 21 |
| 48 in OC | Pole barns, agricultural buildings | 11 |