LayoutMath

Baluster Calculator: Count, Gap and On-Centre Spacing

Calculator

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

Use 13 balusters with 3 3/4″ (3.75″) between each. Every gap stays within the 4″ limit.

Balusters
13

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

Clear gap
3 3/4″ (3.75″)

Limit 4″.

Spacing on centre
5 1/4″ (5.25″)

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

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

Measure the opening between posts, add the width of one baluster, and get the count, the equal gap and the on-centre spacing. This baluster calculator checks every gap against the 4 in ball rule, so the inspector's sphere has nothing to slip through. Deck railings and stair guards.

  • Free
  • No signup
  • Reviewed 15 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 centre. 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 it works

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 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-centre 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.

To space spindles on a deck, mark the first gap from the post, then step off the on-centre 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.

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.

Formula

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

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

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

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-centre spacing is 5.25 in. With 12 balusters the gap would be 4.15 in, over the limit.

6 ft centre to centre of 4×4 posts

Show the working

A 4×4 post is 3½ in square. Measured to the post centres the clear opening is 72 − 3½ = 68.5 in. That needs 12 balusters with a gap of 3.88 in. Measuring to centres 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 centre.

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
OpeningBalustersGapOn centre
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)
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)
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

Code notes

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 centres, and the gaps against the posts count. The IRC text is in IRC 2021 Chapter 3, Building Planning.

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.

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.

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 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 centres.

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 is spacing on centre?

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 centre distance. With 1½ in balusters a 4 in gap is 5½ in on centre, so laying them out at 6 in on centre 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.

Do I measure between the posts or to their centres?

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

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.

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-centre 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.

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 centre. Change the baluster width or the limit to match your railing.