🏠
🏠 Home & living

Baluster Spacing Calculator (how many balusters & equal gaps under 4 in)

Results update as you type.

Your numbers

Understanding the baluster spacing calculator — concept and principle

This calculator works out how many balusters (spindles) you need between two posts so that every gap is equal and smaller than a safety limit, usually 4 inches. Deck and stair builders use it to lay out railings that meet code and look even.

Fit under the 4 in gapFit under the 4 in gap: ⌊(72 − 4) ÷ 5.5⌋ + 1 72 in between posts, (72 − 13 × 1.5) ÷ 14 equal gaps → 13 · 3.75 in gap 52 for 4 sectionsFit under the 4 in gap⌊(72 − 4) ÷ 5.5⌋ + 172 in between posts(72 − 13 × 1.5) ÷ 14equal gaps13 · 3.75 in gap52 for 4 sections
Fit under the 4 in gap: with the default inputs the result is 13 · 3.75 in gap (52 for 4 sections).

How it is calculated

Number of balusters n = ⌊(L − limit) ÷ (w + limit)⌋ + 1

Gap = (L − n × w) ÷ (n + 1)

Centre-to-centre spacing = gap + w

First baluster centre from the post = gap + w ÷ 2

The principle

With n balusters between two posts there are n + 1 gaps. The total length is n balusters plus n + 1 gaps, so solving for the gap gives the formula. The calculator picks the smallest n that makes the gap strictly less than the limit. The US International Residential Code (R312.1.3) requires that a 4-inch sphere cannot pass through a required guard, which protects small children from slipping through.

Worked example

Default inputs: 72 in between posts, 1.5 in balusters, 4 in limit, 4 sections.

  1. n = ⌊(72 − 4) ÷ (1.5 + 4)⌋ + 1 = ⌊12.36⌋ + 1 = 13 per section.
  2. Gap = (72 − 13 × 1.5) ÷ 14 = 52.5 ÷ 14 = 3.75 in (95 mm).
  3. Centre-to-centre = 3.75 + 1.5 = 5.25 in; first centre = 3.75 + 0.75 = 4.5 in from the post.
  4. Total = 13 × 4 = 52 balusters.
How Balusters per section changes with Clear length between posts (in)How Balusters per section changes with C…0510152025301836547290108144Example: 13Clear length between posts (in)
Each point is the calculator re-run with only “Clear length between posts (in)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Clear length between posts (in)Balusters per section
183
366
5410
7213
9016
10819
14426

How to read the result

Where does your result fall?Under 4 in4 in or more4Your result: 3.75 in · Under 4 inReference: IRC R312.1.3 (4-inch sphere)
Where does your result fall?

Mark the first centre from one post, then step along at the centre-to-centre spacing; the last gap should match. Check the gap with a 4-inch block. Different rules apply to the triangle under a stair rail and in other countries.

Common mistakes

Keep in mind: Your local building code decides guard height and opening limits. Structural railings need code compliance and, where required, a qualified professional.

Frequently asked questions

What is the maximum baluster gap?

Under the US IRC, a 4-inch sphere must not pass, so gaps must be under 4 in.

How many balusters per foot?

With 1.5 in balusters and gaps just under 4 in, roughly 2 per foot.

Should I start at a post or at the centre?

Either works if gaps are equal; centring a baluster or a gap can look better on short sections.

Sources: International Code Council, 2021 International Residential Code, Section R312.1.3 "Opening limitations"

Checked 9 Nov 2026. International Code Council, 2021 International Residential Code, Section R312.1.3 “Opening limitations” (required guards shall not allow passage of a 4-inch-diameter sphere); equal-spacing arithmetic.

🏠 All home & living tools →🌍 Calculators by country →