Home / Guides / How High Does a Deck Railing Have to Be?

Decks guide

How high does a deck railing have to be?

At least 36 inches under the model code most of the US starts from, once the deck is more than 30 inches off the ground. California asks for 42. Stairs have a lower number of their own.

These are the model code's numbers and one state's changes to them. Your state or city decides what applies where you live, so confirm with the local building department before you buy a railing.

The numbers

The building code's word for a deck railing is a guard. Here are its limits in the 2021 International Residential Code, next to California's version:

WhereModel codeCalifornia
Deck, porch or landing36 in or more42 in or more
Open side of stairs34 in or more34 in or more
Stair guard that's also the handrail34 to 38 in34 to 38 in
Biggest gap in a guard4 in4 in
Biggest gap on the open side of stairs4⅜ in4⅜ in
Triangle under a stair guard6 in6 in

Washington's state code uses the same heights as the model code, and the City of Gilroy's handout sets out California's. You'll also see 42 inches quoted for apartments and commercial buildings. That comes from a different code, the International Building Code, which doesn't cover a single-family house.

Side view of a wood deck railing 36 inches high with balusters and posts 6 feet apart, drawn to scale next to a person
A wood railing 36 inches above the deck floor, the minimum in the model code, with posts 6 feet apart and a person 5 ft 8 in tall for scale.

When you need one

A guard is required on any open side that's more than 30 inches above the floor or ground below. The part people miss is where that's measured. The code doesn't only look straight down from the edge. It looks at any point within 36 inches of the edge.

So the yard matters. Take a deck whose floor is 26 inches above the ground at its edge, on a yard that keeps falling away. If the ground is more than 30 inches below the floor anywhere within 3 feet of that edge, that side needs a guard, even though the edge itself is under the limit. Measure on the low side of the deck before you decide you can skip it.

How it's measured

On a deck, the height runs from the walking surface straight up to the top of the guard. On stairs, it runs up from an imaginary line connecting the front edges of the treads.

Because it starts at the walking surface, new boards can change it. Replace 1-inch boards with 2×6s, which are 1½ inches thick, and the floor comes up half an inch. A railing that was exactly 36 inches is now 35½. If you're resurfacing a deck with thicker boards, measure the railing again afterward.

The gaps

A 4-inch ball shouldn't be able to pass through any opening in the guard. That's the size the code uses to keep a small child from slipping through. On the open side of stairs the limit is a little looser, at 4⅜ inches. The triangle formed by a tread, a riser and the bottom rail can be up to 6 inches.

Our railing calculator explains why cable railing has trouble passing this test.

How strong it has to be

Height isn't the whole job. Guards and handrails have to resist a 200-pound load applied at any point along the top. That applies even to a guard you weren't required to build.

The weak point is usually the post. A post screwed only to the outside of the rim board can work loose over time. The American Wood Council's free guide, DCA 6, shows post connections that bolt through the framing, and building departments often expect to see those on the plans.

Handrails are a separate rule

A guard stops you falling off the side. A handrail is something to hold while you climb. Stairs can need one, the other or both:

  • A guard if the open side of the stairs is more than 30 inches above the ground.
  • A handrail on at least one side if the flight has four or more risers, set 34 to 38 inches above the line of the treads.

A handrail has to be something a hand can close around, so a flat 2×6 on top of the railing doesn't count. A round rail is typically limited to 2 inches across. The deck stair calculator flags when your stairs reach four risers.

Side view of deck stairs with four risers, 30 inches of rise and 31 1/2 inches of run
A deck 30 inches up needs four risers of 7½ inches. With four risers or more, the code asks for a handrail.

Fair questions

My deck is 24 inches off the ground. Do I need a railing?

Not under the model code, as long as the ground doesn't drop past 30 inches within 3 feet of the edge. Plenty of people with small children add one anyway. The height and gap limits apply to required guards, but the 200-pound strength rule applies to any guard you build.

Is there a maximum height?

Not for a guard on a deck. The only upper limit is the 38 inches on stairs, when the top of the guard is also doing the job of the handrail.

Can I build 42 inches everywhere, to be safe?

On the deck itself, yes, though it cuts into the view from a chair. On stairs, a guard that's also your handrail still has to stay within 34 to 38 inches, or you'll need a separate handrail. Railing kits are commonly sold in both 36- and 42-inch heights, so check which your town wants before you order.

Does a railing have to be a railing?

The code cares about what a guard does, not what it looks like. Glass, cable and metal panels are all fine if they meet the height, gap and strength rules.

What does a deck railing cost?

Forty feet of wood railing is about $1,280 installed at our prices, and the same length in aluminum is about $2,400. The railing calculator prices your length.

Sources