Baluster Calculator
Lay out a railing in seconds: enter the clear span between two posts, the width of each baluster, and the maximum gap your building code allows (commonly 4 in so a sphere cannot pass through). The calculator finds the smallest number of balusters that keeps every gap at or below that limit, then evens the leftover space so the first gap, the last gap, and every gap in between are identical. The result is the spindle count to buy and the exact on-center spacing to mark out for deck, stair and porch railings.
How the baluster spacing is calculated
-
1
Measure the clear span
The horizontal distance between the inside faces of the two posts, in inches. This is the run the balusters must fill.
-
2
Enter baluster width and code gap
Type the actual width of one baluster and the maximum allowed gap (most codes cap it at 4 in for guards).
-
3
Read the count and even gap
You get the number of balusters to install and the equal gap between each one so no opening exceeds the code limit.
The formula
A railing splits a fixed clear span into a row of balusters separated by equal gaps. With N balusters there are always N + 1 gaps (one before the first spindle, one after the last, and one between each pair):
- Balusters needed = ceil((span − maxGap) / (balusterWidth + maxGap)), round up so no gap can exceed the code limit.
- Actual gap = (span − balusters × balusterWidth) / (balusters + 1), the leftover space shared evenly across all N + 1 openings.
Rounding the count up means the real gap is always a little smaller than the maximum you entered, which is exactly what you want for a code-compliant guard.
Worked example
A 72 in clear span with 1.5 in balusters and a 4 in maximum gap:
- Balusters = ceil((72 − 4) / (1.5 + 4)) = ceil(68 / 5.5) = ceil(12.36) = 13.
- Actual gap = (72 − 13 × 1.5) / (13 + 1) = (72 − 19.5) / 14 = 52.5 / 14 ≈ 3.75 in.
So 13 balusters with an even 3.75 in gap fill the span with every opening safely under the 4 in limit.
| Quantity | Value |
|---|---|
| Clear span | 72 in |
| Baluster width | 1.5 in |
| Maximum gap | 4 in |
| Balusters needed | 13 |
| Actual gap | 3.75 in |
Pitfalls to avoid
- Measure the clear span, not the post centers. The balusters only fill the open space between posts, so use the inside-face-to-inside-face distance.
- Count the end gaps. N balusters create N + 1 gaps, including one against each post, that is why dividing the span by the baluster pitch alone gives the wrong answer.
- Use the actual baluster width. A nominal “2×2” is really about 1.5 in; using 2 in throws off both the count and the spacing.
- Round counts up, never down. Dropping a baluster pushes a gap over the code maximum and can fail inspection.
Frequently Asked Questions
Most residential codes cap the opening at 4 in for guards, meaning a 4 in sphere must not pass through. Stairs sometimes allow a 4 3/8 in sphere on the open side of a tread. Always confirm the limit with your local code before building.
A row of N balusters has a gap against the first post, a gap against the last post, and one gap between each pair, for N + 1 gaps total. The calculator spreads the leftover span evenly across all of them so the end gaps match the inner gaps.
Measure the clear span between the inside faces of the two posts. The balusters only fill that open distance, so using the center-to-center measurement would overcount.
The numbers you enter are sent to the server only to compute the result, and in the step flow they appear in the page link. They are not stored and are never shared with third parties.
Related Tools
BMI Calculator
Calculate body mass index from height and weight. Shows WHO category, healthy-weight range and limitations of BMI.
Social Security Calculator
Estimate a US Social Security retirement benefit from your PIA and claiming age. Compare monthly and annual amounts at 62, FRA 67 and 70.
Age Calculator
Calculate exact age in years, months and days from a birth date, plus total days, hours and the next birthday countdown.
One Rep Max Calculator
Estimate your one-rep max (1RM) from weight lifted and reps completed using Epley, Brzycki and Lander formulas.
Amp-Hour Calculator
Work out battery runtime and stored energy from amp-hours, voltage and load current. Get runtime in hours and minutes plus energy in watt-hours and kilowatt-hours.
Scientific Calculator
Evaluate supported real-number expressions with trig, logs, powers and parentheses locally in your browser.