Deck railing calculator
Posts, rails and balusters, spaced so a 4 in sphere cannot pass — with margin, so site tolerance cannot push you over.
Railing
| Item | Qty | Unit |
|---|---|---|
| Guard posts Posts at no more than 6 ft apart on each open run (12 ft, 16 ft, 9 ft), plus one to close each run, less 2 shared corner posts = 8. | 8 | each |
| Top and bottom rails 37.0 ft of guard, with a top and a bottom rail: 37.0 x 2. | 74 | linear ft |
| 2x2 balusters A 4 in sphere must not pass through the guard (IRC R312.1.3). With 1.50 in balusters and a 3.75 in design gap, they sit 5.25 in on centre: 444 in of guard / 5.25 = 85. | 85 | each |
How this calculator works
The 4 inch sphere rule
IRC R312.1.3 says a 4 in sphere must not pass through any opening in a guard. Designing to exactly 4 in leaves no room for error: a baluster set a sixteenth of an inch off puts the whole run out of compliance. This calculator designs to a 3.75 in gap so ordinary site tolerance cannot fail the inspection.
Corner posts are shared
Two runs of railing that meet at a corner share one post. Counting each run independently and adding the totals double-counts every corner. On an attached deck that is two posts of overcount; on a freestanding deck, four.
The stair opening is not railed
Where stairs leave the deck, that width is an opening in the guard, not a run of it. Subtracting the stair width from the perimeter before counting posts and balusters is the difference between a materials list and a guess.
When a guard is required at all
IRC R312.1.1 requires a guard once the walking surface is more than 30 in above grade. Below that a railing is optional, and plenty of low decks are built without one. If your deck is under the threshold this calculator will tell you, and still count the materials if you want one anyway.
What we will not guess
Joist and beam span limits are structural-safety data. Until our span tables are verified line by line against the published AWC DCA6 tables, this site withholds them and says so, rather than printing a number that looks authoritative. Footing depth must reach below your local frost line, which varies from nothing in the far south to over eight feet in the far north. Confirm both with your local building department — see our methodology.
Other calculators
- Deck material calculator Tell us the deck you want. You get every board, fastener and footing it needs — and the reasoning behind each number, so you can check our working.
- Decking board calculator How many boards, and how many linear feet. Counting the gap between them, because that gap is coverage.
- Deck framing calculator Joists, blocking, rim, ledger and hangers — counted from the frame geometry rather than a rule of thumb.
- Deck stair calculator Risers, treads, stringers and total run — with every riser held inside the 7.75 in code limit.