The 4-inch rule
Residential code (IRC R312.1.3) says a 4-inch sphere must not pass through any opening in a guard. In practice that means every gap between balusters — and between the end baluster and the post — must be under 4 inches. Many builders aim for about 3 1/2 inches so wood shrinkage never pushes a gap over.
How to space balusters evenly
With n balusters between two posts there are n + 1 gaps. So: number of balusters = (space − max gap) ÷ (baluster width + max gap), rounded up. Then the exact gap is (space − balusters x width) ÷ (balusters + 1).
Example: 72" between posts with 1 1/2" balusters and a 3 1/2" maximum gap: (72 − 3.5) ÷ 5 = 13.7, so 14 balusters. The gap is (72 − 21) ÷ 15 = 3.4". Every gap, including the two at the posts, is the same.
Guard height
Decks and stairs with more than a 30" drop need a guard at least 36" tall under the residential code; some towns require 42". Check locally before you buy balusters, since they're sold by length.
Need the stairs too? Try the stair calculator.
Sources
- IRC 2021 Section R312 Guards and Window Fall Protection — International Code Council