Baluster Spacing Calculator

A clean railing has evenly spaced balusters with gaps that meet the safety limit, typically a maximum opening that a 4-inch sphere cannot pass for residential guards. This calculator takes the clear run between posts, the baluster width, and your maximum gap, then finds the fewest balusters that keep every gap at or under the limit, along with the exact equal gap that results. The maximum gap is an editable input because exact code limits vary by jurisdiction and location, so always confirm your adopted local code.

0.00
0.00
0.00
0.00

Baluster spacing formula

Gaps = balusters + 1
Gap = (run - balusters * baluster width) / (balusters + 1)
Balusters needed = smallest n where gap is at or below the maximum
Center spacing = (run - baluster width) / balusters

The pattern starts and ends with a gap against the posts, so there is always one more gap than baluster. The calculator raises the baluster count until the equal gap meets your maximum.

Railing layout notes

  • Measure the clear run between post faces, not the overall rail.
  • Residential guards commonly cap openings at a 4-inch sphere.
  • Exact limits vary by code, location, and stairs versus level guards.
  • Confirm your adopted local building code before building.
  • Even gaps and consistent center spacing look best and pass inspection.

Baluster spacing: frequently asked questions

How do I space balusters evenly?

For a run of length L with balusters of width w, the gaps and balusters alternate with one more gap than baluster. The number of balusters is chosen so each gap is at or below your maximum. Gap = (L - n x w) / (n + 1), where n is the baluster count. Increase n until the gap is small enough.

What is the maximum gap between balusters?

Residential guard codes commonly limit openings so a 4-inch sphere cannot pass, meaning a maximum gap of about 4 inches. This is a widely-used guard requirement, but exact limits and locations (stairs, decks, commercial) vary by jurisdiction and adopted code, so confirm your local code. The maximum gap is an editable input here.

Why is there one more gap than baluster?

A balanced railing starts and ends with a gap against the posts, so the pattern is gap, baluster, gap, baluster, ... gap. That gives n balusters and n + 1 gaps across the clear run, which is why the formula divides by n + 1.

How do I find the minimum number of balusters?

The calculator finds the smallest baluster count whose resulting equal gap is at or below your maximum. Adding balusters shrinks the gaps; the minimum count that satisfies the limit uses the fewest spindles while staying compliant and evenly spaced.

Does the post or newel width matter?

Yes. Measure the clear run between the inside faces of the posts or newels, not the overall rail length, because balusters only fill the open space between them. Enter that clear distance as the run length for an accurate gap.

Official sources

  • International Code Council: ICC Codes, guard and handrail opening limits.
  • U.S. Consumer Product Safety Commission: CPSC, railing safety guidance.

Reviewed by the CalculatorHub team, edited by James Graham, 17 June 2026. See our methodology.