Article — Spindle Spacing Calculator
Spindle spacing calculator: baluster count and IRC code compliance
Spindle spacing on a residential deck or balcony must keep every gap at or below 4 inches per IRC R312, measured by a 4-inch test sphere. For a 10-foot railing with 1.5-inch wood balusters, the minimum count is 22 balusters with 3.78-inch gaps. Stair sides allow up to 4-3/8 inches.
Spindle spacing seems like simple geometry until you realize that one missed calculation can fail a building inspection or, more importantly, trap a child's head. The 4-inch sphere rule encoded in the International Residential Code (IRC) and International Building Code (IBC) is not arbitrary — it reflects decades of injury data and matches the head dimension of a typical small child. This calculator solves for the minimum baluster count that satisfies the rule while keeping gaps even and visually clean.
What is spindle spacing?
Spindle spacing, also called baluster spacing, is the clear gap between two adjacent vertical members in a guard or railing. The members themselves are called spindles (a woodworking term) or balusters (an architectural term). Same component, different vocabulary. Both terms appear in code documents and building plans interchangeably.
The measurement is taken at the narrowest point between balusters. For square wood balusters that is the flat-to-flat width. For round iron balusters that is the surface-to-surface gap, which equals the on-center distance minus the diameter. The 4-inch sphere test enforces this narrowest-gap measurement directly: if the sphere cannot pass at any orientation, the spacing is compliant.
The IRC 4-inch spindle rule
IRC R312.1.3 states that guards must have intermediate rails or ornamental closures arranged so that a 4-inch diameter sphere cannot pass through any opening. The same rule appears in IBC 1015.4 for commercial construction. This is the central safety requirement for any railing protecting against falls.
The rule has two stated exceptions. First, the open side of stair guards allows a 4-3/8 inch sphere because diagonal layout makes strict 4-inch geometry awkward. Second, the triangle below the lowest tread of a stair allows a 6-inch sphere because that opening is typically inaccessible to a child climbing. Outside these exceptions, the 4-inch limit is firm.
The 4-inch sphere standard originates from a 1976 National Bureau of Standards study on child head dimensions. The 95th percentile head diameter for children aged 2-5 is approximately 4.4 inches. The 4-inch rule provides a margin below this measurement and accounts for compression of soft tissue when a child's head is forced through a gap.
How to calculate baluster spacing
The baluster spacing formula is S = (RL - N × SW) / (N + 1), where RL is the railing length between posts, N is the number of balusters, and SW is each baluster width. The formula gives equal gaps when balusters are distributed evenly across the railing.
The minimum baluster count comes from setting S = 4 inches (the code maximum) and solving for N: N_min = ceil((RL - 4) / (SW + 4)). Round up to the next whole baluster. The resulting spacing will always be less than 4 inches because the formula rounds count upward, not spacing.
A worked example: 120-inch railing with 1.5-inch wood balusters. N_min = ceil((120 - 4) / (1.5 + 4)) = ceil(116 / 5.5) = ceil(21.1) = 22 balusters. Actual spacing: (120 - 33) / 23 = 3.78 inches. Code compliant with margin.
Rounding the count down lets gaps exceed 4 inches and fails inspection. The calculator always rounds up. Even when the math gives N = 21.001, the answer is 22 balusters. Wasting one baluster of material is far cheaper than rebuilding a non-compliant railing.
Baluster spacing by material
Baluster material affects the count because each material has a typical width. Wood square balusters are usually 1.5 inches. Wood turned (decorative) balusters can range from 1.5 to 2.5 inches at the widest point. Iron pickets are typically 0.5 or 0.625 inches square or round. Composite balusters often match wood at 1.5 inches.
The thinner the baluster, the more balusters you need. For a 10-foot railing: 1.5-inch wood needs 22 balusters; 0.625-inch iron needs 26 balusters; 0.5-inch iron needs 27 balusters. The total spindle width matters because it shrinks the available gap space across the railing.
The stair spindle exception
Stair railings get a 4-3/8 inch maximum gap because the diagonal layout creates geometric problems. If balusters are mounted perpendicular to the stair stringer, the spacing measured between adjacent balusters at the angle of the stair would exceed the 4-inch horizontal spacing without the exception. The 4-3/8 inch allowance preserves a consistent visual rhythm.
The triangular gap formed at the bottom step between the lowest tread, the lowest riser, and the bottom rail is allowed to pass a 6-inch sphere. This unusual exception exists because the triangle is hard to climb and not a typical entrapment risk. Designers can also choose to close this triangle entirely for aesthetic or safety reasons.
Layout balusters from the center of the railing outward rather than from one end. Center-out layout splits any rounding error symmetrically, putting half at each end. End-to-end layout puts all the error at one end where it looks unbalanced. Mark the center, snap a chalk line, and step outward with your on-center dimension.
Common spindle spacing mistakes
The most common error is measuring on-center spacing instead of gap spacing. The IRC measures the clear gap between baluster surfaces, not center-to-center distance. For 1.5-inch wide balusters, 4-inch on-center equals only 2.5-inch gap — compliant. But 5-inch on-center gives 3.5-inch gap — still compliant. And 6-inch on-center gives 4.5-inch gap — failed. Always confirm gap, not on-center.
A second mistake is forgetting the end gaps. Many DIY layouts place balusters on the post centers and assume the gap rule applies only between balusters. But the gap between the first baluster and the post must also satisfy 4 inches. The formula here accounts for N+1 gaps (two ends plus N-1 internal).
S_max 4 in (102 mm) residentialS_max stairs 4-3/8 in (111 mm)S_max triangle 6 in (152 mm)Guard height resi 36 in (914 mm) minGuard height comm 42 in (1067 mm) minTest method 4-in sphere passes throughInternational baluster codes
The 4-inch sphere rule is essentially universal in jurisdictions following the International Code Council framework. The UK Building Regulations Part K specifies a 100 mm sphere — almost identical at 3.94 inches. Australia's NCC Volume 2 uses 125 mm in some applications but defaults to 100 mm for residential. The EU broadly follows 100 mm via national codes, though Germany and Scandinavia use 110 mm in some configurations.
The practical effect is that a deck built to IRC 4-inch standards passes inspection almost everywhere. Going stricter (closer baluster spacing) never violates code. Going looser (wider spacing) almost always does. When designing for international use, default to the IRC 4-inch limit and confirm any local exceptions before construction.
- 4 inches maximum gap between balusters on decks, balconies, and landings (IRC R312)
- 4-3/8 inches maximum on the open side of stair guards (IRC R312 exception)
- 6 inches maximum in the triangle below the lowest stair tread
- 36 inches minimum guard height residential, 42 inches commercial
- 1.5 inches typical wood square baluster width
- 0.5 inches typical iron picket width
- 22 balusters minimum for 10-foot railing with 1.5-inch wood balusters
- 1976 NBS study that set the 4-inch sphere standard