Baluster spacing calculator
Enter the rail length between two posts and this spaces the balusters so no gap passes a 4 inch sphere, the IRC guard rule: how many you need and the even gap between them. It is the same math the CutOnce app runs on deck and stair rails.
Updated
The short answer
Space balusters so no clear gap is more than 4 inches (IRC R312.1.3, the 4 inch sphere rule). Take the rail length between posts, divide by the baluster width plus 4, and round up for the count. Then spread that many evenly, and the actual gap comes out at or below 4 inches.
The 4 inch sphere rule
Guards on decks, balconies, and stairs have to stop a 4 inch sphere from passing through, so a small child cannot slip between the balusters. That is the clear gap, the open space, not the center-to-center spacing, so a fatter baluster eats into the gap and a thinner one opens it up. The rule is why baluster spacing is never just 'divide the rail evenly': you size the count so the widest gap stays under 4 inches, then even it out.
How the spacing works
Two steps. First the count: the rail length divided by one baluster width plus the 4 inch max gap, rounded up, so every gap stays at or under 4 inches. Second the even gap: with that many balusters set in the rail, the leftover space splits into one more gap than there are balusters (the two ends to the posts count), so the gap is the rail length minus all the baluster widths, divided by the count plus one. It always lands at or under 4 inches.
A worked example
A 6 ft (72 in) rail between posts, in 1.5 in square balusters. Here is the count and the gap, and where each number comes from.
| Rail length | 72 in | given (post to post) |
| Baluster width | 1.5 in | given (1.5 in square) |
| Balusters | 14 | ceil(72 / (1.5 + 4)) |
| Even gap | 3.40 in | (72 - count x 1.5) / (count + 1) |
| Center to center | 4.90 in | gap + baluster width |
Common rail lengths
Balusters and the even gap for typical rail sections in 1.5 in balusters at the 4 in code limit. Wider balusters need more of them; a longer rail opens the gap until the next baluster is added.
| Rail length | Balusters | Even gap |
|---|---|---|
| 36 in (3 ft) | 7 | 3.19 in |
| 48 in (4 ft) | 9 | 3.45 in |
| 60 in (5 ft) | 11 | 3.63 in |
| 72 in (6 ft) | 14 | 3.40 in |
| 96 in (8 ft) | 18 | 3.63 in |
Deck rail versus stair rail
On a level deck rail the balusters are plumb and evenly spaced along the rail, which is what this calculator lays out. On a raking stair rail the balusters follow the slope, and the code still measures the 4 inch sphere on the diagonal, so the along-the-rail spacing is a hair tighter than the level run underneath it. The app lays out both, and puts one or two balusters on every tread with the run measured along the nosing line.
Common questions
- How far apart can balusters be?
- No more than 4 inches of clear gap, under IRC R312.1.3. That is the open space between balusters, measured so a 4 inch sphere cannot pass. It applies to any guard more than 30 inches above the ground, which covers most deck and stair rails.
- How many balusters do I need for a 6 foot railing?
- Fourteen, in 1.5 inch balusters at the 4 inch code gap, spaced about 3.4 inches apart. A 6 foot rail is 72 inches; 72 divided by (1.5 + 4) is 13.1, which rounds up to 14 so the gap stays legal. Wider balusters or a tighter target gap raise the count.
- Is the 4 inches center to center or the gap?
- The gap, the clear opening between balusters. Center-to-center spacing is the gap plus one baluster width, so with 1.5 inch balusters a 4 inch gap is 5.5 inches center to center. Sizing on center-to-center instead of the clear gap is the most common way a rail fails inspection.
- Do the end gaps to the posts count?
- Yes, and this calculator includes them. The balusters split the rail into one more gap than there are balusters, so a rail with 14 balusters has 15 gaps, counting the two at the posts. Keeping the end gaps equal to the field gaps is what makes the run look even.
- What if I want a tighter look than the code minimum?
- Set a smaller max gap and the count goes up. The 4 inch rule is a maximum, not a target; plenty of builders run 3 or 3.5 inches for a tighter, more finished look, especially with thin metal balusters. Enter your target gap and the calculator sizes the count to hit it.
Space the rail, frame the whole thing
CutOnce spaces the balusters like this page, on level rails and up raking stairs, and it frames the rest: the deck, the stringers, the posts, with a printable rail elevation showing every baluster placed.
Free to download, with a 7-day trial of everything. The web calculator is the teaser; the app draws the rail.
See also
