California Railing Code: Height, Spacing and Handrail Rules
California railing code at a glance
California railing code boils down to a handful of numbers that plan checkers in San Ramon, Dublin and across Contra Costa County measure on every job. Here they are, before we explain each one:
| Requirement | Typical number |
|---|---|
| When a guard is required | Walking surface more than 30 inches above grade |
| Guard height | 42 inches minimum |
| Opening limit | No 4-inch sphere may pass |
| Stair tread triangle | No 6-inch sphere may pass |
| Handrail height | 34 to 38 inches above stair nosing |
| Circular handrail grip | 1¼ to 2 inches outside diameter |
| Handrail wall clearance | At least 1½ inches |
| Loads | 200 lb concentrated at the top (homes); commercial guards add 50 lb per linear foot |
These come from the California Building Code and Residential Code. Local departments enforce them, sometimes with their own handouts, so confirm the details with your building division.

When a guard is required, and how tall
A guard is required along any open side of a deck, balcony, porch, landing or stair where the walking surface is more than 30 inches above the grade below. Measure that drop at any point within 36 inches horizontally of the edge, not just at the post.
Tri-Valley and Contra Costa building departments enforce a 42-inch minimum guard height, measured from the walking surface to the top of the rail. On the open side of a stair, a guard measures from the line of the stair nosings. Dublin's handout notes that in a single-family home, a guard that doubles as the stair handrail may be 34 to 38 inches tall along the stair.
Planning a railing project in San Ramon or the Tri-Valley? We measure on site for free and give you a written range before anything is fabricated.
Openings: the 4-inch sphere and 6-inch triangle
The opening rule is simple to state: no opening in a guard may let a 4-inch sphere pass through. That applies to gaps between balusters, between cables, and between the bottom rail and the deck. Inspectors often carry a 4-inch ball to check.
Two details catch people out. First, the triangle formed by the tread, riser and bottom rail on a stair may pass up to a 6-inch sphere, not more. Second, cable railing must meet the 4-inch rule under load, not just at rest. That is why cable railings use posts about 4 feet apart and cables about 3 inches apart, tensioned so a hand pushing between them cannot spread the gap past 4 inches.
Handrails: height, grip and continuity
Stairs with four or more risers need a handrail on at least one side. The handrail sits 34 to 38 inches above the stair nosings, runs continuously from the top riser to the bottom riser, and must be graspable. A Type I circular rail between 1¼ and 2 inches in outside diameter is the standard grippable shape; wider decorative caps often fail this test unless a separate grab rail is added.
A wall-mounted handrail needs at least 1½ inches of clearance from the wall. Commercial and ADA rails add requirements, including extensions of at least 12 inches past the top riser. Our ADA and commercial handrail service covers those projects, and our interior stair railing work keeps residential rails graspable when spindles are swapped for iron.
Loads and anchorage
A guard is a structural element, not a decoration. For homes, the California Residential Code requires guards and handrails to resist a 200-pound concentrated load at the top; commercial guards also carry 50 pounds per linear foot, and your engineer or plan checker confirms the exact load case for the project. The weak point is almost never the rail itself. It is the post connection.
A post lag-screwed into a single rim joist can wobble within a few years. Through-bolted connections with blocking, or welded base plates anchored into concrete, hold up far better. That matters here because the northern Calaveras Fault runs along the western side of the San Ramon Valley, and a sound connection is cheap insurance.
Older homes with 36-inch guards
Many Tri-Valley homes were built under earlier codes, and it is common to find 36-inch deck rails, wide baluster spacing or flat 2x6 caps on 1970s and 1980s houses. An existing railing that met the code when it was built is generally allowed to stay as long as it is maintained.
The question is what happens when you replace it. Replacing more than about 50 percent of an existing guard is commonly treated as a replacement that must meet current code, which means 42 inches and the 4-inch sphere. That rule of thumb is widely applied, but confirm with your local building division before deciding how much to replace. If you are already replacing most of a rail, bringing it fully to code usually costs little extra. Our railing repair service handles partial fixes when replacement is not needed.
How to check your own railing
You can run a quick check with a tape measure and a ball before calling anyone:
- Height. Measure from the deck surface straight up to the top of the rail. Under 42 inches on a deck more than 30 inches off the ground is worth noting.
- Gaps. Try a 4-inch ball or a piece of 4-inch PVC between balusters, between cables and under the bottom rail.
- Stairs. Check the handrail height from the stair nosing and whether you can wrap your hand around it.
- Movement. Push firmly on the top rail at each post. Anything more than slight flex, or a post that rocks at its base, needs attention now.
None of this replaces an inspection, but it tells you whether you are looking at a repair or a replacement conversation.
Two real local examples
Dublin publishes a Guards and Handrails handout (rev. 02/19/26) based on the 2025 California Building Code. It lists the 30-inch trigger, 42-inch guard minimum, 4-inch sphere, 6-inch stair triangle, 34 to 38-inch handrail height, 1¼ to 2-inch grip and 1½-inch wall clearance. It is a good one-page summary even if you live elsewhere.
Walnut Creek handout IB-015 (rev. 2/28/2024) requires decks and balconies 30 inches or higher to be designed by a licensed architect or engineer, with a 60 psf live load, 42-inch guards and the 4-inch sphere. If you live in Walnut Creek, budget for design work on any elevated deck.
Every drawing we produce is checked against these rules before fabrication. For permit steps, see our San Ramon railing permit guide. To have your railing measured and checked, call (925) 438-6219 or request a free on-site estimate.
FAQ
Questions, Answered
Straight answers on cost, code, permits and materials. Still unsure? Call and ask.
How tall does a deck railing have to be in California?
When the deck surface is more than 30 inches above grade, the guard must be at least 42 inches tall, measured from the deck surface to the top of the rail. That is the height Tri-Valley and Contra Costa building departments enforce. Some local rules allow a 34 to 38-inch guard along a stair when it doubles as the handrail. Confirm locally before you build.
What is the 4-inch sphere rule?
The 4-inch sphere rule says no opening in a guard may let a 4-inch ball pass through. It applies to gaps between balusters, cables and glass panels, and below the bottom rail. The triangle at the stair tread may pass up to a 6-inch sphere. Inspectors often check it with an actual 4-inch ball.
Is my old 36-inch railing still legal?
An existing railing that met the code when it was built is generally allowed to remain if it is safe and maintained. If you replace a large portion of it, commonly more than about half, the new work is usually expected to meet current code, including the 42-inch height. Confirm with your building division before deciding.
How high should a stair handrail be?
A stair handrail should be 34 to 38 inches above the stair nosings, measured vertically. It must be continuous from the top riser to the bottom riser and graspable, such as a round rail 1¼ to 2 inches in diameter. Wall-mounted rails need at least 1½ inches of clearance so fingers can wrap around them.
Do I need an engineer for a deck railing?
It depends on the city and the project. Walnut Creek requires decks and balconies 30 inches or higher to be designed by a licensed architect or engineer. Other departments may accept standard details for simple guards but ask for engineering on glass, tall decks or unusual anchorage. We tell you up front if your project needs it.
Need Help in San Ramon?
San Ramon Custom Railing builds custom iron, cable, glass and aluminum railings across San Ramon, CA and the Tri-Valley. If this guide answered your question, the next step is a free on-site measure and a written range. See everything we do on our homepage, or reach out now.


