Baluster Spacing Calculator
How many balusters a railing section needs, the equal gap between them, and where to mark each one, with every gap kept under the code sphere.
Worked example: edit any value
Baluster spacing
Clear span 6 ft 0 in
Gaps are kept below the 4 in sphere (IRC 2024 R321.1.3). Measure the finished gaps after installing; bowed balusters and loose rails change them.
Marks from the left post
| Baluster | Centre from left post | Left edge |
|---|---|---|
| 1 | 4 1/2 in | 3 3/4 in |
| 2 | 9 3/4 in | 9 in |
| 3 | 15 in | 14 1/4 in |
| 4 | 20 1/4 in | 19 1/2 in |
| 5 | 25 1/2 in | 24 3/4 in |
| 6 | 30 3/4 in | 30 in |
| 7 | 36 in | 35 1/4 in |
| 8 | 41 1/4 in | 40 1/2 in |
| 9 | 46 1/2 in | 45 3/4 in |
| 10 | 51 3/4 in | 51 in |
| 11 | 57 in | 56 1/4 in |
| 12 | 62 1/4 in | 61 1/2 in |
| 13 | 67 1/2 in | 66 3/4 in |
How this result was calculated
- Fewest balusters that keep every gap below the limit
n = ⌊(S − D) ÷ (b + D)⌋ + 1 = ⌊(72 − 4) ÷ (1.5 + 4)⌋ + 1 = 13A gap exactly equal to the sphere would let it through, so the gap must be strictly smaller. - Equal gaps
gap = (S − n·b) ÷ (n + 1) = (72 − 13 × 1.5) ÷ 14 = 3.75 in - Marking out
first centre = gap + b/2 = 4.5 in; then every 5.25 inMark every centre from the same post face (table above) so rounding does not add up.
All values (table)
| Item | Value | Note |
|---|---|---|
| Clear span (horizontal) | 6 ft 0 in | Post face to post face |
| Balusters | 13 | |
| Gap | 3 3/4 in | limit 4 in |
| On-centre spacing | 5 1/4 in | gap + baluster width |
| Baluster width | 1 1/2 in |
The sphere rule
Codes do not give a baluster spacing; they give a test. Under the IRC, required guards must not let a 4 in sphere pass through any opening, with two exceptions: 4 3/8 in on the open side of a stair, and 6 in for the triangle formed by a riser, tread and bottom rail (2024 R321.1.3; R312.1.3 in 2021). A gap exactly the size of the sphere fails, so the calculator keeps every gap strictly smaller.
Equal gaps look right and are easy to mark. With n balusters there are n + 1 gaps, and the calculator picks the smallest n that brings the gap under the limit.
Worked example
A 72 in section between posts with 1 1/2 in balusters on a deck:
- n = ⌊(72 − 4) ÷ (1.5 + 4)⌋ + 1 = ⌊12.36⌋ + 1 = 13 balusters.
- Gap = (72 − 13 × 1.5) ÷ 14 = 3.75 in; on centre 5.25 in; first centre 4.5 in from the post.
- On the open side of a stair, a 66 in horizontal span needs 11 balusters with 4.125 in gaps under the 4 3/8 in rule.
These are automated test fixtures, with a property test that one fewer baluster would always break the limit.
On a stair rail
Vertical balusters on a sloping rail are spaced horizontally, so measure the horizontal distance between posts, or enter the length along the rail and the stair angle (from the stair angle calculator) and the tool converts it. Many builders put two balusters on each tread; check that the gaps still pass with your tread depth.
Questions people ask
How far should balusters be apart?
Close enough that a 4 in sphere cannot pass between them, which in practice means gaps a little under 4 in. On the open side of a stair the IRC allows a 4 3/8 in sphere (2024 R321.1.3). With 1 1/2 in balusters, gaps under 4 in work out to just under 5 1/2 in on centre; the calculator finds the exact equal spacing for your span.
What is the 4 ball rule for railing?
It is shorthand for the code test: a 4 in diameter ball (sphere) must not pass through any opening in a required guard, from the walking surface up to the guard height (IRC 2024 R321.1.3). It exists so small children cannot slip through. Two exceptions: 4 3/8 in on the open side of stairs, and 6 in for the triangle formed by a riser, tread and bottom rail.
How many balusters do I need for a 12x12 deck?
It depends on how many sides have railing and where the posts are. One example: a 12 ft side with 3 1/2 in posts only at the corners leaves 137 in clear, which needs 25 balusters of 1 1/2 in for gaps under 4 in (3.83 in each). Three such sides would be 75. Most decks add mid-span posts, which changes the count, so enter each section separately.
Related tools and guides
- Deck Stair Calculator Deck height, sloping ground, landing pad and board treads, with landing distance.
- Stair Angle Calculator Angle, grade and pitch from rise and run, or the run needed for a target angle.
- Stair code requirements Which rulebook covers which stair, with edition-correct section numbers.
- Stair Calculator Risers, treads, total run, angle and a to-scale side view from one height.