Guardrail Baluster Spacing Calculator
Baluster count, actual clear gap, and on-center layout for one rail opening — sized so a 4″ sphere cannot pass (IRC R312.1.3)
Enter the clear rail opening between posts, the actual baluster width, and the maximum sphere your code allows. The tool returns how many balusters that bay needs, the real clear gap you will end up with, and the on-center number you mark on the rail. It always rounds the count up — rounding down is how a bay fails the sphere. This is a starting point based on published geometry, not a substitute for your adopted local code, the inspector’s sphere, or a design professional on engineered guards.
Why the four-inch rule exists and how to measure the opening: baluster spacing guide. Bays that failed inspection, drifting layout, and loose infill: troubleshooting. Picking infill in the first place: baluster vs cable vs glass.
Stairs the rake guard follows: Deck Stair Calculator and Stair Stringer Calculator. The frame underneath: Deck Post Spacing Calculator. Everything else: carpentry calculators hub.
How to Use This Guardrail Baluster Spacing Calculator
Measure the bay first, then run the math. The clear rail opening is inside face of post to inside face of the next post — the space the infill actually has to fill. Measure the baluster you bought, not the one on the label: a 2x2 is 1.5″, a square aluminum baluster is often a true 0.75″. Leave the sphere at 4.0″ unless your jurisdiction says otherwise.
The result gives you three numbers that matter on the rail. Baluster count is what you cut. Clear gap is what the inspector measures. On-center is what you pull with a tape: mark from one post face at the on-center increment, and the first baluster face lands one clear gap in.
L = clear rail opening · W = actual baluster width · S = maximum sphere · N balusters create N+1 clear gaps
Worked method with an opening that does not divide evenly: the guide. When the field result does not match the math: troubleshooting.
What This Number Is (and Is Not)
This is pure geometry. Given a clear opening, a baluster width, and a sphere diameter, there is exactly one smallest whole number of balusters that keeps every gap at or under the sphere. The calculator finds it and then reports the gap you actually get, which is almost always tighter than the limit — that is the point of rounding up.
There are N balusters and N+1 gaps
The gap count is the part people get wrong. Thirteen balusters in a bay produce fourteen clear gaps: twelve between balusters plus one against each post face. Those two end gaps fail inspections constantly, because crews lay out from a baluster instead of from the post and let the leftover pile up at one end.
What it does not cover
Guard height (36″ minimum for most residential decks, R312.1.2), the top-rail and infill load cases in Table R301.5, the connection of the guard post to the framing, rake-guard geometry on stairs, and any local amendment that is tighter than the IRC. It also assumes a straight top rail and plumb posts. A rail that bows in the middle gives you a wider clear opening at midspan than the number you measured at the post.
Layout Gear For Baluster Bays
The four-inch sphere rule is arithmetic. Holding that arithmetic across a 12-foot rail is a layout problem — square marks, a straight top rail, repeatable cuts, and fasteners that keep the baluster where you set it.
16×24 Framing Square
Square the baluster to the rail before you drive anything. A baluster racked 3° in the bay eats clear gap on one side and gives it back on the other — and the inspector's sphere finds the wide side.
View on Amazon →
48" Box Beam Level
Check the top rail before you lay out spacing. A rail that dips in the middle means your measured opening and your installed opening are two different numbers.
View on Amazon →
7-1/4" Circular Saw
Cut balusters to one story length off a stop block, not to a pencil line you redraw every time. Length consistency is what keeps the bottom gap from wandering.
View on Amazon →
Johnson Stair Gauges
Rake guards on stairs are a different layout than a level bay. Lock rise and run on the square when the same guardrail follows the stringer down.
View on Amazon →
Simpson SDWS Timber Screw
Baluster spacing only passes if the baluster stays put. Guard infill has to resist a 50 lb concentrated load over one square foot (IRC Table R301.5) — a finish nail is not that.
View on Amazon →
Stairs Off The Same Deck
Rise, run, and stringer layout for the stairs the rake guard follows. Different rule set, same job.
Open Deck Stair Calculator →As an Amazon Associate, TestTalkHQ earns from qualifying purchases. The live affiliate CSV has no baluster connectors, cable rail kits, swage fittings, or glass channel — those SKUs are flagged as a catalog gap rather than invented as search links.