Understanding the baluster spacing calculator — concept and principle
This calculator works out how many balusters (spindles) you need between two posts so that every gap is equal and smaller than a safety limit, usually 4 inches. Deck and stair builders use it to lay out railings that meet code and look even.
How it is calculated
Number of balusters n = ⌊(L − limit) ÷ (w + limit)⌋ + 1
Gap = (L − n × w) ÷ (n + 1)
Centre-to-centre spacing = gap + w
First baluster centre from the post = gap + w ÷ 2
- L is the clear length between posts, w the baluster width, limit the largest gap allowed.
The principle
With n balusters between two posts there are n + 1 gaps. The total length is n balusters plus n + 1 gaps, so solving for the gap gives the formula. The calculator picks the smallest n that makes the gap strictly less than the limit. The US International Residential Code (R312.1.3) requires that a 4-inch sphere cannot pass through a required guard, which protects small children from slipping through.
Worked example
Default inputs: 72 in between posts, 1.5 in balusters, 4 in limit, 4 sections.
- n = ⌊(72 − 4) ÷ (1.5 + 4)⌋ + 1 = ⌊12.36⌋ + 1 = 13 per section.
- Gap = (72 − 13 × 1.5) ÷ 14 = 52.5 ÷ 14 = 3.75 in (95 mm).
- Centre-to-centre = 3.75 + 1.5 = 5.25 in; first centre = 3.75 + 0.75 = 4.5 in from the post.
- Total = 13 × 4 = 52 balusters.
| Clear length between posts (in) | Balusters per section |
|---|---|
| 18 | 3 |
| 36 | 6 |
| 54 | 10 |
| 72 | 13 |
| 90 | 16 |
| 108 | 19 |
| 144 | 26 |
How to read the result
Mark the first centre from one post, then step along at the centre-to-centre spacing; the last gap should match. Check the gap with a 4-inch block. Different rules apply to the triangle under a stair rail and in other countries.
Common mistakes
- Measuring post centre to post centre instead of the clear length between posts.
- Making the gap exactly 4 in; it must be less.
- Forgetting that square balusters turned diagonally take more space.
Frequently asked questions
What is the maximum baluster gap?
Under the US IRC, a 4-inch sphere must not pass, so gaps must be under 4 in.
How many balusters per foot?
With 1.5 in balusters and gaps just under 4 in, roughly 2 per foot.
Should I start at a post or at the centre?
Either works if gaps are equal; centring a baluster or a gap can look better on short sections.
Sources: International Code Council, 2021 International Residential Code, Section R312.1.3 "Opening limitations"