Skip to content
Reference

Baluster Spacing Formula

One formula answers the whole layout: how many balusters fit, what opening they leave, and where each center lands. The only difficulty is being strict about which length goes into it. If you want to know how to calculate baluster spacing from first principles rather than plug numbers into a tool, this is the page for it — every variable is defined below the formula.

The formula

For a straight run of n balusters between two posts, with equal openings everywhere including the two ends:

clear opening g = (span − n × w) ÷ (n + 1) center distance c = g + w = (span + w) ÷ (n + 1) minimum count n ≥ (span − gmax) ÷ (w + gmax)
Two vertical balusters with a dimension arrow marked clear opening between their faces and a second arrow marked center to center between their center lines.
The clear opening is the gap between faces; center-to-center includes one baluster width. A 4 in opening needs 5-1/2 in centers with a 1-1/2 in baluster.

Every variable, defined

Variable Meaning Common mistake
span Clear distance between the post inside faces, measured in plan Substituting the sloped rail length, which is longer
n Number of balusters Rounding the count down instead of up
w Actual face width of one baluster Using the nominal name (2x2 is 1-1/2 in)
g Clear opening between two baluster faces Reporting a center distance as if it were the opening
gmax The maximum opening your project must satisfy Assuming 4 in applies everywhere
c Center-to-center distance Setting a square to c and calling it the gap

Why there are n + 1 openings

The balusters do not reach the posts. Each end of the run has a gap between the post face and the first or last baluster face, and there are n − 1 gaps between balusters. That totals n + 1 openings. This is the single most common source of count errors: the formula for “spacing between balusters” and the formula for “spacing including the ends” are different, and the second one is the one that fills a span exactly.

If you deliberately want equal interior gaps but a different end gap, pin the ends and solve for the interior:

interior gap = (span − 2 × endGap − n × w) ÷ (n − 1)

The calculator supports this as an optional end clear opening. The one thing it will not do is let the interior gap round up past your maximum.

Examples across widths and spans

All rows use a 4 in maximum opening and equal end gaps. Notice that the opening is always at or just under the limit, and the center distance moves with the baluster width.

Span Baluster width Count Clear opening Center to center
48 in1-1/2 in84 in5-1/2 in
60 in1-1/2 in113-5/8 in5-1/8 in
72 in1-1/2 in133-3/4 in5-1/4 in
96 in1-3/4 in164 in5-3/4 in
108 in2-1/4 in173-7/8 in6-1/8 in
126 in1-1/2 in233-13/16 in5-5/16 in
132 in3 in193-3/4 in6-3/4 in

What changes on a stair

A stair adds one transformation and nothing else. Balusters stay vertical, so the code dimension is still the horizontal opening. Everything measured along the rail is the plan number divided by cos(slope):

slope θ = atan(rise ÷ run) along rail x′ = x ÷ cos θ cos θ = run ÷ √(run² + rise²)

A baluster that is 1-1/2 in wide in plan occupies 1-1/2 in ÷ cos θ along the rake, which is why a tape on the rail reads larger numbers than the plan layout. On the 26.6° example stair that factor is 1.118: a 3-13/16 in plan opening measures 4-1/4 in along the rail, and 5-5/16 in centers measure 5-15/16 in.

If your inspector measures horizontally and you marked along the rail, convert before you compare. If you apply the opening limit along the rail instead, the layout gets stricter, and the calculator will do that too if you choose it in the measurement settings.

Rounding, and the rule that matters

The count rounds up; the opening is reported rounded down. Those two rules point the same way: toward an opening that is never larger than the limit and never larger than it looks on paper.

Rounding the count down is the dangerous direction, because it widens every opening. Rounding the displayed opening up is the misleading direction, because a 4 in limit can appear satisfied by a 4.03 in gap. The planner computes exactly, keeps the exact center positions, and only rounds at the moment it prints a number.

What the formula does not include

  • Post width, unless you tell it how the span was measured.
  • Curved runs, winders, or railing that changes direction mid-span.
  • Shoe rails, panel infill, cable or glass, each of which has its own spacing rules.
  • Guard height, handrail graspability, post anchorage and the infill load requirement — all of which affect compliance and none of which are spacing questions.

Run the numbers on the stair baluster spacing calculator, or read the step-by-step measurement guide if the span itself is the part you are unsure about.

For concrete numbers instead of algebra, see baluster spacing by baluster size, how many balusters you need, and the 4-inch sphere rule.

Important. This calculator provides layout estimates based on the dimensions and assumptions entered. It does not replace applicable building codes, manufacturer installation instructions, or professional inspection. Verify all measurements and local requirements before installation.