How to Space Balusters Evenly
The exact method for laying out balusters so the gaps are equal, the ends look intentional, and no point in the railing passes a 4-inch sphere.
The one rule that governs everything: the 4-inch sphere
Guard infill exists to keep a small child from slipping through. Code states the gap must be small enough that a 4″ sphere cannot pass anywhere in the railing (IRC R312.1.3). That is a maximum, not a target — 4″ sphere means your clear gap between balusters must stay under 4″, and most builders aim for 3¾″ to leave a safety margin and absorb material variation.
On the open side of a stair, the triangle formed at each tread by the bottom rail, the riser, and the tread uses a slightly larger 6″ sphere, but the vertical baluster gaps along the rail still follow the 4″ rule. Solve the spacing once with the baluster spacing calculator, then use the layout below to mark it.
Why you cannot just eyeball it
The trap is that the number of gaps is one more than the number of balusters between the posts. If you divide the rail length by the gap you want and forget that, you end up one spindle short and the end gaps blow past 4″. The clean way is to solve for a whole number of balusters first, then back out the exact equal gap — which is precisely what the calculator does.
Worked example: a 6′ clear span between newel posts with 1½″ square balusters. Treat each baluster plus one gap as a repeating unit. If you place 17 balusters, they occupy 17 × 1½″ = 25½″ of the span, leaving 46½″ split across 18 gaps — about 2⁹⁄₁₆″ each, comfortably under 4″. Drop to 12 balusters and the gaps open to roughly 4¹⁄₈″, which fails. The calculator finds the smallest count that keeps every gap legal.
Step 1 — Measure the real clear span
Measure the inside-to-inside distance between the two posts (or wall returns) that bound this section of railing, not the overall rail length. The posts themselves are not part of the spacing problem; only the open span between them gets divided into balusters and gaps, so measuring post-to-post centers will throw the count off.
Take the measurement at the height the balusters actually attach, because posts are rarely perfectly plumb and the span can differ by an eighth of an inch or more between the top rail and the bottom shoe. Note the baluster width too — square, round, and turned spindles all have different effective widths, and a turned baluster is measured at its widest point because that is what governs the clear gap on either side.
Step 2 — Solve for count and gap
- Decide your maximum gap — use 3¾″ for margin, not the bare 4″ limit.
- Enter the clear span and baluster width into the baluster spacing calculator.
- It returns the minimum number of balusters and the exact equal gap (and the center-to-center spacing) that keeps the railing under the sphere rule.
Step 3 — Lay out center-to-center, working from the middle
The most foolproof layout uses center-to-center spacing rather than measuring gap-by-gap, because measuring gaps lets tiny errors stack up across the run — by the far post a string of "close enough" gaps can add up to one obviously wrong gap. The center-to-center distance is one baluster width plus one gap — for the example, 1½″ + 2⁹⁄₁₆″ = about 4¹⁄₁₆″ — and it stays constant the whole way, which is exactly why it is easier to mark accurately.
Find the centerline of the span and work outward in both directions, ticking each baluster center at that interval. Working from the middle makes the two end gaps mirror each other and come out equal, which is what reads as "intentional" to the eye. Mark on a strip of tape run along both the rail and the shoe (the bottom track) so the top and bottom of each baluster line up and every spindle stands plumb.
Fastening and keeping them plumb
How the balusters attach depends on the system. Square wood balusters are typically toe-nailed or screwed into the rail and shoe, or set into a plowed (grooved) rail and bottom rail with filler strips between them — the filler-strip method is the cleanest way to lock in even spacing, because the strips are cut to the gap dimension and hold each baluster in place automatically. Metal balusters usually drop into pre-drilled holes or use shoes that set-screw to the rail.
Whatever the system, check each baluster for plumb with a small level as you fasten it, not after — a baluster nailed a few degrees off leans for the life of the railing and throws off the gap to its neighbor. Stagger your starting point on a long run so any tiny cumulative error lands in the least visible spot, and re-confirm with the calculator if you change baluster stock partway, since a different width changes both the count and the center spacing.
Raking stairs: the gap is measured along the rail
On a sloped (raking) stair railing, balusters stay plumb while the rail climbs at the stair pitch, so the clear gap between two adjacent balusters is measured horizontally, not along the diagonal rail. That horizontal gap is what the 4″ sphere must not pass. Because the balusters are vertical and the rail is diagonal, the spacing along the rail is slightly larger than the horizontal gap — get this wrong and you either crowd the spindles or open an illegal gap.
The clean way to handle a raking run is to solve the horizontal spacing first, then transfer it to the rail using the stair pitch. Treat each straight flight as its own span; if the stair turns — an L-shaped or U-shaped layout — each leg is a separate segment with its own post-to-post span and its own baluster solve.
Step 4 — Dry-fit and check with a real sphere
Stand a few balusters in place and slide a 4″ check gauge (or anything exactly 4″) through the widest-looking gap and through the triangle at the bottom of an open stair, where the bottom rail, the first riser, and the tread meet. That triangle uses the larger 6″ sphere, but the vertical gaps along the rail still use 4″. If a sphere passes anywhere, add one baluster and re-solve — never just shove the spindles together unevenly to close one gap, because that opens another somewhere else.
When the dry-fit checks out, fasten from the layout marks you made on the tape, keeping every baluster plumb. For a railing that turns a corner, climbs a raking stair, or spans multiple posts, solve each section independently with the baluster spacing calculator so the gaps stay equal within each segment, and price the spindles and rail with the stairs cost calculator before you buy.
Run your numbers
Baluster Spacing Calculator Enter your railing length and spindle width to get the number of balusters, the exact even gap and center‑to‑center spacing — checked against your code’s 4‑inch sphere rule.Related stair calculators
Written by the Stairs Calc editorial team. Methodology and code references: see our methodology.
Built and maintained by builders, drafters and engineers who plan stairs for a living — every code limit is transcribed from the published standard and cited to its exact section.
Last reviewed 2026-06-20 against IRC 2021/2024
Stairs Calc gives accurate geometry and checks it against published building-code limits, but results are estimates for planning. Codes are adopted and amended locally and change over time. Always confirm dimensions against your local adopted code and a licensed professional before you build.