LayoutMath

Baluster Spacing Calculator: Spindle Count, Gap and 4" Code

Baluster inputs and result

Start here. Measure the opening between two posts. That, and the width of one baluster, is all it takes.

Try an example

Opening

You measured
1.829 m
ft

Balusters

38.1 mm
in
101.6 mm
in

Result

You need 13 balusters with 3 3/4 inch (3.75 inches) between each. Every gap stays within the 4-inch limit.

Balusters
13

14 equal spaces, including both ends. Clear opening 6 feet.

Clear gap
3 3/4 inch (3.75 inches)

Limit 4 inches.

Spacing on center
5 1/4 inch (5.25 inches)

Baluster width plus gap. This is the number you step off with a tape.

  • Passes: Every gap is at most 4 inches
Elevation13 balusters
Clear gap 3 3/4″

Measure the opening between posts, add the baluster width, and this baluster spacing calculator gives you the count, the equal gap and the on-center spacing — every gap checked against the 4 in ball rule. It works as a deck baluster spacing calculator for straight runs and a stair baluster spacing calculator for angled runs, so the railing passes inspection. Use it as a plain baluster calculator for the count, or pick the spacing mode to nail the on-center dimension.

  • Free
  • No signup
  • Reviewed 20 October 2026
  • Estimates only

Quick answer A 72 in clear opening with 1½ in balusters and a 4 in limit takes 13 balusters: 14 equal gaps of 3.75 in, with the balusters 5.25 in on center. Twelve would leave gaps of 4.15 in, wide enough for the 4 in ball (IRC R312.1.3).

gapTop railPostBalusterEvery gap under 4″, so a 4″ ball cannot pass

How the baluster math works

There is one more gap than balusters

Balusters split the opening into one more gap than there are balusters, because there is a gap against each post as well as between balusters. With n balusters of width w in a clear opening O, every gap is (O − n × w) ÷ (n + 1).

The ball test sets the count

The code test is a ball: a 4 in sphere must not pass anywhere. A gap of exactly 4 in does not pass, because the ball just fits through it. So the calculator finds the smallest n that makes every gap smaller than your limit, then spaces everything equally. On-center spacing is the baluster width plus the gap, which is the number you step off with a tape. A gap that creeps over by an eighth of an inch is the one that fails the inspection and gets the railing pulled apart, so the calculator never hands you one.

Stepping off the spacing

To space spindles on a deck, mark the first gap from the post, then step off the on-center spacing along the rail: baluster, gap, baluster, gap. Every gap is equal, so the last one lands on the far post with no fudging. A spindle is just another name for a baluster, so the same sum works as a deck railing spindle spacing calculator, and with the stair guard chip it sets banister spindle spacing on a stair.

Size the deck and stair first

The railing sits on a deck or beside a stair, so size those first with the deck calculator and the stair calculator. Before the posts go in, the squaring calculator checks that the layout is square, and the board foot calculator sizes the lumber for the rails and posts. Add the feet and inches calculator for any fraction work.

Formula

The formula

g=O−nwn+1n=⌊O−gmaxw+gmax⌋+1

g = clear gap, O = clear opening, n = balusters, w = baluster width, g_max = maximum gap.

The same sums, step by step

gap          = ( opening − n × width ) / ( n + 1 )
n            = floor( (opening − max gap) / (width + max gap) ) + 1   every gap stays under the limit
on center    = width + gap
opening      = post-to-post distance                  measured face to face
             = center-to-center − post width          measured to post centers

Worked examples

72 in opening, 1½ in balusters

Show the working

(72 − 4) ÷ (1.5 + 4) = 12.4, so you need more than 12 and the answer is 13 balusters. The gap is (72 − 13 × 1.5) ÷ 14 = 3.75 in, and the on-center spacing is 5.25 in. With 12 balusters the gap would be 4.15 in, over the limit.

6 ft center to center of 4×4 posts

Show the working

A 4×4 post is 3½ in square. Measured to the post centers the clear opening is 72 − 3½ = 68.5 in. That needs 12 balusters with a gap of 3.88 in. Measuring to centers and forgetting the post width would give 13, one too many.

UK: 1.8 m opening, 40 mm spindles, 100 mm limit

Show the working

(1800 − 100) ÷ (40 + 100) = 12.1, so more than 12: 13 spindles. The gap is 91.4 mm, with spindles 131.4 mm on center.

How many balusters do I need?

Find your opening and read the count off the table. Each row uses 1½ in balusters and a 4 in limit, with equal gaps against both posts. Look at the 4 ft row: eight balusters would leave gaps of exactly 4 in, which a 4 in ball slips through, so the table says nine.

