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.
No. Every calculation runs locally in your browser. Your span, baluster width and gap numbers are never uploaded to a server or saved anywhere.
Related Tools
BMI Calculator
Calculate body mass index from height and weight. Shows WHO category, healthy-weight range and limitations of BMI.
Scientific Calculator
Full scientific calculator with trig, log, exponents, factorial, memory, parentheses and DEG/RAD toggle. Runs in your browser.
Rising Sign Calculator
Estimate your rising sign from birth date and birth time. This quick astrology calculator uses a simple two-hour block method, not a full birth chart.
Name Numerology Calculator
Calculate your destiny number and expression number from your full name using Pythagorean numerology, with a personality reading.
Inflation Calculator
Calculate the equivalent purchasing power of a dollar across any two years using historical CPI data from 1913 to today.
Running Pace Calculator
Enter distance and finish time to calculate pace per km, pace per mile, average speed and projected 5K, 10K, half marathon and marathon finish times.