StatGardenREF. DESK
Calculators/Home & build/Baluster / spindle spacing
Home & build

Baluster / spindle spacing calculator

Even spindle count and gap for a stair or deck railing.

Published 6 August 2026 · Updated 25 September 2026

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

FormulaSpindles = ⌊rail length / (spindle width + max gap)⌋; actual gap = (length − spindles × width) / (spindles + 1)

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.

TermMeaning
BalusterA vertical spindle in a railing. Also called a picket or spindle.
Maximum gapUsually 100 mm, set by the four inch sphere rule in most building codes.
Centre-to-centreSpindle width plus one gap, which is the setting-out dimension.
Four inch sphere ruleThe test behind the limit: a 100 mm sphere must not pass through any opening.

The inputs explained

FieldWhat 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.

300 cm railing, 4 cm spindles
Maximum allowed gapNumber of spindlesActual gap between spindlesCentre-to-centre spacing
8 cm257.69 cm11.69 cm
10 cm219.82 cm13.82 cm
12 cm1812.00 cm16.00 cm
The actual gap always comes out at or below the maximum, never above, because the count rounds up to guarantee compliance. At a 10 cm maximum the actual is 9.82 cm, so the last row is the only one where the two coincide exactly at 12.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.