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.
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.
| Where | Height | Measured from |
|---|---|---|
| Deck, porch or balcony guard | at least 36 in | the walking surface |
| Guard on the open side of a stair | at least 34 in | the line along the nosings |
| Stair guard whose top is the handrail | 34 to 38 in | the line along the nosings |
| Stair handrail | 34 to 38 in | the 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.
| Deck height at the edge | Level ground | Ground falls 1″ per foot | Ground falls 2″ per foot |
|---|---|---|---|
| 24″ | 24″, no guard | 27″, no guard | 30″, no guard |
| 27″ | 27″, no guard | 30″, no guard | 33″, guard |
| 30″ | 30″, no guard | 33″, guard | 36″, 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.
- International Code Council. 2021 IRC Chapter 3 Building Planning (Sections R301.5, R311.7.8, R312). 2021 IRC
- International Code Council. 2021 IRC Chapter 5 Floors, Section R507 Exterior Decks. 2021 IRC
- Deck Stair Calculator: Risers, Treads & Stringer LengthRisers, treads and stringers for the stairs down from the deck.
- Deck Ledger Board: Size, Bolt Spacing & FlashingThe board on the house that carries the deck, and how it is bolted and flashed.
- Deck Joist Span Chart: Joists, Beams & Post SpacingThe 2021 IRC span tables for the joists and beams under the deck.
