Building a deck railing an inch too short is one of the easiest ways to fail an inspection and, far worse, to create a genuine safety hazard. The correct height of deck railing is set by building code, not personal preference, and it exists because railings are the last line of defense against a serious fall. Get the number wrong and an inspector will make you tear it out and rebuild. Here is exactly how tall your railing needs to be, when one is required at all, and the related rules that trip people up.
Part of our Decks & Outdoor guide — explore the full guide →
The Standard Residential Railing Height
For most residential decks, the International Residential Code (IRC) requires a guard railing at least 36 inches tall, measured from the deck surface to the top of the rail. Many jurisdictions follow this exactly, but some, including commercial applications and certain local codes, require 42 inches. Because local amendments vary, always confirm the required height with your local building department before you buy materials.
- Residential IRC minimum: 36 inches
- Common commercial and some local codes: 42 inches
- Measured from: the finished deck surface to the top of the guard
When Is a Railing Required?
Not every deck needs a guard, and the trigger is height off the ground. Code requires a railing whenever the walking surface sits more than a set distance above the grade below. Under the IRC, a guard is mandatory when the deck is more than 30 inches above grade at any point within 36 inches of the edge.
That 30-inch threshold is measured to the ground, not to the next step. A low platform deck a foot off the lawn does not require a guard, but the moment any edge crosses 30 inches, the railing rule kicks in for the whole raised section.
Baluster Spacing: The 4-Inch Rule
Railing height is only half the safety equation. The gaps between balusters, the vertical pickets, are governed by the “4-inch sphere” rule. No opening in the railing may allow a 4-inch sphere to pass through. This prevents a small child from slipping through or getting their head trapped.
In practice, that means balusters are spaced no more than 4 inches apart. The rule also applies to the gap between the bottom rail and the deck surface. When you lay out pickets, measure the clear opening, not center-to-center, to stay compliant.
Stair Railing Rules Are Different
Stairs have their own set of numbers, and people often assume the deck guard height carries over. It does not. A stair handrail, meant to be gripped, must sit between 34 and 38 inches above the stair nosings. Meanwhile, the guard alongside open stairs still needs to meet guard height requirements.
- Stair handrail height: 34–38 inches above the nosing line
- Graspable handrail required on stairs with four or more risers
- Stair baluster spacing: a 4⅜-inch sphere may not pass (slightly larger than the guard rule)
The handrail must also be graspable, meaning a shape your hand can wrap around, not a flat 2×6 laid on edge.
Load Requirements You Cannot See
Height and spacing are visible, but code also demands strength you cannot eyeball. A deck guard must withstand a 200-pound concentrated load applied in any direction at the top rail without failing. This is why post attachment matters so much. Posts bolted through the rim joist with carriage bolts and reinforced with metal tension hardware pass; posts merely lag-screwed to the surface often fail the push test.
How to Measure Railing Height Correctly
Inspectors measure precisely, so you should too. The guard height is taken from the finished deck surface to the top of the top rail, not from the framing or the joist. This trips people up when they add a thicker decking board or a raised composite surface after framing the railing, which can shave the effective height below code.
Measure at several points along the run, because a deck surface is rarely perfectly level and a railing that meets height at one end may fall short at the other. If your decking is not yet installed when you set the posts, account for the finished board thickness so the final measurement lands above the minimum, never right at it. Building an extra half inch of height in gives you a safety margin against a failed measurement.
Material Choices and Height
The railing material does not change the required height, but it does affect how you hit it. Pre-manufactured aluminum and composite railing kits come in fixed heights, so confirm the kit meets your local code before buying, since some are sold in both 36- and 42-inch versions.
- Wood: fully adjustable height, cut posts and rails to any dimension
- Composite kits: fixed heights, verify the version matches your code
- Aluminum: pre-sized panels, check the listed guard height
- Cable and glass: still must meet guard height and the sphere rule at the top
Whatever the material, the same code numbers apply. A stylish cable railing is no exception to the height, spacing, and load requirements.
Passing Your Inspection
Inspectors check the same things every time, so build to them from the start. Before you call for inspection, run through this quick list:
- Guard height meets the local minimum (36 or 42 inches)
- No 4-inch sphere passes between balusters or under the bottom rail
- Stair handrail sits 34–38 inches and is graspable
- Posts are through-bolted and hardware-reinforced for the 200-pound load
- Guard is present anywhere the deck exceeds 30 inches above grade
Build It Right the First Time
Nailing the height of deck railing along with baluster spacing, stair-rail rules, and load strength is not red tape; it is what keeps a family safe on an elevated platform. Confirm your local numbers before you cut a single post, since the difference between 36 and 42 inches can mean rebuilding the entire railing. Build to code from the first post and your inspection becomes a formality rather than an expensive do-over.