Balusters by opening between posts

Balusters by opening between posts
OpeningBalustersGapOn center
4 ft93.45 in4.95 in
6 ft133.75 in5.25 in
8 ft173.92 in5.42 in
10 ft223.78 in5.28 in
12 ft263.89 in5.39 in

Deck baluster spacing by opening and baluster width

Deck baluster spacing is a sum with a hard limit: no gap a 4 in sphere can pass through. This table is the baluster spacing calculator in chart form, by opening and baluster width, so you can read the count for a bay without opening the calculator.

Balusters by opening and baluster width (4 in limit)

Balusters by opening and baluster width (4 in limit)
Opening1 in baluster1½ in baluster (2×2)2 in baluster
4 ft998
6 ft141312
8 ft191716
10 ft242220
12 ft292624

Stair baluster spacing: the 4⅜ in limit

Stair baluster spacing uses the same sum with a larger limit, 4⅜ in on the open side of a stair, so a stair guard takes fewer balusters than a level deck guard of the same length. The table sets the two side by side for 1½ in balusters, so you can see what the bigger gap saves.

Level deck guard against stair guard (1½ in balusters)

Level deck guard against stair guard (1½ in balusters)
OpeningDeck guard, 4 in limitGapStair guard, 4⅜ in limitGap
3 ft63.86 in63.86 in
4 ft93.45 in84 in
5 ft113.63 in104.09 in
6 ft133.75 in124.15 in
8 ft173.92 in164.24 in

Baluster spacing mistakes

Railing layouts fail the inspection on a fraction of an inch. These are the mistakes that cause it.

Treating the on-center spacing as the limit

Code limits the clear gap, not the distance between centers. With 1½ in balusters a 4 in gap is 5½ in on center, so laying them out at 6 in fails by ½ in.

Forgetting the gaps against the posts

There is a gap against each post as well as between balusters, so n balusters make n + 1 gaps.

Measuring to the post centers

Measure the clear opening, from the inside face of one post to the inside face of the next. If you can only get center to center, subtract the post width.

Using the sloping length on a stair

If the balusters on a stair guard are plumb, enter the horizontal distance between posts, not the length along the sloping rail.

Rounding the count down

A gap that creeps over by an eighth of an inch is the one that fails. Always round the number of balusters up.

Fixing balusters one at a time

Mark every position before you fix a single one, so a small error cannot build up along the rail.

Railing checklist before you cut

Run through this once the baluster calculator has given you the count and the spacing.

Measure

  • Measure the clear opening between the posts, face to face.
  • Measure the real width of one baluster.
  • For a stair, measure the horizontal distance between posts.

Choose the limit

  • Use 4 in for a level deck guard, or the limit your jurisdiction has adopted.
  • Use the stair guard chip only on the open side of a stair.
  • In England, use 100 mm.

Lay out

  • Mark the first gap from a post and step off the on-center spacing.
  • Check that the last gap lands on the far post with no fudging.
  • Check every gap with a 4 in block before you fasten.

Railing terms

The vocabulary on a railing plan.

Baluster
A vertical member between the top rail and the bottom rail of a guard. Also called a spindle.
Guard
The railing along an open side of a deck, balcony or stair that stops a fall.
Clear opening
The distance between two posts, measured from face to face.
Gap
The clear space between two balusters, or between a baluster and a post.
On center
The distance from the middle of one baluster to the middle of the next.
Sphere rule
The code test that a ball of a set size must not pass through any opening in the guard.

Code notes

Where the 4 in limit comes from

For decks, IRC Section R312.1.3 says a required guard may not have openings that let a 4 in sphere pass. The limit is on the clear gap, not the distance between centers, and the gaps against the posts count. The IRC text is in IRC 2021 Chapter 3, Building Planning.

Stair guards allow more

On the open side of a stair the IRC allows a slightly larger sphere, 4⅜ in, and 6 in for the triangle formed by the tread, riser and bottom rail. Confirm the numbers in the edition your jurisdiction has adopted. If the balusters on a stair guard are plumb, enter the horizontal distance between posts, not the length along the sloping rail.

The limit in England

In England, Approved Document K limits openings in guarding so that a 100 mm sphere cannot pass through. The UK preset enters 100 mm as the limit. Read the version that applies to the building: Approved Document K on GOV.UK.

Section numbers refer to IRC 2021 section numbers; England Approved Document K. Local amendments are common, so confirm with your building authority.

FAQ

Hover a question to read the answer. Click to keep it open.Tap a question to open it.

