Skip to content

How High Does a Deck Railing Have to Be in California?

Your inspector red-tagged the deck railing you just built, and the number he quoted isn't the one your neighbor's deck was built to. Both can be right. California uses different heights for decks and for stairs — here's every measurement, and where the gaps between the balusters come in.

Sungjoon Nam
AI-assisted article · General information, not legal advice · details

Researched and written with AI tools. Property examples are illustrative analyses based on public records, and people described may be composites.

How High Does a Deck Railing Have to Be in California?
Photo by Riccardo Tuninato on Unsplash

You finish the deck, step back to admire it, and the inspector points at the railing with a tape measure. It reads 36 inches. He tells you it needs to be 42. Meanwhile the deck stairs right next to it — same railing, same day's work — are fine at 34 inches. Nothing is wrong with your tape measure. California's residential code genuinely uses two different heights, and which one applies depends on whether you are standing on the deck or walking down the stairs.

The short answer: on a deck, porch, balcony or landing, the guard must be at least 42 inches tall, measured straight up from the walking surface. On the open side of the stairs, it drops to at least 34 inches, measured from a line connecting the stair nosings. A guard is only required where the walking surface is more than 30 inches above the ground below (§ R321.1).

Key numbers

A "guard" is the code's word for the barrier that keeps you from falling off the edge — what most people call a railing. A "handrail" is the separate graspable rail you hold while using stairs. They have different heights, and a deck can need both.

What Requirement Where it comes from
When a guard is required Walking surface more than 30 inches above the grade below, measured at any point within 36 inches horizontally of the open edge § R321.1.1
Guard height on decks, porches, balconies, landings Not less than 42 inches § R321.1.2
Guard height on the open side of stairs Not less than 34 inches from a line connecting the nosings § R321.1.2
Guard whose top doubles as the stair handrail 34 to 38 inches § R321.1.2
Gaps in a deck guard Must not pass a 4-inch sphere § R321.1.3
Triangle opening at the stair (riser, tread, bottom rail) Must not pass a 6-inch sphere § R321.1.3
Other openings in a stair guard Must not pass a 4⅜-inch sphere § R321.1.3
Stair handrail height 34 to 38 inches above the tread nosings § R320.2

When you need a railing at all

A low deck may need no guard whatsoever. The trigger is height above the ground, not the size of the deck:

Guards shall be provided for those portions of open-sided walking surfaces, including floors, stairs, ramps and landings that are located more than 30 inches measured vertically to the floor or grade below at any point within 36 inches horizontally to the edge of the open side.

That last clause matters more than people expect. The 30 inches is measured to whatever is below within a 36-inch reach of the edge — so a deck that sits 24 inches above a patio, but where the patio itself drops away into a planting bed a foot from the deck, can be over the line. Ground that slopes is the usual culprit, which is why one end of a deck sometimes needs a guard and the other end does not.

One more rule in the same section, and it catches people every summer: insect screening does not count as a guard (§ R321.1.1). Screening in a porch enclosure has no structural job; if the floor is more than 30 inches up, a real guard has to be there behind the screen.

Why the stairs get a lower number

The 42-inch deck guard and the 34-inch stair guard are the same barrier doing two different jobs. On a flat deck, the guard exists purely to stop a fall, and taller is safer. On stairs, the top of the guard is often the thing you actually hold on the way down, and a 42-inch rail is too high to grip comfortably — so the code lets it drop to 34 inches, and where the top of that guard is serving as the handrail it must land in the 34-to-38-inch window (§ R321.1.2).

That 34-to-38-inch band is the same range required of a dedicated handrail on the stairs (§ R320.2) — measured vertically from the sloped plane touching the tread nosings, not from the corner of each step. The code allows a few shape exceptions here: a volute, turnout or starting easing over the lowest tread, and fittings or bends used to carry the rail continuously between flights or into a guard, may exceed 38 inches.

The gaps, not just the height

A railing that passes the tape measure can still fail on spacing. The rule is written as a sphere test, because a round object is the worst case for a child's head or body: nothing in a required guard may allow a 4-inch sphere through, anywhere from the walking surface up to the required guard height (§ R321.1.3).

Two exceptions loosen it on stairs. The triangular opening formed by a riser, a tread and the bottom rail of a guard may pass up to a 6-inch sphere, because closing that shape neatly is genuinely difficult. Everywhere else on a stair guard, the limit is a 4⅜-inch sphere.

If you are using composite decking, note that plastic composite guards are pointed to a separate set of requirements in the code's deck provisions (§ R321.1.4) — buy a system that is listed for guard use rather than assembling one out of decking boards.

Commercial buildings and historic homes are different

The numbers above come from the California Residential Code, which covers houses, townhouses and their accessory buildings. Apartment buildings, offices and stores fall under the California Building Code instead, where guards are also 42 inches (§ 1015.3) and handrails are again 34 to 38 inches (§ 1014.2). Inside an individual apartment, the same stair exception applies — 34 inches on the open side of the stairs.

Qualified historical buildings get their own treatment: the height of railings and guardrails, and the spacing of balusters, may continue at their historical dimensions "unless a distinct hazard has been identified or created by a change in use or occupancy" (§ 8-504). That is a narrow allowance for designated historic properties, not a general grandfather clause for old houses.

What your city can add

These are 2025 California code figures, in effect statewide since January 1, 2026, and they are a floor. Cities and counties adopt the state code and may amend it to be more restrictive — some coastal and high-wind jurisdictions add requirements for how a guard is attached, and local rules on when a deck needs a permit and an inspection vary. Your local building department applies its own adopted version, so confirm before you buy materials.

The code sections above set heights and spacing. They do not tell you what the guard must be anchored with, or how strong the connection has to be — those structural requirements live elsewhere in the code and are the reason a bolted post beats a nailed one.

Sources

Frequently asked questions

How high does a deck railing need to be in California?

At least 42 inches, measured vertically from the deck surface, on any open-sided deck, porch, balcony or landing (§ R321.1.2). The one place that number drops is the open side of the stairs, where the guard may be 34 inches measured from a line connecting the stair nosings — and where the top of that guard also serves as the handrail, it must be 34 to 38 inches.

Do I need a railing on a low deck?

Only if the walking surface is more than 30 inches above the floor or grade below, measured at any point within 36 inches horizontally of the open edge (§ R321.1.1). Sloping ground is what usually decides it: a deck can sit under 30 inches at the house and over 30 inches at the far corner, in which case that corner needs a guard.

How far apart can deck balusters be?

The code does not give a spacing in inches — it gives a sphere test. A required guard must not have any opening, from the walking surface up to the required guard height, that allows a 4-inch sphere to pass (§ R321.1.3). On stairs, the triangle formed by the riser, tread and bottom rail may pass up to a 6-inch sphere, and other stair guard openings up to 4⅜ inches.

Is a handrail the same thing as a deck railing?

No, and a stairway often needs both. The guard is the barrier that stops a fall off the open edge; the handrail is the graspable rail you hold going up and down. Handrails must be 34 to 38 inches above the tread nosings (§ R320.2). A guard's top rail can do both jobs on stairs if it lands in that same 34-to-38-inch band.

Does screened-in porch screening count as a railing?

No. The residential code states plainly that insect screening shall not be considered a guard (§ R321.1.1). If a screened porch floor is more than 30 inches above the ground, a code-compliant guard has to be built behind the screen — the screen frame itself is not doing that job.