The 4-inch sphere rule
Building code requires railing balusters spaced so a <strong>4-inch sphere cannot pass between them</strong> — it's a child-safety rule that drives the whole calculation. Enter the rail length, your baluster width and the on-center spacing you want; the calculator returns the count that keeps every gap legal.
Count ends, not just middles
Balusters run between newel posts, so measure each rail segment separately and add the segments together — long runs with mid-posts need the per-segment counts summed. Buy 5% extra: one cracked baluster on installation day otherwise means another store run.