Calculateus

Baluster Spacing Calculator

Calculate baluster (spindle) spacing and count for a stair railing or deck railing that meets standard code spacing.

Result

Balusters Needed
17
On-Center Spacing
5.33 in

Rounds down to ensure the actual gap between balusters never exceeds your code maximum, then distributes them evenly across the rail length - always verify your local building code's exact maximum gap requirement, since some jurisdictions vary from the common 4-inch standard.

About the Baluster Spacing

The Baluster Spacing Calculator works out how many balusters, or spindles, a stair or deck railing needs and how far apart to set them on center, so the gap between each one stays within a code maximum. It's aimed at anyone building or replacing a railing who needs the spacing to both look even and pass inspection. Enter the rail length, baluster width, and maximum allowed gap, and it returns a baluster count and an on-center spacing measurement.

How It Works

The calculator adds your baluster width to the maximum gap to get a nominal center-to-center spacing, divides the rail length by that spacing, rounds up, and subtracts one to get a whole number of balusters. It then spreads that count evenly across the full rail length by dividing the rail length by the baluster count plus one, which becomes the on-center spacing you actually mark and install to.

Nominal Spacing = Baluster Width + Max Gap; Baluster Count = ceil(Rail Length / Nominal Spacing) - 1; On-Center Spacing = Rail Length / (Baluster Count + 1)

Formula & Methodology

Rounding the initial division up before subtracting one baluster keeps the design on the safe side of code: it guarantees at least as many balusters as a naive calculation would suggest, which keeps the actual installed gap at or under your specified maximum rather than over it. You can check the real gap by hand afterward by subtracting the baluster width from the on-center spacing figure.

Examples

8-Foot Deck Rail Section

A 96-inch rail section with 1.5-inch balusters and a 4-inch max gap needs 17 balusters, set on 5.33-inch centers, which works out to an actual gap of about 3.83 inches, under the 4-inch limit.

Shorter Stair Rail Run

A 60-inch run with 2-inch balusters and a 3.5-inch max gap calls for 10 balusters on 5.45-inch centers, leaving an actual gap of about 3.45 inches.

Advantages

  • Converts a code maximum gap requirement directly into a buildable on-center spacing measurement you can mark with a tape measure.
  • Rounds in the safe direction automatically, so the resulting layout doesn't exceed your specified maximum gap.
  • Handles any combination of baluster width and rail length, useful for custom or non-standard railing designs.

Common Mistakes

  • Spacing balusters based on the nominal baluster-width-plus-max-gap figure directly, instead of the recalculated on-center spacing, which can push the actual gap slightly over the maximum.
  • Using the guard gap maximum for a section that's technically classified as a stair rail, or vice versa, when the two sometimes carry different limits.
  • Forgetting to account for post width at each end of the rail section, since the calculator spaces balusters across the entered rail length only.

Edge Cases to Watch For

  • If the rail length is shorter than one nominal spacing unit, the baluster count can come out at zero or negative, which isn't a buildable railing and signals the inputs need adjusting.
  • The tool assumes a single uniform baluster width and doesn't account for decorative or tapered balusters that vary in width along their length.
  • Local codes occasionally set a maximum gap different from the common 4 inch figure, so the max gap field should reflect your actual local code, not just the default value.

Common Use Cases

  • DIY deck builders laying out spindle spacing before drilling or notching a top and bottom rail.
  • Contractors double-checking that a railing design will pass a building inspector's gap measurement.
  • Anyone replacing a damaged section of railing who needs to match spacing across a specific length.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

Why is the 4-inch gap rule so common in railing codes?

The 4-inch maximum gap standard is based on preventing a young child's head from passing through railing balusters, since a child's torso can typically still fit through a gap their head passes through, but not the reverse - this specific dimension has become a widely adopted safety standard in US residential building codes for stair and deck railings.

Conclusion

Getting baluster spacing right the first time avoids re-cutting rail stock or repositioning balusters after a failed inspection. Always confirm the maximum gap figure against your local code before finalizing a layout.