Baluster Spacing Calculator - Deck & Stair Railing Tool
Calculate the number of balusters and the actual clear gap for deck, stair, and porch railings, based on the 4-inch maximum opening in the IRC building code.
Baluster Spacing Calculator
Calculate the number of balusters needed and spacing between them for your railing project.
Project Dimensions
Enter the clear span between posts. Building code (IRC R312.1.3) limits the opening to 4 in: a sphere 4 in in diameter must not pass between balusters. The gap shown is a clear opening, not a centre-to-centre distance. A 2x2 wood baluster is 1.5 in wide; typical metal balusters are 0.75 in.
Results
Visualization
Balusters sit between the posts, so N balusters create N + 1 clear openings. The calculator finds the smallest number of balusters that keeps every opening within your maximum:
Number of Balusters: ceil((96 â 4) á (4 + 1.5)) = 17
Actual Clear Gap: (96 â 17 Ă 1.5) á 18 = 3.92 in
Documentation
A baluster spacing calculator finds how many balusters a railing needs and the exact clear gap between them, so the gap stays within the maximum allowed by building code. Balusters, also called spindles, are the vertical bars between a handrail and the floor or deck surface. Correct spacing keeps people, especially small children, from slipping through the railing.
The 4-inch sphere rule
In the United States, the International Residential Code (IRC) Section R312.1.3 sets the opening limit for guards, the safety barriers along decks, stairs, and porches. Guard openings must not allow a 4-inch (10.16 cm) sphere to pass through. Building inspectors check this with a 4-inch ball. If the ball fits through a gap, the railing fails inspection.
This is a maximum clear opening, meaning the empty space between two balusters, not the distance from the center of one baluster to the center of the next. Codes also set a minimum guard height. Guards generally must be at least 42 inches (106.7 cm) high, with a 36-inch (91.4 cm) minimum allowed for single-family homes. Local building departments sometimes set stricter rules than the IRC, so it is worth checking before buying materials.
How to calculate baluster spacing
Balusters sit between two end posts, so N balusters divide the span into N + 1 openings, not N openings. A railing with 3 balusters, for example, has 4 gaps: one before the first baluster, one between each pair of balusters, and one after the last.
The calculator needs three numbers:
- Total length: the clear span between the inside faces of the end posts, in inches.
- Maximum clear gap: the largest opening allowed, in inches (4 by default, per IRC R312.1.3).
- Baluster width: the thickness of one baluster, in inches (1.5 for a standard 2x2 wood baluster, about 0.75 for many metal balusters).
Each baluster takes up part of the span, so its width has to be subtracted before the remaining length is divided into openings. The formulas are:
The ceiling function (â â) rounds up to the next whole baluster. Rounding up, rather than down, guarantees the resulting gap never exceeds the maximum, because one extra baluster shrinks every opening slightly. The result is the smallest number of balusters that still keeps every gap within the limit.
A span no wider than the maximum gap already complies on its own and needs zero balusters.
Example
A deck section has a clear span of 96 inches (8 feet) between posts, a 4-inch maximum gap, and 1.5-inch wide balusters (a standard 2x2).
Number of balusters:
Actual clear gap:
Seventeen balusters produce a clear gap of about 3.92 inches, which meets the 4-inch code limit. A shorter, 72-inch section with the same 4-inch gap and 1.5-inch balusters needs 13 balusters, giving a clear gap of 3.75 inches.
Baluster width changes the count
A thicker baluster needs fewer balusters over the same span, because more of the span's length is already used by the balusters themselves, so the remaining openings reach the maximum gap sooner. A thinner metal baluster needs more pieces to keep every gap under the limit. Over a 96-inch span with a 4-inch maximum gap, 1.5-inch wood balusters require 17 pieces, while 0.75-inch metal balusters require 20.
Measuring a railing
Measure the clear span between the inside faces of the two end posts, not the outside edges of the whole railing assembly. Measuring the outside edges adds the width of both posts to the total and produces the wrong baluster count.
Stair guards follow slightly different limits. At the sides of stair treads, openings may be sized to stop a 4 3/8-inch sphere. The triangle formed by a riser, a tread and the bottom rail may stop a 6-inch sphere. To check a stair guard, enter 4.375 as the maximum gap. With vertical balusters, the gap between two balusters is measured level, so the horizontal distance between the stair posts gives the matching clear gap. Measuring along the slope gives a longer length and a more cautious count.
Clear gap versus center-to-center spacing
The calculator reports the actual clear gap, the open space between two balusters, which is the number an inspector measures directly against the 4-inch limit. Installers sometimes prefer to mark positions center-to-center, from the middle of one baluster to the middle of the next, because it is easier to measure while laying out drill points.
To convert, add the baluster width to the clear gap:
For the 96-inch example above, a 3.92-inch clear gap with 1.5-inch balusters gives a center-to-center mark of 5.42 inches.
Frequently asked questions
What is the maximum allowed spacing between balusters? In most U.S. jurisdictions, the IRC caps the clear opening at 4 inches (R312.1.3), or 4 3/8 inches at the sides of stair treads. Some local codes are stricter, so it is worth confirming with the local building department before construction begins.
How many balusters does a deck railing need? It depends on the clear span, the maximum gap allowed, and the baluster width. For a 96-inch span with a 4-inch maximum gap and 1.5-inch balusters, the answer is 17. Wider balusters or a shorter span reduce the count; a narrower maximum gap increases it.
Is the calculator's spacing result a clear gap or a center-to-center measurement? It is the clear gap, the actual open space between balusters, which is what a building inspector checks against the code limit. To mark center-to-center positions during installation, add the baluster width to the clear gap.
Does a very short railing section need balusters at all? No. If the total span is already narrower than the maximum allowed gap, no balusters are required, because no opening in that span can be wide enough to violate the sphere rule.
Does baluster thickness affect how many are needed? Yes. A thicker baluster occupies more of the span itself, so fewer are needed to keep the remaining gaps under the limit. A thinner baluster needs more pieces to do the same job.
How is a stair railing measured differently from a deck railing? Stair guards may have openings up to the size that stops a 4 3/8-inch sphere, slightly more than the 4 inches allowed on a deck. With vertical balusters, the clear gap is measured level, so the horizontal distance between stair posts is the length that matches it.
References
- City of Spokane. Prescriptive Deck Construction Guide (2018 IRC). Spokane deck construction guide â guard openings must not pass a 4-inch sphere (R312.1.3).
- City of Bremerton, Department of Community Development. Guardrails and Handrails. Bremerton guardrails handout â guard heights of 42 inches and 36 inches for single-family homes; 4 3/8-inch sphere at the sides of stair treads; 6-inch sphere in the riser, tread and bottom rail triangle.