Four inches is a limit, not a spacing
The rule is that no opening in a guard may allow a 4 inch sphere to pass. It says nothing about how far apart to put balusters — it says how far apart you may not put them. So the count is whatever it takes to keep every gap under that on your bay with your balusters, and it is arithmetic rather than a rule of thumb.
Why "about five inches apart" fails
Because a bay is rarely a round number once the post is taken out of it. Six foot centres with 4x4 posts leaves 65.07 inches of actual opening, not 72 — and dividing that by a spacing you picked gives a fraction, which you then round the wrong way. The count above is derived from the limit and lands inside it every time.
Balusters per bay, 4x4 posts
| Bay | ¾ in balusters | 1½ in balusters | 3½ in balusters | Clear span |
|---|---|---|---|---|
| 4 ft bay | 9 at 3.78 in | 8 at 3.61 in | 6 at 3.36 in | 44.5 in |
| 5 ft bay | 12 at 3.65 in | 10 at 3.77 in | 8 at 3.17 in | 56.5 in |
| 6 ft bay | 14 at 3.87 in | 12 at 3.88 in | 9 at 3.7 in | 68.5 in |
| 8 ft bay | 19 at 3.91 in | 17 at 3.72 in | 12 at 3.88 in | 92.5 in |
From this calculator against the IRC's four inch sphere. Every figure is the smallest count that keeps the gaps legal — one fewer fails in every case.
Two heights, measured from two places
A guard on a deck, balcony or landing is at least 36 inches above the walking surface. A guard on the open side of a stair is at least 34 inches, measured vertically from a line drawn through the tread nosings. Those are different numbers from different references, which is why a guard running down a flight does not simply carry on at the same height as the one on the deck.
The stairs are a different calculation
Two rules change on a raking guard: the infill may not pass a 4.375 inch sphere rather than a 4 inch one, and the triangular opening between the tread, the riser and the bottom rail may not pass a 6 inch sphere. The geometry of a sloped bay is not the geometry of a level one, so this tool does level runs and tells you the stair figures rather than quietly applying the wrong ones.
Post spacing is not ours to give
What a guard post can span depends on the guard load the code requires, on how the post connects to the deck frame, and on your jurisdiction. It is also the part of a railing that actually fails, and it fails by putting somebody over an edge. So it is an input here with no suggestion attached. Take it from a prescriptive table for your deck or from whoever designed it — then this page will count everything that hangs off it.
What governs is your adopted code
These are the IRC's figures and they have been stable across recent editions, but the edition your building department has adopted is the one that applies, amendments are common, and commercial work follows a different code entirely. Check before you cut.
The rest of the deck
The deck board calculator counts the decking with the gap between boards handled properly, and the deck stain calculator works the finish from published coverage — including the spindles, which are most of the surface area on a railing. Underneath, footings and the post depth calculator cover what holds it up, and where the deck has to meet a ramp the wheelchair ramp calculator handles the ADA slope. For the framing itself, the wall framing calculator does the same bays-plus-one arithmetic this page does.