Counting

How many balusters do I need?

Enough that every gap, including the spaces against the posts, is smaller than the limit. For a 72 in clear opening with 1½ in balusters and a 4 in limit the answer is 13, with a 3¾ in gap. Twelve would leave gaps over 4 in.

What is spacing on center?

The baluster width plus the clear gap: the distance from the middle of one baluster to the middle of the next. Code limits the clear gap, not the center distance. With 1½ in balusters a 4 in gap is 5½ in on center, so laying them out at 6 in on center fails by ½ in. The same arithmetic gives deck railing baluster spacing and deck railing spindle spacing, since a spindle is another name for a baluster.

How many balusters do I need for an 8 foot opening?

17 with 1½ inch balusters and a 4 inch limit, leaving 3.92 inch gaps between balusters and against the posts. That is 5.42 inches on center. Change the baluster width or the limit to match your railing.

Can I use this as a deck baluster calculator?

Yes. Enter the clear opening between the posts, the baluster width and the gap limit, and it returns the number of balusters, the equal gap and the on-center spacing for the deck rail. Use the stair guard chip for the open side of a stair.

How far apart should balusters be?

For a deck or stair rail in the US, no gap between balusters can pass a 4 in sphere — that means a maximum clear gap of just under 4 in. In the UK and the EU the rule is a 100 mm sphere, which is just under 4 in too. The calculator picks the count and the gap that satisfies the limit you enter.

How many balusters do I need for a 10 foot run?

A 10 ft (120 in) run with 1½ in balusters and a 4 in max gap takes 22 balusters at 5.28 in on center, leaving a 3.78 in gap that passes the sphere test. The calculator shows the exact gap and rounds up, so the last baluster never leaves a 4.5 in opening at the post.

Code limits

What is the baluster spacing code for a deck?

IRC R312.1.3 says a required guard may not have openings that let a 4 in sphere pass. The default limit here is 4 in. It applies to the clear space between balusters and between a baluster and a post, so deck spindle spacing is a limit on the gap and not on the centers.

What is the code for baluster spacing?

The IRC (R312.1.3) says a 4 in sphere cannot pass through any opening up to 36 in above the floor — that is the 4-inch rule for balusters on a deck or stair rail. On stairs, the rule applies to the triangle under the nosing too. Local codes can be stricter, so check before you build.

What is stair baluster spacing, and is it different?

Yes, a little. The IRC allows a 4⅜ in sphere on the open side of a stair, and 6 in for the triangle between tread, riser and bottom rail. Level deck guards stay at 4 in. Use the stair guard chip for stair baluster spacing only, and confirm it for your jurisdiction.

What about the UK 100 mm rule?

Approved Document K limits openings in guarding so that a 100 mm sphere cannot pass. The UK chip enters 100 mm as the largest gap, a little under 4 in. Check the document that applies to your building.

Measuring and layout

Do I measure between the posts or to their centers?

Measure the clear opening, from the inside face of one post to the inside face of the next. If you can only get center to center, switch the calculator to that option and enter the post width so it can subtract it.

How do I space spindles on a deck, and what is banister spindle spacing?

Work out the count and the equal gap first, then step off the on-center spacing from one post: baluster, gap, baluster, gap. Banister spindle spacing on a stair follows the same steps with the stair guard limit. Mark every position before you fix a single one, so a small error cannot build up along the rail.

What is the easiest way of spacing spindles on deck rails?

Cut a scrap to the width of one gap and use it as a spacer between balusters. Spacing spindles on deck rails this way puts the last gap against the far post with no fudging, provided the count and the gap came from the calculator.

How do I calculate baluster spacing?

Add the baluster width to the maximum gap (just under 4 in for IRC), divide the total run by that unit, and that is the count. The on-center spacing is the run divided by the count. The calculator does both and shows the equal gap that meets the 4 in rule — no math, no spreadsheet.

Can I use this as a deck spindle calculator?

Yes. A spindle is another name for a baluster, so the same tool works as a deck spindle calculator — enter the opening between posts, the spindle width and the 4 in limit, and read the count, the equal gap and the on-center spacing.

Can I use this as a stair baluster calculator or stair spindle calculator?

Yes. Switch to the stair guard chip, which sets the limit to 4⅜ in for the open side of a stair, and the calculator works as a stair baluster calculator. Because a spindle is the same thing as a baluster, it is also a stair spindle calculator — use the sloping run of the rail as the length. The output gives the equal gap and on-center spacing, so it doubles as a stair spindle spacing calculator when you need both numbers.