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. No gap in the railing may let a 4-inch (10.16 cm) sphere pass through it. 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. Most local codes also set a minimum railing height: 36 inches (91.4 cm) for residential decks and 42 inches (106.7 cm) for commercial buildings. 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.
These figures match the method used by other published baluster calculators. For a 120-inch rail with three 3.5-inch posts, leaving 109.5 inches of clear span, the same formula with a 1.5-inch baluster and a 4-inch gap gives 20 balusters, consistent with the worked example published by Inch Calculator.
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.
For stairs, measure along the sloped rake of the stair stringer, not the horizontal run. A staircase with a 10-foot horizontal run and a 7-foot rise has a longer railing length along the slope, and using the horizontal measurement alone will leave the project short of balusters. The 4-inch sphere rule still applies, measured perpendicular to the rail.
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). 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 railings are measured along the sloped rake of the stringer, not the horizontal distance the stairs cover. The sphere rule still applies measured perpendicular to the rail, so balusters on a steep stair appear closer together than on a level deck, which is expected and correct.