HomeMaterials & Energy › Baluster Spacing Calculator

Baluster Spacing Calculator

Space balusters evenly and legally. Enter the railing section length between posts in inches, the baluster width in inches, and the maximum gap (4 in per code) to get how many balusters you need, the exact equal gap, and the on-center layout number.

Example: with Section length between posts (in) 72 · Baluster width (in) 1.5 · Max allowed gap (in) 4 → Balusters needed: 13 balusters.

  • Actual equal gap3.75 in each (passes the 4 in max)
  • On-center spacing5.25 in on center
  • Layout start3.75 in from post to first baluster edge

Computed by the calculator below using its default values. Change any input to see your own numbers.

Balusters needed
Actual equal gap
On-center spacing
Layout start

n = ceil((length − max gap) ÷ (baluster width + max gap)); the equal gap is then recomputed so all n+1 openings match. IRC R312.1.3: a 4 in sphere must not pass.

The 4-inch sphere rule

US residential code (IRC R312.1.3) says a 4 in sphere must not pass through any opening in a required guard — the test is a toddler's head. That makes baluster layout a constraint problem: openings must stay at or under 4 in, but they also need to be identical, because nothing screams amateur like a skinny last gap at the post.

The solve: find the minimum baluster count that keeps gaps legal — n = ceil((length − 4) ÷ (width + 4)) — then divide the leftover space into n + 1 equal openings. A 72 in section with 1.5 in balusters needs 13 of them, giving fourteen identical 3.75 in gaps.

Laying it out without error buildup

Work in on-center terms: the first baluster's center sits at one gap plus half a baluster from the post, and every next center steps by the on-center number (baluster width + gap). Mark all centers off a tape stretched from one post rather than stepping a spacer block along the run — repeated spacer moves accumulate error, and by the far post you can be half an inch off. Cut one story stick with the centers marked and reuse it on every matching section.

How it’s calculated

Balusters n = ceil((L − g) ÷ (w + g)), minimum 1, where L = clear section length (in), w = baluster width (in), g = max gap (4 in per IRC R312.1.3 for guards). Equal gap = (L − n × w) ÷ (n + 1); on-center spacing = w + gap; first baluster edge sits one gap from the post.

Assumes rectangular balusters on a level run — turned profiles measure width at their narrowest point, and stair guards should be checked along the slope (the triangle at the bottom rail has its own 6 in sphere rule).

1.5 in balusters at a 4 in max gap

Section lengthBalustersEqual gap
36 in63.86 in
48 in84.00 in
72 in133.75 in
96 in173.92 in

Computed with n = ceil((L − 4) ÷ 5.5) and gap = (L − 1.5n) ÷ (n + 1).

Common mistakes

  • Spacing on-center at 4 in thinking that satisfies code — the rule limits the clear opening, and 4 in centers with 1.5 in balusters gives a legal 2.5 in gap but wastes a third of your balusters; conversely 5.5 in centers exactly hits the 4 in limit with zero margin.
  • Measuring section length post-face to post-face incorrectly — use the clear distance between posts, not center to center.
  • Letting a leftover gap land at one post instead of redistributing; equal gaps are the entire point of the math.
  • Ignoring shrinkage and inspector tolerance: designing at a hard 4.00 in gap leaves nothing if wood shrinks or a post bows. Target 3.9 in or less.

Frequently asked questions

What is the baluster spacing formula?

Balusters = ceil((section length − max gap) ÷ (baluster width + max gap)), then equal gap = (length − balusters × width) ÷ (balusters + 1). For 72 in with 1.5 in balusters and a 4 in max: 13 balusters, 3.75 in gaps.

What is the code maximum gap between balusters?

4 inches for guards on decks, balconies, and stair rails under the IRC — tested as a 4 in sphere that must not pass. Commercial work under the IBC uses the same 4 in sphere for guards.

Is baluster spacing measured on-center or between balusters?

Code cares about the clear opening between them; carpenters lay out on-center. This tool gives both — the clear gap for the inspector and the on-center number for your tape.

Why not just use a 4-inch spacer block?

Two problems: stepping a block along the run accumulates error, and it almost never comes out even at the far post, leaving one odd gap. Solving the whole section for an equal gap fixes both.

How many balusters per foot of railing?

With standard 1.5 in balusters at code-tight spacing, about 2.2 per linear foot (5.25 in on-center). A 20 ft deck rail needs roughly 44, before corners and stair sections.