The International Residential Code (IRC) requires that openings in deck railings be small enough that a 4-inch sphere cannot pass through. Getting baluster spacing right means your deck passes inspection and keeps kids and pets safe — while avoiding the cost of buying too many balusters or the headache of ripping them out and starting over.

Calculate baluster spacing for your deck →

Enter your span and baluster size to get the exact count and gap.

What the code requires

The relevant code is IRC Section R312.1.3 (guards). The key requirements:

Important: Local jurisdictions can and do amend the IRC. Some areas require 3.5-inch maximum openings or taller guard heights. Always check with your local building department before starting work.

How to calculate spacing

Here's the step-by-step process with a worked example.

Given: 72-inch span between posts, 1.5-inch wide balusters (standard 2×2 stock).

Step 1: Determine minimum balusters

Divide the total span by the maximum spacing unit (one baluster width + one maximum gap):

72 ÷ (1.5 + 4) = 72 ÷ 5.5 = 13.09

Round up: you need at least 13 balusters.

Step 2: Calculate actual gap

With 13 balusters in a 72-inch span, there are 14 gaps (one on each side of each baluster, plus the gaps between the end balusters and the posts).

Total baluster width: 13 × 1.5 = 19.5 inches

Remaining space: 72 − 19.5 = 52.5 inches

Gap size: 52.5 ÷ 14 = 3.75 inches

Step 3: Verify compliance

3.75 inches is less than 4 inches. A 4-inch sphere will not pass through. This layout is code-compliant.

Installation tips

Common mistakes

Center-to-center vs. clear gap

The code measures the clear opening — the daylight between balusters. If you space balusters at 5.5 inches center-to-center with 1.5-inch balusters, the clear gap is 4 inches. That fails the 4-inch sphere test because 4 inches equals the sphere diameter exactly. You need the gap to be less than 4 inches, not equal to it.

Forgetting post width

Measure the clear span between the inside faces of your posts, not the center-to-center post distance. If your posts are 3.5 inches wide and spaced 8 feet on center, your clear span is 96 − 3.5 = 92.5 inches, not 96.

Manufacturing variation

Balusters from the lumberyard aren't perfectly uniform. A "1.5-inch" baluster might actually be 1.45 or 1.55 inches. If you're cutting it close to the 4-inch limit, measure a sample of your actual balusters and use the narrowest width in your calculation. Better yet, target a gap of 3.5 inches or less for a comfortable safety margin.

Local code differences

Some jurisdictions have stricter requirements than the IRC. California, for example, has seismic and wind considerations that can affect railing construction. Some HOAs impose their own design requirements on top of code. Always pull your local code before finalizing a design.

Use the Baluster Spacing Calculator →

Enter your span and baluster dimensions. Get the exact count, gap size, and code compliance check.