Skip to content
IRC R312 & R507.10

Deck Railing Height Code Requirements

The 36-inch rule, the 42-inch exceptions, baluster spacing, load testing, and what inspectors actually check.

By Brian Williams

Quick Answer: Residential deck railings must be at least 36 inches tall, measured from the deck surface to the top of the top rail. Required on any deck surface more than 30 inches above grade. Some states and cities require 42 inches. Balusters must not allow a 4-inch sphere to pass between them.

The Two Key Measurements

Trigger

30″

Deck height above grade

If your deck surface is more than 30 inches above the ground below at any point within 36 inches horizontally of the deck edge, you must have a guard. Measure at the deepest point, not the average.

IRC R312.1.1

Minimum

36″

Guard height

Measured from the deck walking surface to the top of the uppermost rail. If you have a cap rail on top of the top rail, measure to the top of the cap. Most modern pre-built systems come at 36 or 42 inches exactly.

IRC R312.1.2

The 4-Inch Sphere Rule (Baluster Spacing)

IRC R312.1.3 says no opening in the guard may allow passage of a sphere 4 inches in diameter. This is the most-failed item on deck inspections after top-rail height. Inspectors carry an actual 4-inch ball and test every gap.

Standard deck

4-inch sphere cannot pass anywhere between the deck surface and the top rail.

Rule: ≤ 4″ any gap

Stair triangle

The triangular opening formed by the riser, tread, and bottom rail uses a 6-inch sphere rule.

Rule: ≤ 6″ triangle only

Stair guards (open side)

On open-sided stairs, the infill must prevent passage of a 4-3/8-inch sphere.

Rule: ≤ 4-3/8″ any gap

Practical spacing math

With a standard 1-1/2″ square baluster, the maximum center-to-center spacing to stay under 4″ clear is about 5-3/8″. Cut your baluster layout to the inch with this in mind — if the last gap in your run stretches to 4-1/8″, the inspector will fail you, and the fix is tearing out and re-spacing the entire run.

Load Requirements

Height and spacing are only half of code compliance. The assembly must also carry real forces. Pre-manufactured kit railings come with test certifications — shop-built wood railings must meet the same numbers by construction.

ElementRequired LoadReference
Top rail / handrail200 lb concentrated load in any directionIRC Table R301.5
Infill (balusters, glass, cable)50 lb load on 1 sq ft area, horizontalIRC Table R301.5
Post-to-deck connectionMust transfer 200 lb top-rail load to the structureIRC R507.10 (via engineering)
Combined loadsTop rail and infill loads not applied simultaneouslyIRC R301.5 footnote

State-by-State Railing Height Variations

All 50 states have adopted some version of the IRC, but many modify the residential guard section. Verify adopted code edition and local amendments with your building department.

StateMinimum HeightNotes
California42 inchesCBC (California Building Code) requires 42" guards on decks over 30" above grade in many jurisdictions. Verify with local amendments.
Oregon36 inchesOregon Residential Specialty Code follows IRC minimum. Some coastal jurisdictions adopt amendments.
Washington36 inchesWAC 51-51 follows IRC. Seattle and other major cities may have local amendments.
Florida36 inchesFlorida Building Code Residential follows IRC minimum. HVHZ (Miami-Dade, Broward) has additional wind-load requirements on the assembly itself.
Texas36 inchesNo statewide residential code. Each municipality adopts its own. Most Texas cities follow the IRC at 36".
New York36 inches (42" in NYC)NYS Residential Code follows IRC. NYC Building Code requires 42" guards on most residential decks.
Massachusetts36 inches780 CMR Ninth Edition follows IRC. Some local amendments exist for oceanfront construction.
Colorado36 inchesIRC adopted statewide. Denver and Boulder have local amendments but generally retain 36" minimum.

Local amendments can override state code. Always verify with your permit office before building.

Most Common Railing Inspection Failures

Top rail below 36 inches

Usually because the installer measured to the top of the structural 2x4 and forgot the top cap added height — or because deck boards were installed after the railing was set and the deck surface came up 1-1/2″.

Baluster gap at end of run exceeds 4 inches

Standard baluster spacing math assumes even division. The last gap often ends up wider. Fix: adjust spacing math before installing; don't just space evenly and leave a wide end gap.

Loose or under-anchored post

Posts bolted only to the rim joist with lag screws can flex under the 200-lb load test. Code-compliant options: notched post with bolted connection through the rim and joist, or an engineered post base.

Infill fails load test

Cable railings not pre-tensioned to 200+ lbs will deflect and allow the 4-inch sphere to pass under load. Cable manufacturers publish tension specs — follow them.

Graspable handrail missing on stairs

A deck rail on stairs must double as a handrail where there are 4 or more risers. Handrails have separate dimensional requirements: 34-38 inches tall and a graspable profile (1-1/4″ to 2″ diameter, or equivalent).

Guard opening at deck floor exceeds limit

The opening between the deck surface and the lowest rail must also pass the 4-inch sphere test. A common failure is installing the bottom rail 5 inches above the deck for "drainage" — that gap counts as an opening.

Frequently Asked Questions

What is the minimum deck railing height under IRC code?

The International Residential Code (IRC) sets the minimum residential guard height at 36 inches, measured from the deck surface to the top of the guard. This applies to any deck surface more than 30 inches above grade. Some states and cities amend this to 42 inches.

At what height does a deck need a railing?

Under IRC R312.1.1, a guard is required on any open-sided walking surface located more than 30 inches above the floor or grade below. For decks, the measurement is taken from the deck surface to the grade or floor below at its deepest point within 36 inches horizontally of the deck edge.

What is the maximum spacing between balusters?

Balusters (vertical infill pickets) must be spaced so a 4-inch sphere cannot pass between them. For most decks, this works out to roughly 3.5 inches clear spacing with a standard 1.5-inch square baluster. The 4-inch rule applies everywhere except the triangular opening at stair risers, where a 6-inch sphere rule applies.

Do I need 42-inch railings on my deck?

The 42-inch requirement typically applies to commercial buildings, but some states and local jurisdictions have amended the residential code to require 42 inches for specific situations: decks more than 6 feet above grade, decks adjacent to steep slopes, or in certain coastal and mountain jurisdictions. Always check your local adopted code.

How much weight must a deck railing support?

Under IRC Table R301.5, the top rail must resist a 200-pound point load in any direction. The infill (balusters, glass, cable) must resist a 50-pound load applied over a 1-square-foot area. Most pre-manufactured railing systems are tested and certified to these loads.

Does the railing height include the top rail?

Yes. The 36-inch (or 42-inch) measurement is from the deck surface to the top of the top rail, which is the graspable top surface. If you have a cap rail on top of a structural top rail, the measurement goes to the top of the cap.

Can I use cable or glass railing instead of balusters?

Yes, if the infill still prevents a 4-inch sphere from passing through. Cable railings must be tensioned to meet this rule under load (cables deflect, so they usually need to be spaced around 3 inches and pre-tensioned to 200+ pounds). Glass panels must be tempered and often require engineered attachment hardware.

What happens if my railing fails inspection?

The inspector will fail the inspection, you will not receive a certificate of occupancy for the deck, and you will need to correct the railing and schedule a reinspection (often with a $50 to $150 reinspection fee). Common failures: top rail below 36 inches, balusters spaced too far apart, loose or under-anchored posts.

References are to the 2021 International Residential Code. Your jurisdiction may have adopted a different edition or local amendments. Always verify with your local building department. This is not engineering advice.