All articles

Codes6 min readFloorGen team

Deck Railing Height Code: IRC Guard and Handrail Rules

Deck railing height code under the IRC: a guard above a 30 in drop, 36 in high, 4 in sphere limit, 34 to 38 in stair handrails, and 42 in local rules.

Under the model International Residential Code (IRC), a deck needs a guard (the code word for a railing) wherever the surface is more than 30 in above the ground below. The guard must be at least 36 in high, and nothing in it may let a 4 in sphere pass. Stairs from the deck need a handrail 34 to 38 in above the nosings once they have four or more risers. Some jurisdictions, California among them, ask for 42 in, so the number on your permit may be higher than the model code.

The numbers at a glance

The guard rules sit in 2021 IRC R312 and the handrail rules in 2021 IRC R311.7.8. The 2024 IRC renumbered Chapter 3, so guards are in R321 there; the 2024 IRC changes guide has the full old-to-new table for deciding which edition you are working under.

Deck guard and handrail figures, model IRC (inches).
RuleFigure2021 IRC2024 IRC
Guard neededDrop over 30 inR312.1.1R321 (guards)
Guard height36 in minimumR312.1.2R321 (guards)
Guard openingsNo 4 in sphereR312.1.3R321 (guards)
Stair handrail34 to 38 inR311.7.8R320 (handrails)
Deck structureFraming, ledger, guard postsR507R507

Where the 2024 subsection is not in the table, it is because only the section-level move is confirmed here; look up the subsection in the edition your jurisdiction has adopted.

When a deck needs a guard

The trigger is the drop, not the size of the deck. A guard is required along an open side of a walking surface that is more than 30 in above the floor or grade below, measured within 36 in horizontally of that edge. Measure from the walking surface down to the lowest ground within that 36 in strip, not to the ground right at the house wall. A deck at 30 in or less, such as a low platform on grade, needs no guard under the model code, though a stair or a slope below can still trigger one.

The deck in the pictures below sits about 31½ in above the yard, only just over the line. That is the situation that catches people: the house floor is a few inches higher than expected, and a deck that was drawn as "low" needs railing on three sides after all. The stair code guide covers how the same 30 in test applies to open stair sides and landings.

Guard height and the 4 in sphere

Guards must be at least 36 in above the adjacent walking surface (2021 IRC R312.1.2). On a deck, that is measured from the decking, not from the top of the joists. Stair guards are measured from the line through the tread nosings, and the same section lets the guard on the open side of a stair be 34 in.

Openings are limited so a small child cannot slip through. From the walking surface up to the required height, no opening may let a 4 in sphere pass (2021 IRC R312.1.3). That governs baluster spacing: with 1½ in square balusters the clear gap must stay under 4 in, which means centres under 5½ in. On stairs, the sphere limit on the open side is slightly larger (4⅜ in), and the triangle formed by the riser, tread and bottom rail must not pass a 6 in sphere. Cable and horizontal-bar railings face the same sphere test.

Handrails on deck stairs

A guard and a handrail are two jobs. The handrail is what you hold, and 2021 IRC R311.7.8 requires one on at least one side of a flight with four or more risers. Its top sits 34 to 38 in above the sloped line through the tread nosings. A round rail is graspable at roughly 1¼ to 2 in across, while a flat 2×6 board top generally does not qualify as a handrail on its own. A guard along a stair side can double as the handrail if its top falls in that 34 to 38 in range and it can be gripped.

Deck stairs follow the riser and tread limits of the stair code too. See the stair code guide for the dimensions, and use the free stair calculator to work out how many risers a given deck height needs.

Local amendments: the 42 in rule

Plenty of places raise the guard height on decks. The California Residential Code asks for 42 in guards on residential decks (city handouts on the 2022 edition say so), and some other counties and cities do the same. Check the amendments for your jurisdiction: a deck that is fine at 36 in in one town fails in the next. Local rules can also change the 30 in trigger, the baluster spacing, or whether a permit is needed at all.

A worked example: a 12 × 12 ft deck on the ranch

For the pictures, we took FloorGen's 3-bedroom ranch and replaced the dining room's south window (the room is 134.1 ft² net) with a 72 in sliding door onto a 12 × 12 ft deck. The 2D plan labels it 144.0 ft². A short stair leads to the yard at the deck's far edge, and a railing runs along the open edges. The house floor is raised 80 cm (about 31½ in) above grade in this picture, so the deck surface is a little over the 30 in trigger. Dimension strings run along wall centrelines; room areas are net, to the inside wall faces.

Floor plan of a single-storey ranch house with a 12 by 12 foot deck, labelled 144.0 square feet, attached to the dining room on the south side, with a short stair at its far edge
The ranch with a 12 × 12 ft deck added outside the dining room, and a short stair at its outer edge (drawn for the picture, not detailed to code).

Three things follow from the plan. The deck needs a guard on its three open sides. The stair opening is part of the deck edge, so the guard stops at the stair and the stair gets its own handrail if it has four or more risers (a 31½ in drop needs at least five risers at the usual 7¾ in maximum riser height). Guard posts should be fastened to the deck framing, not just the decking boards, because the guard has to resist a load pushing outward and that load must reach the joists. The deck chapter (R507) covers the framing; the post connection is worth asking your building department about.

3D view of the ranch house from above showing a square deck outside the dining room with dark railings on its open sides and a short stair down at the far edge
The same deck in 3D: railing on the open edges, a gap for the stair.

Permits, setbacks and drawing it

A deck is usually a permit item. The model code's exemption (2021 IRC R105.2) is for small, low decks that are not attached to the house and do not serve an exit door, and many places narrow or drop it, so assume this attached deck needs a permit. Decks also count toward setbacks and lot coverage in many places, so read how setbacks work before you push the deck toward the rear line. For the permit set, a plan with the deck dimensions, the height above grade and the stair is what plan reviewers ask for; see how to draw floor plans for a building permit. For the framing and footings, FloorGen also has a deck calculator.

Quick checklist

  • Measure the drop at the lowest point within 36 in of each edge. Over 30 in means a guard.
  • Check whether your town asks for 42 in; plan for it if in doubt.
  • Keep every gap under 4 in, including under the bottom rail and between stair balusters.
  • Give stairs of four or more risers a graspable handrail at 34 to 38 in.
  • Fasten guard posts to the deck framing so the load has a path to the joists.

More from the blog

All articles