Code and safety · 6 min read
Railing Height & Spacing: Code Basics
The 36"/42" rule, the 4-inch sphere test, and where guard rails are required at all.

Codes vary by state and municipality — always confirm locally. That said, most U.S. residential projects fall under IRC rules.
When a guard is required
Any walking surface more than 30 inches above grade needs a guard rail at least 36 inches tall (42 inches in some states, and typically 42 inches for commercial IBC projects).
The 4-inch sphere rule
No opening in the guard may pass a 4-inch sphere. For cable railing this drives cable spacing (3 inches on center is standard) and proper tension.
Stair rail specifics
Handrail height: 34–38 inches above the stair nosing.
Graspable profile: 1-1/4" to 2" round, or equivalent.
The triangle at the stair/guard/tread junction may pass a 6-inch sphere.