The deck railing code in California requires a guard at least 42 inches tall on any deck, balcony, porch, or landing whose walking surface sits more than 30 inches above the ground or floor below, and every opening in that guard must be small enough to block a 4-inch sphere. Those baselines come from the California Residential Code (CRC), Title 24, Part 2.5, and they run stricter than the national International Residential Code that California builds on.1California Department of General Services. California Building Standards Commission Codes Get the height, spacing, and post attachment right before you build, and you avoid a failed inspection and a rebuild.
When a Guard Is Required
A guard is mandatory on any open side of a walking surface, including decks, balconies, porches, landings, and ramps, once that surface is more than 30 inches above the finished grade or floor below. The rule appears in CRC Section R321.1.1, which replaced the older Section R312.1 when the 2025 code reorganized its chapter numbering.2Humboldt County. Guards and Window Fall Protection CRC R321
How you measure that 30 inches matters. You measure vertically from the walking surface down to the grade or floor at any point within 36 inches horizontally from the open edge.2Humboldt County. Guards and Window Fall Protection CRC R321 On a sloped lot, that horizontal sweep is what catches people. Even if the ground directly under the deck edge is only two feet down, if the grade falls away and drops past 30 inches anywhere inside that 36-inch zone, the deck needs a guard.
Minimum Railing Height
Guards on residential decks and balconies must be at least 42 inches tall, measured vertically from the deck surface to the top of the rail.3City of Escondido. Single Family Dwelling Stairways, Guards, and Handrails Information Guideline 19 California’s 42 inches is six inches taller than the base International Residential Code minimum of 36 inches, and inspectors flag rails that come in even slightly short.
The Stair Exception
Stairs are different. When a guard runs along an open-sided stairway and its top rail also functions as the handrail you grip while climbing, the height requirement drops to a range of 34 to 38 inches, measured vertically from a line connecting the stair nosings (the front edges of the treads).4City of Santa Barbara. Residential Handrail and Guard Requirements A stair guard whose top rail is not the handrail must still be at least 34 inches from the nosing line. So if your deck stairs have a separate handrail alongside the guard, the guard follows the stair rule, not the 42-inch deck rule.
Baluster Spacing and Opening Limits
Every opening in the guard, from the deck surface up to the required height, must be small enough that a 4-inch-diameter sphere cannot pass through. This is the single most tested dimension at inspection. It applies to gaps between vertical balusters, the space between the bottom rail and the deck, and any decorative panels or cutouts. If a 4-inch ball fits anywhere, the railing fails.
Triangular Openings at Stairs
Stairways create an unavoidable triangular gap where the bottom rail of the guard meets the tread and riser. The code allows this triangle to block a 6-inch sphere rather than a 4-inch one. Separately, openings on the open side of stair treads themselves must block a sphere of 4⅜ inches. The relaxed limits reflect stair geometry; the gaps are still tight enough to keep a small child from slipping through.
Strength and Load Requirements
A guard that looks solid but cannot resist force is worse than none at all, because people lean on it with confidence. The CRC sets minimum load ratings for every part of the assembly.
Top Rail
The top rail must withstand a single concentrated load of 200 pounds. When the guard also serves as a handrail, that load can come from any direction at any point along the rail. When the top rail is not doubling as a handrail, the 200-pound force is tested vertically downward and horizontally outward from the walking surface. The loads are not applied at the same time.5UpCodes. California Residential Code 2022 – Chapter 3 Building Planning
Infill and Balusters
Infill components (balusters, panels, cables) must resist a 50-pound load applied horizontally over a one-square-foot area, so nothing bends or breaks outward when someone falls against it. Glazing is held to a stricter standard: when the guard uses glass panels, a load adjustment factor of 4 applies to both the top-rail concentrated load and the infill load.5UpCodes. California Residential Code 2022 – Chapter 3 Building Planning
Guard Post Attachment
The strongest top rail and balusters are pointless if the posts pull free from the deck. Post attachment is where most guard failures actually happen, and the code addresses it directly.6UpCodes. Section 13 Guard and Posts
- Notching a guard post to fit it over the rim joist or end joist is prohibited. Notching removes material exactly where the post needs the most strength.
- Posts must be secured with hold-down anchors rated for at least 1,800 pounds of capacity.
- Bolt holes in the post must be at least 2 inches from any wood edge, spaced at least 2½ inches apart, and no more than 5 inches apart.
- Posts can be attached to either side of the end joist or rim joist.
End-grain fastening, where screws or nails are driven into the cut end of a joist or beam, should be avoided for guard connections because end grain gives poor withdrawal resistance.
Infill Material Choices
The CRC does not restrict you to wood balusters. Any material that meets the load ratings and 4-inch opening limit is acceptable, and common choices include wood, aluminum, steel, composite, cable, and glass.
Cable railings look clean and preserve views, but every gap between cables still has to meet the 4-inch sphere test. In practice, cables need to be spaced roughly 3 inches apart or less, depending on cable diameter, and they must stay tensioned enough to hold that spacing under load. Cables stretch over time, so the system needs hardware that allows re-tensioning.
Glass panel infill has to satisfy the factor-of-4 load adjustment noted above. Exterior plastic composite guards must comply with CRC Section R507.2.2, which covers material durability and structural performance for composite deck components. If you’re using composite lumber for the guard assembly, confirm the product carries the appropriate code evaluation report.
Permits, Inspections, and Local Rules
Most deck projects that require a guard also require a building permit. The CRC exempts only small decks that meet all of the following: not more than 200 square feet, not more than 30 inches above grade at any point, not attached to the dwelling, and not serving a required exit door.7City of Eureka. Deck Permitting Guide Exceed any one of those thresholds and you need a permit before you start. Expect to submit a site plan with the deck’s location, dimensions, and setbacks, along with framing and guard construction details.
At the final inspection, expect the inspector to check guard height, baluster spacing (often by literally trying to pass a 4-inch sphere through every opening), post attachment hardware, and overall rigidity. Failing means fixing the deficiency and scheduling a re-inspection, which adds time and sometimes fees.
The CRC sets statewide minimums. Your local city or county building department can adopt stricter requirements through local amendments.8California Department of General Services. Guide for Local Amendments of Building Standards Mountain jurisdictions often impose higher snow loads that indirectly raise the structural demands on guard posts. Coastal areas may require corrosion-resistant hardware. Check with your local building department before you finalize the design, because the rules governing your project are the local rules, not just the statewide baseline.