What this calculator does
Baluster spacing is driven by a safety maximum rather than by appearance. A 300 cm railing with 4 cm spindles and a 10 cm maximum gap takes 21 spindles at an actual gap of 9.82 cm.
The rule behind the maximum is the four inch sphere test: no gap in a guard should allow a 100 mm sphere to pass, because a small child could otherwise get their head through. That is why the calculation rounds the count up rather than down, and why the actual gap always comes out at or below the maximum rather than near it.
The formula
The spindle count is the railing length divided by the spindle width plus the maximum gap, rounded down, which guarantees the resulting gap cannot exceed the maximum. The actual gap is then the leftover length distributed evenly across the one more gap than there are spindles, since there is a gap at each end as well as between.
| Term | Meaning |
|---|---|
| Baluster | A vertical spindle in a railing. Also called a picket or spindle. |
| Maximum gap | Usually 100 mm, set by the four inch sphere rule in most building codes. |
| Centre-to-centre | Spindle width plus one gap, which is the setting-out dimension. |
| Four inch sphere rule | The test behind the limit: a 100 mm sphere must not pass through any opening. |
The inputs explained
| Field | What to enter |
|---|---|
| Railing length (cm) | Railing length in centimetres, measured between the posts. |
| Spindle width (cm) | Spindle width. |
| Maximum allowed gap (cm) | Maximum allowed gap. Check your local building code; 100 mm is the common figure. |
When to use it
Building a deck railing
Getting the gap under the code maximum is a compliance requirement, not a preference.
Replacing stair spindles
Matching the original count and spacing keeps the look consistent.
Setting out evenly
The centre-to-centre figure is what you mark on the rail before fixing anything.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How does the maximum gap change the count?
The same railing at a range of maximum gaps.
| Maximum allowed gap | Number of spindles | Actual gap between spindles | Centre-to-centre spacing |
|---|---|---|---|
| 8 cm | 25 | 7.69 cm | 11.69 cm |
| 10 cm | 21 | 9.82 cm | 13.82 cm |
| 12 cm | 18 | 12.00 cm | 16.00 cm |
Questions
What is the maximum gap between balusters?
Commonly 100 mm, or four inches, in most building codes. The limit comes from the four inch sphere test: no opening in a guard should let a 100 mm sphere pass. Check your local requirement, since some jurisdictions are stricter.
Why is the actual gap less than the maximum?
Because the spindle count rounds up to guarantee the gap stays legal. Rounding down would give a gap above the maximum. The leftover length is then shared evenly, which usually puts the actual gap slightly below the limit.
Do I count a gap at each end?
Yes. With n spindles between two posts there are n plus one gaps, counting the space at each end against the posts. This is why the calculation divides by the count plus one rather than by the count.
Does this apply to horizontal railings?
The gap rule does, but many codes restrict or prohibit horizontal members in guards because they are climbable by children. Check the requirement before designing a horizontal rail, particularly around a deck or balcony.
For the staircase itself, see the stair calculator. For an alternative spacing method, see the picket spacing calculator.