Deck Railing & Baluster Spacing Calculator
Lay out your deck railing so the baluster gaps are even AND code-legal. Enter your railing length and post spacing and the calculator solves the baluster count and the exact even gap that keeps a 4-inch sphere out (IRC R312).
Balusters
91
13 per section
Even gap
3.26″
passes (< 4″)
Railing layout
Rail sections7
Rail posts8
Clear span per section65.1″
Guard height (R312)36″ min
Even gap = (section clear − balusters × width) ÷ (balusters + 1). Code requires the gap to reject a 4″ sphere (IRC R312.1.3); 3½″ is the safe build target. Guards are 36″ min on residential decks.
Deck Railing & Baluster — what to know
- •The code test is a 4" sphere: the clear gap between balusters (and between a baluster and a post) must be under 4". Build to 3½" so you're never on the line at inspection.
- •Residential deck guards must be at least 36" tall, measured from the deck surface to the top of the rail.
- •Even spacing = (section clear width − total baluster width) ÷ (number of gaps). The calculator does this per section so every bay matches.
Want a permit-ready deck plan?
This estimate is built for planning. For your permit packet, DeckCalc HQ Pro turns these numbers into a stamped framing plan, footing schedule and material list as a printable PDF.
See Pro →