Deck Railing Height & Code Requirements
What the IRC actually requires for deck guardrails and handrails — heights, spacing, load capacity, and the details that fail inspection most often.
When you need a railing at all
One number governs: 30 inches. If any part of the walking surface is more than 30 inches above the grade or surface below — measured within 36 inches horizontally of the deck edge — a guardrail is required on that edge. Below 30 inches, guards are optional, which is why so many low platform decks are built rail-free on purpose. Note that grade can slope: a deck 24 inches high at the house may be 40 inches high at the far corner, and that corner needs a guard.
Required heights at a glance
| Element | IRC requirement | Measured from |
|---|---|---|
| Deck guardrail (residential) | 36" minimum | Deck surface to top of rail |
| Deck guardrail (many local codes, CA, commercial) | 42" minimum | Deck surface to top of rail |
| Stair guardrail | 34"-38" | Tread nosing to top of rail |
| Stair handrail (4+ risers) | 34"-38" | Tread nosing to top of grip |
| Baluster opening | < 4" sphere | Clear gap between members |
| Stair tread triangle opening | < 6" sphere | Riser, tread & bottom rail |
| Bottom rail to deck gap | < 4" | Deck surface to bottom rail |
| Handrail grip diameter | 1-1/4" to 2" | Round cross-section |
The 200-pound load test
A guardrail must resist a 200-pound concentrated load applied in any direction at the top. That single requirement fails more deck railings than any height issue, because the load path runs through the post-to-frame connection. Lag screws driven into the side of a rim joist do not pass. What does pass: through-bolts with washers into blocking, or a rated hold-down tension device like a Simpson DTT2Z at each post. Notching the post around the rim joist without a tension tie is the classic failure — the joint pries open under lateral load.
Baluster spacing math
"Less than 4 inches" means a 4-inch sphere can't pass anywhere, including at the ends of a run and under the bottom rail. For a 1-1/2 inch square baluster, that gives a maximum center-to-center spacing of about 5-3/8 inches. For a 3/4-inch round metal baluster, roughly 4-5/8 inches. Always divide the rail length evenly rather than starting at one end with a fixed spacing — you'll otherwise end with an oversized gap at the post. The baluster calculator handles the even-division math for you.
Handrails versus guardrails
They're different things and a stair often needs both. A guardrail prevents falls off the open side. A handrail is something you can wrap your hand around, mounted 34-38 inches above the tread nosing, continuous for the full flight, and returned to a post or wall at each end so a sleeve can't catch. A 2x4 laid flat on top of a guardrail is not graspable and will fail inspection on any flight with four or more risers.
Details inspectors flag most
In rough order of frequency: post attachment without a tension tie; the gap under the bottom rail exceeding 4 inches after decking settles; missing handrail returns; the last baluster gap at a post being wider than the rest; stair guard height measured from the tread surface rather than the nosing; and pool decks with climbable horizontal members. Fixing any of these after the fact means pulling railing apart — worth getting right the first time.
Local codes override everything here
The IRC is a model code. Your jurisdiction adopts a version of it, sometimes with amendments — 42-inch guards, 36-inch minimum stair widths, or restrictions on cable railings are all common local changes. Call your building department before ordering railing, and see the deck permit guide for what to expect at plan review. Price your railing with the deck railing calculator.
Frequently asked questions
How high does a deck railing need to be?
The IRC requires residential deck guardrails to be at least 36 inches tall, measured from the deck surface to the top of the rail. Many jurisdictions and all commercial decks require 42 inches, and California requires 42 inches statewide — always confirm locally.
When is a deck railing required?
A guardrail is required whenever the walking surface is more than 30 inches above the grade or surface below, measured within 36 inches horizontally of the deck edge. Below 30 inches, a railing is optional.
What is the maximum gap between deck balusters?
A 4-inch sphere must not pass through any opening in the guardrail. In practice that means balusters spaced no more than 3-7/8 inches apart clear, and the triangular gap at stair treads must block a 6-inch sphere.
How much force must a deck railing withstand?
The IRC requires guardrails to resist a 200-pound concentrated load applied in any direction at the top rail, and infill to resist 50 pounds per square foot. That load requirement is why post attachment hardware matters more than post size.
What height should a deck stair handrail be?
A graspable handrail must be 34 to 38 inches above the tread nosing, and is required on any stair flight with four or more risers. The guardrail on the same stair still needs to meet its own 34-38 inch (stairs) or 36-inch (deck) height rule.
Are horizontal deck railings allowed?
Horizontal rails and cable railings are permitted by the IRC as long as openings block a 4-inch sphere, but many local jurisdictions restrict climbable horizontal members — especially around pools. Check before you buy a cable kit.
Railing kits, balusters & hardware
As an Amazon Associate we earn from qualifying purchases. Affiliate disclosure.

Egadis 1 Pack 36 in. H x 5 ft. W Porch and Deck Railing Kit Without Post, Black Textured Powder-Coat Finish Modular Aluminum Railing System for Outdoor Decks, Porches & Balconies(1 Panel)
View on Amazon
Muzata 12-16FT Modular Black Cable Railing Kit 36 Inch 4 Stair Post Kit Complete Set Cable Railing System for Stairs Length Adjustable Easy DIY with Paper User Guide (No Handrail) RW25
View on Amazon
105 Pack 26 inch Aluminum Balusters for Deck Railing,Black Round Metal Spindles for Staircase,3/4" Diameter Hollow Deck Ballasters with Screws and Connectors for Railing Fencing Porch Stair Spindles
View on Amazon
Muzata 8-12ft Black Complete Cable Railing Kit for Stairs Pre-Crimped 36 Inch Cable Railing System with Post Handrail Length Adjustable Easy DIY with User Guide Complete Set RC09
View on AmazonGet your deck estimate in 60 seconds
Free, no signup required.
Get the Smart Decking Calculator app
Estimate decks on the go, save projects, and share with contractors.
Building something else? Try our sister calculators
Smart Fencing Calculator
Estimate fence cost by material and linear footage.
Smart Roofing Calculator
Free roof replacement cost estimates by material.
Smart Drywall Calculator
Android app — drywall sheets, mud, and tape estimates.
Smart Fencing Calculator
Android app — fence cost estimates on the go.