The 4-Inch Sphere Rule for Deck Railings and Stairs
Last updated: 2026-12-02 · SawhorseMath Editorial
Railing codes don't measure gaps with a ruler — they use an imaginary ball. If a sphere of a given size can pass through an opening, the opening fails. The idea is simple: a small child's head shouldn't fit through. Here's where each sphere size applies on a deck.
The three sphere sizes
- 4 inches — deck guards. No opening in a required guard may let a 4" sphere through: between balusters, under the bottom rail, and between a baluster and the post.
- 4 3/8 inches — the sides of stairs. Along the open sides of stair treads, the limit is slightly larger.
- 6 inches — the stair triangle. The triangle formed by a tread, its riser and the bottom rail of the stair guard may not pass a 6" sphere.
These limits apply to required guards: open sides of decks, stairs and landings more than 30" above the floor or grade below, measured within 36" of the edge (IRC R312.1.1).
"Less than 4 inches" means less
A gap of exactly 4" fails — the sphere fits. Aim well under. We suggest aiming for about 3 1/2", which leaves room for boards that shrink or twist over time. Our baluster spacing calculator caps your gap at 3 7/8" so a rounded measurement can never read 4".
Open risers
Stairs may have open risers (no board between treads), but DCA 6 says the opening must not pass a 4" sphere — the rule our deck pages follow; our stair stringer calculator uses the IRC rule below. The 2021 IRC applies the 4" limit to open-riser openings more than 30" above the floor or grade below (R311.7.5.1), and some older editions exempted stairs with a total rise of 30" or less — check your town's edition before relying on any exception.
Benches and other guards
If a built-in bench takes the place of a guard, the openings under and around it must also stop a 4" sphere — and the guard height should be measured from the seat, not the deck. Glass, cable and other railing systems must meet the same opening rules, be approved by your building department, and be installed to the manufacturer's instructions.
How to check a railing
- Use a 4" ball (or a 4"-diameter round disc) as a gauge — not a tape measure or a square block, which can be stopped by a triangular or odd-shaped gap that a ball would slip through.
- Try it in every opening: between balusters, under the bottom rail, beside each post, and under benches.
- On stairs, use a 4 3/8" gauge at the sides of the treads and a 6" gauge in the bottom-rail triangle, and a 4" gauge in any open riser.
- Recheck after a season — wood balusters can shrink and twist.
Related
- Deck railing calculator — posts, balusters and a shopping list.
- Deck stair calculator — when a stair guard is required.
Source: American Wood Council, DCA 6 (2015 IRC edition). Code section numbers change between IRC editions — your local building department has the final word.