The formula
For a straight run of n balusters between two posts, with equal openings everywhere including the two ends:
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:
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 in | 1-1/2 in | 8 | 4 in | 5-1/2 in |
| 60 in | 1-1/2 in | 11 | 3-5/8 in | 5-1/8 in |
| 72 in | 1-1/2 in | 13 | 3-3/4 in | 5-1/4 in |
| 96 in | 1-3/4 in | 16 | 4 in | 5-3/4 in |
| 108 in | 2-1/4 in | 17 | 3-7/8 in | 6-1/8 in |
| 126 in | 1-1/2 in | 23 | 3-13/16 in | 5-5/16 in |
| 132 in | 3 in | 19 | 3-3/4 in | 6-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):
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.