Stairs are one of the most common sites of serious household injuries, and the railing is the first line of defense. Stair rail code exists to keep that railing at a height you can grab, strong enough to catch a fall, and spaced so a child can’t slip through. The reference figures below reflect common standards based on the International Residential Code (IRC), but codes vary by jurisdiction, so always confirm the exact requirements with your local building department before you build.
Handrails Versus Guardrails
People mix these up constantly, but they serve different jobs and have different rules. A handrail is what you grip as you walk up or down the stairs, mounted along the flight at hand height. A guardrail (or guard) is the barrier along an open side of stairs, landings, balconies, or decks that keeps people from falling off the edge.
A single railing can satisfy both functions on an open staircase, but the height and strength requirements for each must be met. Knowing which you are dealing with tells you which rules apply.
Common Handrail Height
Handrail height is measured vertically from the stair tread nosing (the front edge of each step) to the top of the rail. Under typical residential code, that height generally falls in the range of about 34 to 38 inches.
The handrail should run continuously the full length of the flight, and many codes require one on stairs with a certain number of risers, often four or more. Confirm the trigger and the exact height your jurisdiction enforces.
Common Guardrail Height
Guardrails are typically taller because they stop a fall over an edge rather than just providing a grip. For residential applications, guard height commonly runs around 36 inches, while many decks and elevated platforms require closer to 42 inches, depending on the code and the height of the drop.
Guards are required wherever there’s a drop above a certain height, frequently 30 inches, such as along open stair sides, landings, and elevated decks. Again, the exact trigger height and required guard height depend on local code.
Baluster and Opening Spacing
The spacing between balusters (the vertical pickets) is a child-safety rule, and it’s one of the most-cited code provisions. The standard is that a 4-inch sphere should not be able to pass through any opening in the guard.
- Vertical baluster gaps: less than 4 inches.
- The triangular opening at the bottom of stairs, formed by the tread, riser, and rail, often allows up to a 6-inch sphere.
- Some areas have specific limits for the gap below the bottom rail.
The “4-inch sphere” rule exists so a small child’s head can’t fit through and become trapped or fall. Treat it as a firm minimum standard.
Graspability of Handrails
A handrail only helps if you can actually grip it during a fall. Code addresses this with graspability requirements. Round handrails generally must be about 1.25 to 2 inches in diameter so a hand can wrap around them. Other profiles have their own perimeter and dimension limits.
There must also be adequate clearance between the handrail and the wall, commonly around 1.5 inches, so your fingers can wrap fully. A decorative rail that’s too wide or too close to the wall to grip can fail inspection even if it looks substantial.
Strength and Continuity
Railings must withstand real force, not just look the part. Codes specify that handrails and guards resist a concentrated load, often cited around 200 pounds applied in any direction, without giving way. That means proper anchoring into framing, not just into drywall.
Handrails should also be continuous along the flight with no interruptions that force you to let go, and the ends are typically required to return to the wall or terminate safely so a sleeve or bag strap can’t catch. These details are easy to overlook and common reasons a railing fails inspection.
Why Local Code Always Wins
Everything above reflects widely used standards, but your city or county may adopt a different code edition or add local amendments. Heights, spacing, and load requirements can differ, and they change over time as codes are updated.
Before building or replacing a railing, contact your local building department, ask which code edition applies, and find out whether a permit and inspection are required. Many railing projects do require a permit. Confirming first saves you from tearing out work that doesn’t pass.
When to Hire a Pro
A confident DIYer can install a code-compliant railing, but the safety stakes and code complexity lead many homeowners to hire a carpenter or contractor. A professional knows the current local requirements, anchors the railing to resist the required loads, and ensures it passes inspection. For elevated decks and tall guards especially, professional installation is worth the cost.
If you do the work yourself, have it inspected. A railing that looks fine but isn’t anchored properly offers a false sense of security exactly when you need it most.
Interior Versus Exterior Railings
The same principles apply indoors and out, but exterior railings on decks and porches often face stricter guard-height requirements because the drop is greater and the consequences of a fall are more serious. Deck guards frequently require the taller end of the range, around 42 inches in many jurisdictions, while interior stair guards may permit closer to 36 inches.
Exterior railings also have to withstand weather, so material and fasteners matter. Use corrosion-resistant hardware and weather-rated materials, and check connections seasonally, since outdoor exposure loosens fasteners and degrades wood over time. Indoors, the main concern is solid anchoring into framing and a graspable profile.
Common Reasons Railings Fail Inspection
Knowing the frequent failure points helps you get it right the first time. Inspectors regularly flag the following issues.
- Baluster gaps wider than the 4-inch sphere limit, often from spacing pickets by eye rather than measuring.
- Handrails mounted too high or too low, outside the required height range.
- Railings anchored only into drywall instead of framing, failing the load requirement.
- Handrail profiles too wide or shaped so they can’t be properly grasped.
- Handrails that aren’t continuous, or ends that don’t return safely to the wall or post.
Most of these are easy to avoid with careful measuring and solid attachment, and they’re exactly what an inspector checks first.
The Bottom Line
Stair rail code sets the standards that make stairs safe: handrails around 34 to 38 inches, guards roughly 36 to 42 inches, baluster gaps under 4 inches, graspable rail profiles, and railings strong enough to catch a fall. Use these figures as a reference, then confirm the exact requirements, permit needs, and inspection rules with your local building department and current IRC. Build it right and inspected, and your stairs become one of the safest parts of your home.