The single most common reason a brand-new deck fails its final inspection is a railing detail just outside of code: a top rail an inch too low, balusters spaced a quarter inch too wide, or a guard that flexes when an inspector pushes on it. The railing requirements for decks set by the International Residential Code (IRC) are not arbitrary; they are written in response to real injury data from kids slipping through balusters and adults falling over short rails. Understanding the rules ahead of construction saves you from tearing out finished work after the fact.
Part of our Decks & Outdoor guide — explore the full guide →
When a Railing Is Required
IRC Section R312 requires guards on any walking surface more than 30 inches above the grade or surface below, measured at any point within 36 inches horizontally. Translation: if you can fall more than 30 inches off the edge of the deck, you need a guard. A deck 28 inches off grade with surrounding lawn does not legally need a railing, although adding one is still smart for usability.
Note the 36-inch horizontal projection clause. If your deck is built on a hillside and one side measures 24 inches to grade directly below but 38 inches to the sloped ground 30 inches out, you still need a railing on that side because the fall potential exists.
Minimum Guard Height
For residential one- and two-family dwellings, guards must be at least 36 inches tall, measured from the deck surface to the top of the rail. Some local jurisdictions, including most of California and parts of New York, require 42 inches. Always confirm with your local building department before framing.
- Standard IRC residential: 36 inches minimum
- Multi-family or commercial: 42 inches minimum
- Stair guards: 34 to 38 inches from nosing line
- Decks over 30 inches above grade: guard required
- Pool deck local codes can override: check before building
Baluster Spacing: The 4-Inch Rule
The most-failed inspection detail. IRC Section R312.1.3 requires that a 4-inch sphere cannot pass through any opening in the guard, except for the triangular openings formed by the riser, tread, and bottom rail of stairs, which use a 6-inch sphere.
Inspectors carry calibrated 4-inch test spheres and push them between every baluster. Wood balusters spaced 4 inches on center with 1.5-inch widths leave 2.5-inch gaps and pass easily. Metal balusters at 5/8 inch wide need to sit at 4-5/8 inches on center maximum. Miss this by a quarter inch over 40 feet of railing and you are pulling out and re-spacing every baluster.
Load Requirements
Code requires guards to resist a 200-pound concentrated horizontal load applied at any point along the top rail, and a 50-pound-per-sq-ft uniform load. In practice, that means posts must be solidly anchored, blocking must be installed between joists at every post location, and connection hardware must be code-rated.
The Simpson Strong-Tie DTT2Z deck tension tie ($14 each) is the most common solution for residential posts. Install two per post location, one on each side of the post, with structural screws or 1/2-inch carriage bolts through the rim joist and blocking. Lag screws into rim joists alone are no longer code-compliant in most jurisdictions and will fail load testing.
Stair Railing Requirements
Any deck stair with four or more risers requires a handrail on at least one side. Handrail height runs 34 to 38 inches measured vertically from the stair nosing line. Handrails must be graspable, which the code defines as a Type I (cross-section 1.25 to 2 inches) or Type II (larger graspable shape) profile.
Common mistakes include using a 2×4 laid flat as a handrail (not graspable, fails code) or a 2×6 (too wide). A simple 2×4 on edge meets graspability requirements and looks clean. Premade aluminum or composite handrails from Trex, TimberTech, or Fortress Building Products all meet Type I or Type II requirements.
Top Rail and Bottom Rail Details
The top rail must be continuous, except where it terminates at posts. Splices in the top rail must occur at a post. The bottom rail must sit no more than 4 inches above the deck surface to prevent the 4-inch sphere from passing under the rail. Gaps under the bottom rail are one of the more commonly overlooked failure points.
Wood top rails need to be a minimum 2×4 dimension. Metal and composite rails follow the manufacturer’s instructions; for example, Trex Transcend uses a 2-inch by 3.5-inch composite top rail with a structural aluminum insert rated for the 200-pound load requirement.
Post Spacing Maximums
For wood railings, posts can sit a maximum of 6 feet on center. Some manufacturers of composite railing systems allow up to 8 feet between posts due to the engineered structural inserts in their top rails. Always check the specific system’s installation instructions, which the inspector will reference.
Corner posts and posts at the top and bottom of stair runs all need their own anchorage. Skipping the post at the top of a stair to “open up” the transition will fail inspection every time.
Material Choices and Code Compliance
Wood, composite, vinyl, aluminum, and cable rail systems all meet code when installed per the manufacturer’s instructions. Cable rail systems, popular for their unobstructed views, require special attention. Cables must be tensioned to spec, typically 200 to 350 pounds per cable, and spaced so a 4-inch sphere cannot pass between them even under deflection. Feeney CableRail and Atlantis Rail Systems both publish detailed install specs and engineering tables that satisfy code requirements.
Glass panel railings are another popular option. Tempered safety glass panels must be at least 1/4 inch thick for interior runs and 3/16 inch for exterior, and the entire system needs to pass the 200-pound load test. Westbury Veranda Composite-Aluminum Hybrid runs about $80 to $130 per linear foot installed and is fully code-compliant.
Common Mistakes That Fail Inspection
The five most common reasons deck railings fail inspection are: top rail under 36 inches, baluster gaps over 4 inches, bottom rail gap over 4 inches, posts that flex visibly under the 200-pound load test, and stair handrails with non-graspable profiles. All five are fixable before the inspector arrives. Pull a tape measure, check each post for flex with both hands at the 200-pound point, run the 4-inch ball gauge along every baluster, and verify the handrail profile by hand.
One last detail: bring the published code reference and the manufacturer’s installation instructions to the inspection. Even when your install is perfect, having the documentation handy speeds the inspection from 45 minutes down to 10 and avoids back-and-forth over interpretation questions. Get the railing requirements for decks right the first time and the rest of the deck project goes much more smoothly.