Baluster Spacing Calculator
Calculate how many balusters fit between two railing posts and the exact gap and on-center spacing that keeps every opening under the 4 in code limit.
By CalcBuilt Editorial TeamUpdated September 9, 2026Formulas checked against manufacturer specs, see how we calculate.
Results
- Balusters
- 13 balusters
- 1.5 in wide, laid out so no gap exceeds 4 in
- Actual gap
- 3.75 in
- 14 equal gaps including one at each post. Planning estimate; local code and the inspector govern.
- On-center spacing
- 5.25 in
- Baluster width plus one gap; mark the rail at this interval
- First baluster center
- 4.5 in
- From the post face: one full 3.75 in gap plus half the baluster width, then every 5.25 in
Baluster Spacing formula
Balusters = (Opening - max gap) / (baluster width + max gap), rounded up
Actual gap = (Opening - Balusters x baluster width) / (Balusters + 1)
On-center spacing = baluster width + actual gap
First baluster center = actual gap + baluster width / 2 (half gap option: actual gap / 2 + baluster width / 2)Worked example
A deck rail section with a 54 in opening between posts, 1.25 in square metal balusters and the 4 in maximum gap: 54 - 4 = 50, and 50 / (1.25 + 4) = 9.52, so 10 balusters. Actual gap = (54 - 10 x 1.25) / 11 = 41.5 / 11 = 3.77 in, and the on-center spacing is 1.25 + 3.77 = 5.02 in.
Mark the first baluster center 3.77 + 0.625 = 4.40 in from the post face, then every 5.02 in after that. The last gap lands at 3.77 in against the far post.
Quick reference
| Opening | Balusters | Actual gap | On center |
|---|---|---|---|
| 36 in | 6 | 3.86 in | 5.36 in |
| 48 in | 8 | 4.00 in | 5.50 in |
| 60 in | 11 | 3.63 in | 5.13 in |
| 72 in | 13 | 3.75 in | 5.25 in |
| 96 in | 17 | 3.92 in | 5.42 in |
How to space balusters evenly
Measure the clear opening between the posts, not the post centers. Subtract one maximum gap, divide by the baluster width plus that gap, and round up. That is the fewest balusters that keep every opening under the limit. Then divide the space left over (opening minus all the baluster widths) by the number of gaps, which is one more than the balusters. Every gap comes out the same and a little under the maximum.
Lay out from one post: the first baluster center sits one gap plus half a baluster from the post face, and every center after it is one baluster width plus one gap further along. Mark the top and bottom rails together with a story pole so the balusters stay plumb.
Layout choices and code
The full-gap layout puts the same gap at the posts as between balusters and is what inspectors expect to see. The half-gap option puts half a gap at each post, which is common when balusters are centered on a repeating pattern that continues across several sections, or when the rail sections are prebuilt.
The 4 in sphere rule applies to every opening in the guard, including under the bottom rail. Measure the actual balusters before laying out; a nominal 2x2 is 1.5 in, but turned and metal balusters vary. This calculator is for planning; local code and the inspector have the final say on guard height and openings.
Key facts
- The IRC requires that no opening in a guard allow a 4 in sphere to pass; the IBC uses the same limit for most occupancies.
- Residential guards must be at least 36 in tall wherever the drop to the surface below is more than 30 in; commercial guards are 42 in.
- A 2x2 wood baluster is 1.5 in square, so at the 4 in maximum gap balusters land no more than 5.5 in on center.
- The triangle formed by a stair tread, riser and bottom rail may not pass a 6 in sphere.
- Wood shrinks as it dries, so a layout that starts at exactly 4 in can fail inspection later; aim for 3.5 to 3.75 in.
Frequently asked questions
How many balusters do I need for a 6 ft railing section?
With 1.5 in balusters and a 4 in maximum gap, a 72 in opening between posts needs 13 balusters at 5.25 in on center with a 3.75 in gap.
What is the maximum space between balusters?
Under the IRC, no opening in a guard may let a 4 in sphere pass. Most builders lay out at 3.5 to 3.75 in so the balusters still pass once the wood dries and shrinks.
How do I space balusters evenly between posts?
Subtract one maximum gap from the opening, divide by the baluster width plus the gap, round up for the count, then divide the leftover space by the number of gaps (balusters plus one). Every gap will be equal and under the limit.
Do the gaps next to the posts have to match the others?
No. Code only requires that every gap stays under 4 in. Equal gaps look best on a single section; a half gap at the posts suits a pattern that repeats across many sections.
Sources and references
Next steps for this project
- Post Holes
- Floor Joists
- Deck
- Stairs
- Baluster Spacing
- Fence
- Board feet
The usual order for a framing, decks & fences project. See all framing, decks & fences calculators.
Results are estimates based on standard formulas and typical product specifications. Confirm quantities with your supplier and local code before ordering.