Deck Railing Height: Code Rules for Guards & Handrails

By Marko VisicBSc Physics, University of Ljubljana

The code’s word for a deck railing is a guard; the handrail is the part you hold on the stairs.

A deck guard must be at least 36 inches high wherever the deck is more than 30 inches above the ground within 36 inches of its edge, under the 2021 IRC. Stair guards need 34 inches, stair handrails 34 to 38 inches, and no opening may pass a 4-inch sphere.

36in

minimum guard height on a deck more than 30 in above grade

36″ minimumover 30″4″ sphere can’t passhandrail34–38″
A deck seen from the side: the guard, its balusters and the stair handrail that continues from it.

Deck railing height code

The 2021 IRC sets one height for the guard along a deck, porch or balcony and two for stairs. The deck guard is measured straight up from the walking surface; stair guards and handrails are measured from the sloped line that runs along the front edges of the treads, the nosings.

Guard and handrail heights, 2021 IRC Sections R312.1.2 and R311.7.8.1.
WhereHeightMeasured from
Deck, porch or balcony guardat least 36 inthe walking surface
Guard on the open side of a stairat least 34 inthe line along the nosings
Stair guard whose top is the handrail34 to 38 inthe line along the nosings
Stair handrail34 to 38 inthe line along the nosings

When a deck needs a railing

A deck needs a guard along any open side where the walking surface is more than 30 inches above the floor or ground below, measured at any point within 36 inches of the edge. The second number matters on a slope: the drop is checked out to 36 inches from the deck, not only at its edge. Insect screening does not count as a guard.

The table runs that check for a few decks. Each cell is the drop to the ground 36 inches out from the edge, and whether it calls for a guard.

Drop to the ground 36 inches out from the deck edge.
Deck height at the edgeLevel groundGround falls 1″ per footGround falls 2″ per foot
24″24″, no guard27″, no guard30″, no guard
27″27″, no guard30″, no guard33″, guard
30″30″, no guard33″, guard36″, guard

Standard deck railing height

36 inches is the code’s minimum, not a fixed size. Section R312 sets no maximum for a deck guard, so a taller one is allowed. The one cap is on stairs: where the top of a stair guard doubles as the handrail, it stays within 34 to 38 inches of the nosing line.

The minimum is the same on a second-story deck as on a low one; the IRC measures the guard, not the drop below it. Your building department enforces the code edition and any amendments your town adopted.

Deck stair handrail code

A stair with four or more risers needs a handrail on at least one side, 34 to 38 inches above the line along the nosings. Fittings and bends where the rail changes direction may rise above 38 inches.

  • Continuous. The handrail runs the full flight, from above the top riser to above the lowest one, and its ends return toward a wall, guard or walking surface, or stop at a post.
  • Clear of the wall. At least 1½ in between a handrail and the wall beside it, and no more than 4½ in of projection into the stair on either side.
  • Graspable. A round rail is 1¼ to 2 in across. Other shapes need a perimeter of 4 to 6¼ in and a cross section no more than 2¼ in, or, if larger, a finger recess on both sides.

The open side of the stair also needs a guard where it is more than 30 inches above the ground: at least 34 inches above the nosing line.

Baluster spacing and openings

From the deck surface up to the required height, no opening in a guard may let a 4-inch sphere through. That covers the gaps between balusters and the gap under the bottom rail. Two stair openings get more room: the triangle formed by a riser, a tread and the bottom rail may not pass a 6-inch sphere, and a guard on the open side of a stair may not pass a 4⅜-inch sphere.

The rule is about the size of the openings, not their direction, so horizontal rails and cable railings meet it the same way, as long as the sphere cannot pass.

Railing strength and post spacing

A guard and a handrail must each take a single 200-pound load at any point along the top, and balusters and infill panels a 50-pound sideways load on 1 square foot. On a deck, those loads pass through a continuous path into the joists, and a 4x4 wood post that carries the top of a guard may not be notched where it connects to the framing.

The code gives no post spacing; it follows from those loads. A composite railing’s label states its maximum allowable span, and other guards follow the maker’s instructions or an engineered design.

Porch railing height

A porch follows the same rule as a deck: the guard section names porches and balconies along with stairs and landings. A porch more than 30 inches above the ground within 36 inches of its edge needs a guard at least 36 inches high.

Deck railing height FAQ

What is the code for deck railing height?

Under the 2021 IRC, a required guard is at least 36 inches high, measured from the deck surface. A deck needs one where it is more than 30 inches above the ground at any point within 36 inches of its edge.

How high does a deck have to be to need a railing?

More than 30 inches above the ground, measured anywhere within 36 inches of the open edge. Where the ground falls away from the deck, a deck lower than that at its edge can still need a guard.

How high can a deck be without a railing?

Up to 30 inches above the ground at every point within 36 inches of the edge; any higher and the IRC requires a guard. The deck’s stairs still need a handrail once they have four or more risers.

How high should a deck stair handrail be?

From 34 to 38 inches, measured straight up from the line along the tread nosings. The code requires one on at least one side of any flight with four or more risers.

How far apart can deck balusters be?

Close enough that a 4-inch sphere cannot pass between them, from the deck surface up to the required height. On the open side of a stair the limit is a 4⅜-inch sphere.

How high is the railing on a second-story deck?

The IRC rule doesn’t change with height: a guard on any deck that needs one is at least 36 inches high. The code sets a minimum, so a taller guard is allowed.

Sources & method

Heights, openings and loads are quoted from the 2021 International Residential Code: Section R312 for guards, R311.7.8 for handrails, Table R301.5 for loads and Section R507.10 for deck guards. The guard check adds 3 feet of the ground’s fall to the deck’s height at its edge and compares the result with 30 inches.

  1. International Code Council. 2021 IRC Chapter 3 Building Planning (Sections R301.5, R311.7.8, R312). 2021 IRC
  2. International Code Council. 2021 IRC Chapter 5 Floors, Section R507 Exterior Decks. 2021 IRC
Marko Visic, founder of ConstructionCalc

Marko Visic

I'm Marko Visic, a physics graduate who builds data-driven calculators. I run ConstructionCalc through my company, Moving Data Systems d.o.o.

The calculators help you plan a DIY job or check a contractor's quote before you sign. Each one cites its sources and shows its method, and cost figures are computed from public primary data. If a number looks wrong, email info@constructioncalc.org and I'll trace it to its source or fix it.

Marko Visic on LinkedIn