Baluster Calculator

Find the number of balusters for a railing section and the exact even gap between them, keeping every opening under the 4-inch rule.

A 2×2 baluster is 1½ in actual; a 5/4 in. wide round is its diameter.
The IRC requires that a 4-inch sphere cannot pass through the guard.

Result

Balusters per section—
Space between balusters—
Center-to-center spacing—
Total balusters—

Balusters, also called spindles, are the vertical posts between the top and bottom rails of a deck, porch or stair railing. Their job is safety: they keep people, and especially small children, from falling or getting stuck. Building codes limit how far apart they can be, so you count and space them carefully. This baluster calculator finds the number of balusters per section and the exact gap between them.

How to use the baluster calculator

  1. Enter the clear space between the posts for one railing section (the length of the rail from inside face to inside face).
  2. Enter the baluster width. Use the actual width: 1½ inches for a 2×2.
  3. Enter the largest opening allowed, usually 4 inches for a guard.
  4. Enter the number of identical sections to get the total for the project.

Baluster spacing formula

gap w n = ⌈ (space − max gap) ÷ (baluster width + max gap) ⌉ Gap = (space − n × width) ÷ (n + 1) calcmaple.com
Balusters are spaced evenly between posts so no gap exceeds the code maximum (commonly under 4 inches).
Balusters n = ⌈ (space − maximum gap) ÷ (baluster width + maximum gap) ⌉
Gap = (space − n × baluster width) ÷ (n + 1)
Center-to-center = gap + baluster width

A section with n balusters has n + 1 gaps: one on each side of each baluster, including the gaps at the posts. Setting every gap to the maximum and solving for n gives the minimum count, and rounding up ensures the actual gap is a bit smaller than the limit.

Worked example: a 72 inch section with 2×2 balusters

  1. Count: (72 − 4) ÷ (1.5 + 4) = 68 ÷ 5.5 = 12.36, rounded up to 13 balusters.
  2. Total baluster width: 13 × 1.5 = 19.5 in; space left: 72 − 19.5 = 52.5 in.
  3. Gap: 52.5 ÷ 14 = 3.750 in (less than 4 in).
  4. Center-to-center: 3.750 + 1.5 = 5.250 in.

Balusters per section (1½ in balusters, 4 in maximum gap)

SectionBalustersGap (in)Center-to-center (in)
3 ft63.8575.357
4 ft84.0005.500
5 ft113.6255.125
6 ft133.7505.250
8 ft173.9175.417
10 ft223.7835.283
12 ft263.8895.389

Installing balusters

  • Start in the middle. Set the center baluster first if the count is odd, then work outward, so any error ends up symmetrical.
  • Use a spacer. Cut a block to the gap size, and drop it between balusters rather than measuring each one.
  • Check at the end. The last gap beside the post should match the others. If it is a little off, spread the difference over several gaps.
  • Fasten properly. Use screws or brackets rated for outdoor use, and predrill ends to avoid splitting.
  • Check the height. Guards must typically be at least 36 inches high on residential decks, with 42 inches for commercial; follow local rules.

Stairs

On stair railings the balusters follow the slope of the rail. Measure the gap horizontally, on the narrowest line, and use the stair code for the triangular opening above the tread. The Stair Calculator helps lay out the treads.

Plan the deck itself with the Deck Calculator and Deck Flooring Calculator. Corner layouts can be checked with the Squaring Calculator, and fence panels and posts are covered by the Fence Calculator.

Frequently asked questions

How many balusters do I need for a 6-foot railing section?

A 72 inch clear space with 1½ inch balusters and a 4 inch maximum opening needs 13 balusters, with gaps of 3.75 inches.

What is the 4-inch rule?

The International Residential Code requires that guards have no openings through which a 4-inch diameter sphere can pass (R312.1.3). Local codes may differ, and stair guards have an extra rule for the triangle at the tread.

How do I calculate baluster spacing?

Spacing = (opening − number of balusters × baluster width) ÷ (number of balusters + 1). The number of balusters is the smallest whole number that keeps the gap at or below the limit.

Should I space balusters center to center?

Center-to-center spacing is baluster width plus the gap. Cut a spacer block to the gap size, or mark the rail at the center-to-center distance, to install quickly.

Do stairs follow the same rule?

Stair guards use the same 4-inch sphere rule, with the exception that the open triangle formed by the riser, tread and bottom rail may allow a 6-inch sphere. Balusters on a rake are spaced along a sloped rail; measure the plumb gap in the narrowest place.

Related calculators

Last updated October 25, 2026. Found a problem with this calculator? Tell us.