Guardrail Baluster Spacing Guide

Why the 4″ sphere exists, how to measure the opening, and how to divide a bay that refuses to come out even

Baluster spacing is one of the few things on a deck where the code gives you a shape instead of a dimension. IRC R312.1.3 does not say “balusters at 5″ on center.” It says a 4″-diameter sphere shall not pass through any opening in a required guard, from the walking surface up to the required guard height. Everything else — count, gap, on-center — is arithmetic you do to satisfy that sphere. The baluster spacing calculator does the arithmetic. This page is why it works and where crews get it wrong.

Failures in the field: troubleshooting. Choosing infill before you measure anything: baluster vs cable vs glass.

Starting point only. This page explains the published sphere-passage rule in the IRC. It is not the adopted code in your jurisdiction, it is not a permit, and it does not cover guard height, load capacity, or engineered guards. Confirm with your building department before you buy balusters for a whole deck.

Have the opening measured?Baluster count, real clear gap, and the on-center number to pull.

Open Calculator →

Jump to what you need

Why It Is A Sphere, And Why It Is Four Inches

The rule is a child-safety rule, and the sphere is a stand-in for a small child’s head and torso. The reasoning behind the four-inch dimension is that an infant or toddler should not be able to push a body through an opening in a guard and fall, and should not be able to get a head through an opening and become trapped. A sphere is used instead of a slot dimension because it has to fail in every direction — you cannot satisfy the rule with a gap that is narrow one way and wide the other.

That is also why the rule runs from the walking surface all the way up to the required guard height, not just across the middle of the panel. The gap under the bottom rail counts. The gap where a baluster dies into a stringer counts. A decorative cutout in a post counts. Anywhere a sphere can start on the deck side and come out the open side, the rule applies.

Two exceptions show up in the residential code and get abused constantly. The triangular opening formed by the tread, riser, and bottom rail of a guard on the open side of a stair is allowed a larger sphere — 6″ in the IRC. Some code editions also allow 4-3/8″ on the open side of stair treads. Neither exception applies to a level deck bay. If you are looking at a flat run of guardrail, the number is 4″.

Do not design to the exception. Inspectors carry a 4″ sphere, not a menu of exceptions. If you plan a level bay at 4-1/4″ clear because you read about the stair-tread allowance, you will be pulling balusters. Enter 4.0 in the calculator unless your building department has told you otherwise in writing.

How To Measure The Rail Opening

The input the calculator wants is the clear opening: inside face of one post or newel to the inside face of the next. Not center to center. Not the length of the top rail you cut. Not the post spacing off the framing plan.

Those distinctions matter more than they sound. A 96″ on-center post layout with 4x4 posts gives you a clear opening of about 92-1/2″, because you lose half a post at each end. Feed 96 into the math and you will come up short on balusters for the bay you actually have — and the gaps will run wide.

Measure it in three places

Posts lean. Top rails bow. Bottom rails get pushed out by a foot during install. Take the clear dimension near the top rail, near the bottom rail, and at mid-height. If they are not the same, use the largest number. The sphere only has to pass in one spot to fail the bay.

Watch what the baluster actually lands on

If the balusters are captured between a top and bottom rail, the clear opening is between the rails’ end blocks or between the posts, depending on the system. If they face-mount to the rim joist, the opening is post to post at the rim. Measure the surface the balusters will physically sit against, because that is where the gap lives.

Common measurement trapFraming plan says posts at 8′-0″ o.c. Actual 4x4 posts are 3.5″ square. Clear opening = 96 − 3.5 = 92.5″. At 1.5″ balusters and a 4″ sphere, both numbers happen to call for 17 balusters — but the layout is not the same. Using 96 puts the first baluster face 3.92″ off the post and runs 5.42″ on-center; the real 92.5″ opening wants 3.72″ and 5.22″. Pull the wrong increment down the bay and the last baluster lands more than 3″ past where it belongs.

Clear Gap Versus On-Center Spacing

These are two different numbers and mixing them is the single most common way a deck fails a guardrail inspection.

Clear gap is the air between two adjacent balusters — face to face. This is what the inspector measures with the sphere. It must be at or under 4″.

On-center is baluster centerline to baluster centerline. It equals the clear gap plus one baluster width. This is what you mark on the rail with a tape, because pulling a running dimension is faster and more accurate than measuring each gap individually.

