Under the International Residential Code, a deck without a railing is allowed when no part of the walking surface sits more than 30 inches above the grade below, measured within 36 inches horizontally of the deck’s edge. Stay under that line at every point around the perimeter and no guard is required. Cross it anywhere, even at a single spot, and a code-compliant guard has to run along that section.
The 30-Inch Threshold
IRC Section R312.1.1 is the provision that decides the question. It requires guards on any open-sided walking surface more than 30 inches above the floor or grade below, measured vertically, at any point within 36 inches horizontally from the edge of the open side.1International Code Council. 2021 International Residential Code – Chapter 3 Building Planning Insect screening does not count as a guard.
So a deck sitting 28 inches above flat ground all the way around needs no railing at all. That is the clean case. The complications start when the ground isn’t flat, and most yards aren’t.
How to Measure on Real Ground
The measurement runs vertically from the top of the finished deck surface to the grade below, but not to the dirt directly under the edge. The code specifies a 36-inch horizontal zone from the edge of the open side, and the relevant ground level is the lowest point inside that zone.
The reason for the buffer is physical. A person falling from a deck edge pitches outward rather than dropping straight down. So if the yard slopes away, the fall height is measured to where they would actually land. A deck that looks like a comfortable two feet off the ground at the house side can easily exceed 30 inches three feet out into a sloping yard.
For any sloped or graded lot, check multiple points around the perimeter. The ledger-board side against the house is almost never where the problem shows up. Focus on the outer edge and the corners, especially where landscaping drops away, where a walkout basement pulls the grade down, or where drainage swales cut in. If you’re borderline anywhere, an inspector will find the worst spot, so you need to find it first. One point over 30 inches within the 36-inch band, and the whole section along that edge needs a guard.
Multi-Level Decks
Each level of a stepped or tiered deck is evaluated on its own. A lower platform can sit comfortably under the 30-inch line while the level above it crosses over. That arrangement is fully code-compliant: a railing-free lower platform can flow directly into a guarded upper deck. You are not required to guard the lower level just because the higher one needs a guard.
What the Guard Has to Do Once It’s Required
Once any part of the deck crosses the 30-inch threshold, the guard along that edge has to meet three separate requirements. Miss any one and the section fails inspection.
Height
The top of the guard must be at least 36 inches above the deck surface, measured vertically from the walking surface to the top of the rail.1International Code Council. 2021 International Residential Code – Chapter 3 Building Planning Some jurisdictions require 42 inches, matching the commercial standard, so confirm with your local building department. The measurement is taken from the finished deck boards, not from the joists underneath.
Openings
No opening between the walking surface and the top of the guard can allow a 4-inch sphere to pass through. That rule governs baluster spacing and it applies to every gap: between balusters, between a baluster and a post, and between the bottom rail and the deck surface.1International Code Council. 2021 International Residential Code – Chapter 3 Building Planning It exists to keep small children from slipping through or getting their heads stuck.
Stairs have one narrow exception. The triangular opening formed where the stair tread, riser, and bottom rail meet is allowed a 6-inch sphere, because the geometry of that triangle makes it much harder to slip through than a rectangular opening of the same nominal size.
Load
The guard must resist a 200-pound concentrated load applied at the top of the rail. Where the top rail also serves as a handrail, that load must be resistible in any direction. Where it does not, the load applies downward and horizontally away from the walking surface.
Most guards that fail this test fail at the post-to-frame connection, not in the rail itself. Lag screws driven into a rim joist are a common shortcut and a common failure. Code-compliant post connections generally require through-bolts into solid framing, with holdown hardware to resist the tension created when someone leans against the top rail. For a 36-inch guard, the tension at the base of the post can reach around 1,800 pounds. The connection engineering matters more than the rail’s appearance.
Guards Are Not Handrails
These are two different code items and confusing them causes trouble. A guard is a barrier at the edge of an elevated surface. A handrail is a graspable rail alongside stairs. Different purposes, different dimensions, different triggers.
A guard is triggered by height above grade (the 30-inch rule). A handrail is triggered by stair count: any stairway with four or more risers needs a handrail on at least one side, regardless of how high the deck itself sits. So a low deck that needs no guard can still need a handrail on its steps.
The handrail must be between 34 and 38 inches above the slope formed by the tread nosings, with a graspable profile: a circular cross section between 1¼ and 2 inches in diameter, or a non-circular profile with a perimeter between 4 and 6¼ inches. Your hand has to be able to wrap around it.
A single rail can serve both functions where a stair is open-sided and elevated enough to require a guard, but it then has to satisfy both sets of dimensions. Stair guards are measured a little differently from deck guards: at least 34 inches from the line connecting the tread nosings, rather than 36 inches from a walking surface. The 4-inch sphere rule still applies to the openings, with the triangular exception noted above.
Check the Local Code Before You Build
The IRC is a model code. Each state, county, or city adopts it through its own process and can modify the text on the way in. As of 2025, jurisdictions are scattered across several editions: a handful still enforce the 2015 IRC, roughly a dozen use the 2018 edition, many have moved to 2021, and a growing number have adopted the 2024 IRC. The core guard rules, including the 30-inch threshold, the 36-inch guard height, and the 4-inch sphere, have held consistent across all of them.
The differences show up in local amendments. Some jurisdictions require 42-inch guards. Some set stricter permit thresholds. Some require engineered plans above a certain deck size. The IRC sets a floor, not a ceiling. A call to your local building department to confirm the code edition in force and any local amendments is the cheapest step in the whole project, and it’s the one that keeps you from tearing out finished work.
One last point worth stating plainly: a deck that qualifies as permit-exempt is not exempt from the code itself. If your build sits under 30 inches everywhere and needs no railing, you still need to meet structural, footing, and material requirements. The 30-inch rule tells you whether a guard is required. It does not tell you the deck itself is off the code’s radar.