Baluster Spacing Calculator screenshot

Baluster Spacing Calculator

Fewest balusters and the exact clearance for a run, under the maximum clearance you set.

Privacy First
0 Runs
Updated 2026-11-21
Runs in your browser
No sign-up, no upload

What the baluster spacing calculator does

It finds the fewest balusters whose clearance stays under the maximum you set. The count is ceil((run - max clearance) / (max clearance + baluster width)); the exact clearance is then (run - count × width) / (count + 1). A 6 m run with 40 mm balusters and a 0.1 m maximum clearance needs 43 balusters and leaves 44 gaps of 0.0973 m, which is 97.2727 mm.

The page prints the check as well as the answer: the balusters plus every gap must return the run exactly, so a reader can verify the arithmetic instead of trusting it. The clearances are equal by construction, which is what makes the balusters evenly spaced.

The maximum is a number you type. This is arithmetic, not a jurisdiction's rule; it does not know a code's sphere size or its measurement method. A run or clearance of zero or below is refused, a clearance past 1 m is refused, more than 1000 balusters is refused with the count named, and a set of balusters that does not fit the run is refused.

Figures print to up to four decimal places with trailing zeros trimmed.

How to use it

Set Total run in metres: the clear distance between the two posts the balusters sit between.

Set Baluster width and Maximum clearance, then press Run. The result prints the count, the number of gaps, the exact clearance and the check that returns the run.

Worked example

Input with the defaults:

Balusters:      43 (ceil((6 - 0.1) ÷ (0.1 + 0.04)))
Actual gap:     0.0973 m (97.2727 mm)
Check:          1.72 m of balusters + 44 × 0.0973 m = 6 m

Why it runs in your browser

The count and the clearance are computed in this tab. Nothing you type is uploaded.

The page solves for the fewest balusters whose clearance stays under the maximum you set. The count is ⌈(run − max clearance) / (max clearance + baluster width)⌉, and the exact clearance is then the leftover run divided among one more gap than there are balusters.

A 6 m run with 40 mm balusters and a 0.1 m maximum gives 43 balusters and 44 gaps of 0.0973 m, which is 97.2727 mm — just inside the limit, and equal at every gap because the count is chosen for it.

The page prints the check as well as the answer: the balusters plus every gap must return the run exactly. That is what makes the spacing verifiable rather than trusted.

Why the count rounds up

Fewer balusters means wider gaps, so the maximum clearance sets a floor on the count rather than a ceiling. Solving the clearance inequality for the count gives ⌈(run − clearance) / (clearance + width)⌉, and rounding up is what keeps every gap at or under the limit.

The last gap is not a leftover: there is one more gap than there are balusters, because gaps sit at both ends as well as between them. That is why the count and the gap count differ by one, and why the check adds up.

A number you type, not a rule the page knows

The maximum clearance is a value you supply. Building codes commonly limit the gap so a sphere cannot pass, and the size and the measurement method differ by jurisdiction and by the inspector's reading; the page does not encode any of them.

That is deliberate: a stale code number would be worse than no page, because it would look authoritative. The page is arithmetic on the maximum you type, and it says so on the result.

How to use Baluster Spacing Calculator

Set Total run in metres: the clear distance between the two posts the balusters sit between.

Set Baluster width and Maximum clearance; the clearance is the gap you want to stay under.

Press Run. The result prints the count, the gaps, the exact clearance in metres and millimetres, and the check that returns the run.

What to Expect

Best for

  • The fewest balusters for a run under a clearance limit
  • An even clearance at every gap
  • Checking a railing layout before cutting

Not ideal for

  • A code compliance check, which depends on a jurisdiction's rule
  • A run with a post in the middle, which splits it into two runs

What this tool keeps

  • The run, the baluster width and the clearance limit you typed
  • The exact clearance and the check that returns the run

What may need cleanup

  • A run that excludes the posts, when the balusters sit inside them
  • A baluster width in inches, which has to be converted to metres

Common errors

  • Using the baluster width as the clearance, which are different numbers
  • Forgetting the end gaps, which the page counts

Example use cases

  • Laying out a stair or landing railing
  • Ordering balusters for a run
  • Checking an existing railing's gap

Sample input

6 m run, 40 mm balusters, 0.1 m maximum clearance.

Sample output

43 balusters, 44 gaps of 0.0973 m, which is 97.2727 mm.

Who this is for

  • Carpenters and DIY builders laying out a railing
  • Anyone checking a gap before inspection

Frequently asked questions

Why is there one more gap than there are balusters?

There is a gap before the first baluster and after the last one, plus one between each pair. So n balusters sit in n + 1 gaps, and the run is n × width + (n + 1) × clearance.

Is the maximum clearance a building code?

No. It is a value you type. Codes limit the gap so a sphere cannot pass, and the limit and its measurement vary; the page does not encode a jurisdiction's rule and says it is not a code check.

Why is the count rounded up?

More balusters means narrower gaps, so rounding down would break the limit. Rounding up is the only direction that keeps every gap at or under the clearance you set.

What if the balusters do not fit?

The page refuses with the widths named. That happens when the baluster count times its width exceeds the run, which means the clearance limit is too small for that baluster to fit at all.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.