on-center = clear gap + baluster width  ·  clear gap = on-center − baluster width

With 1.5″ wood balusters, a 4″ clear gap is 5.5″ on-center. That is where the old shop rule of “2x2s at 5-1/2 on center” comes from — and it is exactly at the limit, with zero margin. With 0.75″ aluminum balusters, a 4″ clear gap is only 4.75″ on-center. Same code, very different layout, because the stock is half as wide.

“Balusters at 5-1/2 o.c.” is not a code rule. It is a rule of thumb that happens to hit exactly 4.00″ clear with exactly 1.5″ stock in a perfectly straight rail. Cup one baluster, rack another, and you are over. It also fails outright the moment you switch to 1″ or 0.75″ balusters.

Dividing The Bay Evenly — And Why You Round Up

Start from the geometry. If a bay has N balusters, it has N+1 clear gaps: one against each post face plus N−1 between balusters. The stock takes up N×W of the opening, and the remaining air divides evenly among those N+1 gaps.

clear gap = (L − N×W) ÷ (N + 1)

Set that gap equal to the maximum sphere S and solve for the smallest N that satisfies it:

N = ceil( (L − S) ÷ (W + S) )

The ceiling is not a rounding preference. It is the rule. The raw division tells you the exact fractional number of balusters that would land the gap precisely at 4″. Fractional balusters do not exist, so you go to the next whole one — which makes every gap slightly tighter than the limit. Round down instead and every gap in the bay opens up past 4″ at once. Not one gap. All of them.

Why the ends are gaps too

A lot of crews lay out by dividing the opening into N equal segments and putting a baluster at each division line. That gives you N−1 balusters and two half-width end gaps that are wrong. The correct layout starts with air at the post: measure one clear gap in from the post face, set the first baluster, then run at on-center increments. The last gap lands on its own if the math was right.

Sanity check on the rail. N balusters × width, plus (N+1) gaps, has to equal the opening. 17 balusters at 1.5″ is 25.5″ of wood. In a 92.5″ opening that leaves 67″ of air across 18 gaps = 3.72″ each. If your tape says otherwise at the far post, something drifted.

Worked Example: An Opening That Does Not Divide Evenly

Take a real bay. Clear opening L = 92.5″ (8′ post layout with 4x4 posts). Baluster W = 1.5″ (2x2 stock). Sphere S = 4.0″.

Step 1 — raw count. (92.5 − 4.0) ÷ (1.5 + 4.0) = 88.5 ÷ 5.5 = 16.09 balusters.

Step 2 — round up. 16.09 becomes 17 balusters. Not 16. Sixteen would need a gap of (92.5 − 24.0) ÷ 17 = 4.03″ — over the sphere in every single gap by 1/32″. That is a fail you can feel with your fingertip, and it is a fail seventeen times over.

Step 3 — actual gap. (92.5 − 17×1.5) ÷ 18 = (92.5 − 25.5) ÷ 18 = 67.0 ÷ 18 = 3.72″ clear — call it 3-3/4″ on a tape. That is 0.28″ of margin under the sphere — enough to absorb a cupped baluster or a post that moved 1/8″.

Step 4 — on-center. 3.72 + 1.5 = 5.22″ on-center, about 5-1/4″. That is the running increment you pull down the rail.

Step 5 — layout. From the inside face of the left post, mark 3.72″ for the near face of baluster #1. Then mark every 5.22″ after that for the next sixteen near faces. Baluster #17’s far face should land 3.72″ short of the right post. If it does not, your opening measurement was off or your marks drifted.

Notice what rounding down costs16 balusters saves you one 36″ piece of 2x2 — about two dollars of material — and fails the bay by three hundredths of an inch. Seventeen balusters costs two dollars and passes with a quarter inch to spare. This is never a close call.

Same bay, aluminum balusters

Swap to 0.75″ square aluminum in the same 92.5″ opening. (92.5 − 4.0) ÷ (0.75 + 4.0) = 88.5 ÷ 4.75 = 18.63, round up to 19 balusters. Gap = (92.5 − 14.25) ÷ 20 = 3.91″. On-center = 4.66″. Narrower stock means more pieces and a tighter on-center, which is exactly why you cannot carry one o.c. number between systems.

