Deck · Railings

Baluster Spacing Calculator

How many balusters fit, the exact even gap, the on-center spacing and every layout mark, with the 4-inch sphere rule checked.

Code basis: 2021 IRC R312.1.3Sources

1 Section
in
in
Clear opening = spacing − one post width
Units
2 Balusters
in
Must stay under 4 in.
Balusters
13
per section
Actual gap
3 1/2″
3.500 in. between every pair
On center
5″
Mark spacing
Clear opening
68 1/2″
Between posts
Layout marks from the left post (left edge of each baluster)
  • 1: 3 1/2″
  • 2: 8 1/2″
  • 3: 13 1/2″
  • 4: 18 1/2″
  • 5: 23 1/2″
  • 6: 28 1/2″
  • 7: 33 1/2″
  • 8: 38 1/2″
  • 9: 43 1/2″
  • 10: 48 1/2″
  • 11: 53 1/2″
  • 12: 58 1/2″
  • 13: 63 1/2″
Every opening is 3.500 in., under the 4 in. sphere limit of IRC R312.1.3. Rails and the bottom gap count too: keep the space under the bottom rail under 4 in. (at stairs, the triangle under the bottom rail can pass a 6 in. sphere).
Tip: cut a spacer block exactly 3.500 in. wide and use it instead of a tape for every gap.

How the spacing is worked out

Even spacing means the gap at each post equals the gap between balusters. With n balusters there are n + 1 gaps, so the clear opening between posts equals n baluster widths plus n + 1 gaps. Pick the largest gap you will accept, solve for the smallest n that keeps every gap at or under it, then compute the exact gap.

gapon centerclear opening between posts
n balusters make n + 1 equal gaps across the clear opening between posts.
Clear opening = post spacing (on center) − post width n = ceil((opening − max gap) ÷ (baluster width + max gap)) Gap = (opening − n × baluster width) ÷ (n + 1) On center = gap + baluster width Mark k = gap + (k − 1) × on center (left edge of baluster k)

Worked example: 6 ft sections of 2×2 balusters

  • Posts 72 in. on center, 3½ in. wide: clear opening 68½ in.
  • n = ceil((68.5 − 3.5) ÷ (1.5 + 3.5)) = ceil(13) = 13 balusters.
  • Gap = (68.5 − 13 × 1.5) ÷ 14 = 3.5 in.; on center 5 in.
  • Marks from the left post: 3½, 8½, 13½ … 63½ in.
  • With ¾ in. metal balusters in the same section: 16 balusters at a 3.32 in. gap.

Rules beyond the gaps

  • Guard height: at least 36 in. above the deck surface where a guard is required (IRC R312.1.2), which is any open side more than 30 in. above grade.
  • Bottom gap: the space under the bottom rail must also stop a 4 in. sphere.
  • Stairs: the triangle formed by a tread, riser and bottom rail may pass a 6 in. sphere but not larger; the guard on the stair sides follows the same 4 in. rule elsewhere (R312.1.3 exceptions).
  • Strength: guards must resist a 200 lb load at the top (IRC Table R301.5); post attachment matters more than baluster count. See DCA 6 for tested post details.

Installation tips

  • Cut one spacer block to the exact gap and use it for every space; it’s faster and more accurate than a tape.
  • Check plumb every few balusters with a level, since small errors add up across a section.
  • Measure each section separately; posts are rarely exactly where the plan says, and the calculator only needs the real opening.

Need the whole railing (posts, rails and baluster counts for every side)? Use the railing calculator.

Common mistakes

  • Using nominal sizes. A “2×2” baluster is 1½ in. wide and a “4×4” post 3½ in.; use actual sizes or every gap comes out wrong.
  • Measuring post centers instead of the clear opening. The calculator subtracts one post width from the on-center spacing; if your posts differ in size, enter the clear opening directly as the spacing with a post width of 0.
  • Starting with a full baluster at the post. Even spacing starts and ends with a gap; starting tight against the post leaves an odd gap at the other end.

Questions people ask

What is the code for baluster spacing?
IRC R312.1.3: required guards must not have openings that allow a 4 in. sphere to pass through. In practice that means every gap between balusters must be less than 4 in.; most builders aim for about 3½ in. so a slightly bowed baluster still passes.
How many balusters do I need for a 6 ft section?
With posts 72 in. on center and 3½ in. posts, the clear opening is 68½ in. With 1½ in. balusters and a 3½ in. maximum gap you need 13 balusters, and the gap that makes them perfectly even is exactly 3½ in. (5 in. on center).
How do I space balusters evenly?
Find the count first: n = (opening − gap) ÷ (baluster + gap), rounded up. Then the even gap is (opening − n × baluster width) ÷ (n + 1). Cut a spacer block to that gap and use it between every baluster instead of measuring.
How many balusters per linear foot?
With 1½ in. wood balusters at about 5 in. on center, roughly 2.4 per foot of railing; with ¾ in. metal balusters at about 4.3 in. on center, about 2.8 per foot. Section length and post width change the exact count, which is why the calculator works per section.

Sources

  1. 2021 International Residential Code (IRC) — International Code Council, checked Nov 2026.
  2. DCA 6: Prescriptive Residential Wood Deck Construction Guide — American Wood Council, checked Nov 2026.

Related calculators

All deck tools →