This baluster spacing helper lays out the balusters (spindles) in a railing so the gaps are even and meet the safety rule that a small child cannot pass through. It returns the number of balusters, the exact gap, and the position of each one along the rail.
The four-inch sphere rule
Most building codes require that a 4-inch (100 mm) sphere cannot pass through any opening in a guard, to stop a child slipping through or becoming trapped. That sets the maximum clear gap between balusters. The helper takes the rail span, the baluster width, and your target maximum gap, then finds the smallest number of balusters that keeps every gap — including the two end gaps against the posts — within the limit and equal to each other.
Because the balusters have width, the clear gap is not simply the span divided by the count. The calculator subtracts the combined width of the balusters from the span and divides the remaining space into equal openings, which is what keeps the layout both legal and good-looking.
Even gaps, every time
Uneven end gaps are the giveaway of a rushed railing. Measuring each baluster position from one post (a single datum) rather than from the previous baluster keeps the spacing exact across the whole run. Always confirm the exact requirement with your local code, as the maximum opening and rail height can vary by jurisdiction.
A 1500 mm clear span between posts uses 32 mm square balusters, with gaps to stay under 100 mm.
- Try 12 balusters: total baluster width = 12 × 32 = 384 mm.
- Remaining space = 1500 − 384 = 1116 mm, divided into 13 gaps = ~86 mm each.
- 86 mm is under the 100 mm limit, so 12 balusters works.
Use 12 balusters for even ~86 mm gaps that satisfy the 100 mm rule.