Run your actual bay.The calculator does the ceiling, re-verifies the resulting gap against the sphere, and gives you both the clear gap and the on-center to mark.

Open Calculator →

Marking And Installing Without Losing The Math

  1. Straighten the rail first. Set and plumb the posts, install the top and bottom rails, and check the top rail with a 48″ level before you mark anything. Layout on a bowed rail is fiction.
  2. Pull one running dimension, not a chain of individual gaps. Hook the post face, mark every on-center increment down the tape in one pull. Measuring gap-by-gap stacks your errors and the last gap eats all of them.
  3. Mark the same face every time. If your first mark is the near face of the baluster, every mark is a near face. Switching between centerlines and faces mid-rail shifts everything by half a baluster width.
  4. Cut all balusters off one stop block. Consistent length keeps the bottom gap consistent. Cutting to a redrawn pencil line gives you a wandering bottom edge and a sphere that passes underneath somewhere.
  5. Square each baluster before you fasten. A baluster racked a few degrees narrows one gap and widens the neighbor. The sphere finds the wide one.
  6. Fasten it like it has a load on it. Guard infill has to resist a 50 lb concentrated load over one square foot per IRC Table R301.5. A brad nail through a pilot hole is not that. Use structural screws.
  7. Check the bottom. Measure from the deck surface to the bottom rail. A 4″ sphere that rolls under the bottom rail is the same violation as one that goes between balusters, and it is the gap people forget.
Buy one extra baluster per bay. Between a split, a cupped piece, and a bay that came in 1/2″ wider than the plan, you will use them. Coming up one short at 5 p.m. is how “we’ll just stretch this last gap” gets said out loud.

What Spacing Does Not Cover

Guard height. IRC R312.1.2 sets a minimum guard height — commonly 36″ for residential decks measured from the walking surface, with different requirements for stairs and for commercial work under the IBC. Perfect spacing on a short guard is still a failed guard.

Load capacity. Table R301.5 requires the top rail to resist a 200 lb concentrated load in any direction, and infill components to resist 50 lb over one square foot. That governs your post-to-framing connection, your rail-to-post connection, and your baluster fasteners.

The sphere below the bottom rail and beside the post. The rule applies to every opening in the guard, including the strip under the bottom rail, the gap where the rail dies into a house wall, and any decorative cutout.

Rake guards on stairs. Balusters on a sloped rail are laid out along the rake, and the vertical geometry changes the effective opening. Get the stairs right first: deck stair calculator and stair stringer calculator.

Whether balusters are the right infill at all. Cable and glass follow entirely different rules and cost curves: baluster vs cable vs glass.

FAQ

Is baluster spacing measured on-center or clear?

The code measures clear — a 4″ sphere has to fail to pass through the air between balusters. On-center is a layout convenience that equals the clear gap plus the baluster width. Never hand an inspector an on-center number as proof of compliance.

Can I use 5-1/2″ on center?

Only with exactly 1.5″ balusters, and it lands you at exactly 4.00″ clear with no margin at all. Any cup, rack, or measurement drift puts you over. Run the actual bay and take the extra baluster.

Do the gaps at the posts count?

Yes. A bay with N balusters has N+1 gaps and the two end gaps are the ones most often blown. Lay out from the post face with a gap, not with a baluster.

What if my opening divides evenly at exactly 4″?

Add one baluster. A result that sits exactly on the limit has zero field tolerance, and nothing on a deck is built to zero tolerance.

Does the 4″ sphere apply under the bottom rail?

Yes. The rule runs from the walking surface to the required guard height. The strip between the deck boards and the bottom rail is an opening in the guard like any other.

Are stair guards different?

Sloped rake guards have limited exceptions — notably a 6″ sphere for the triangular opening at the tread, riser, and bottom rail, and in some editions 4-3/8″ on the open side of treads. Those do not apply to level bays, and jurisdictions vary. Confirm before you lay out a stair guard to anything looser than 4″.

My jurisdiction says something different than the IRC.

Then your jurisdiction wins. The adopted code and its local amendments are the law where you are building. The IRC is the model. Ask the building department, and get it in writing if it changes your material order.

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 by 24 inch framing square

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 inch box beam level

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 inch circular saw

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 for a framing square

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

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 →
Deck stair calculator

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.

Related Carpentry & Deck Calculators