Deck stair railing must comply with the building code adopted in your jurisdiction, and in most U.S. residential construction that code is the International Residential Code (IRC), which requires a guard on the open sides of stairways and landings that are more than 30 inches above the floor or grade below, sets the guard height at a minimum of 36 inches, limits openings in the guard so a 4-inch sphere cannot pass through, and separately requires a graspable handrail between 34 and 38 inches above the stair tread nosings. Those are the headline numbers, but they are not the whole answer: the railing on a deck stair consists of two related but legally distinct components—the guard and the handrail—and they carry different height rules, different measurement points, and different spacing requirements. Local amendments also commonly raise the guard height and change other details, so the exact standard that applies to your stairs depends on which code edition and which local amendments your building department enforces. The rest of this article explains how those rules fit together, why the two components are regulated separately, and which details most often cause a failed inspection.
Guards and handrails are not the same thing
The building code's terminology confuses many homeowners because a single physical railing assembly along a deck stair often serves both functions. A guard is the protective barrier that keeps people from falling off an elevated walking surface—a deck, a landing, or the open side of a stair. A handrail is the graspable member people hold for balance while climbing or descending.
Because the two serve different purposes, the code treats them differently. Guards are regulated mainly by height above the surface and by how small the openings in them must be. Handrails are regulated by height above the stair treads, by grip size and shape, and by how far they may sit from the wall or guard they accompany. A railing that measures 36 inches above the deck surface satisfies the guard height, but if that same top rail is 36 inches above the stair nosings it also falls within the 34-to-38-inch handrail range—which is why many deck stairs use one continuous rail assembly to serve both roles. That works only when the combined assembly meets every requirement of both components at once.
When a deck stair needs a guard
Under the IRC's general guard provisions, guards are required on the open-sided portions of walking surfaces—including floors, stairs, ramps, and landings—that sit more than 30 inches above the floor or grade below, measured vertically at any point within 36 inches horizontally of the open edge. The practical consequence for deck stairs is straightforward: if the stair rises from grade to a deck that is more than 30 inches high, the open side of those stairs generally needs a guard, just as the deck edge does. A short set of steps down to a patio, with the deck only a foot or two above grade, typically does not trigger the guard requirement.
Two qualifications matter here. First, the 30-inch trigger is measured to the surface below, so a stair descending to a sloped yard may cross the threshold partway down; the requirement applies where the drop exceeds the limit, not uniformly to the entire run. Second, the trigger is a minimum, not a ceiling—local codes may require guards at lower heights, so the only reliable answer for a specific address comes from the local building department.
Guard height: the 36-inch baseline and the 42-inch question
The IRC sets the minimum guard height at 36 inches, measured vertically from the walking surface to the top of the guard. That is the standard most residential decks are built to.
The 42-inch figure that circulates in deck-building discussions comes from a different context. The International Building Code (IBC), which governs commercial and many multi-family buildings, requires guards at 42 inches. Some states and municipalities also amend the residential code upward—California is frequently cited as requiring 42-inch guards on residential decks—so a homeowner who reads "42 inches" online may be looking at a commercial requirement, a local amendment, or both. Neither number is wrong; they simply apply to different buildings or different jurisdictions. For a one- or two-family home under the unamended IRC, 36 inches is the baseline.
The measurement itself is also more particular than it appears. The height is taken from the deck or landing surface to the top of the guard, and on stairs the guard height is measured from the tread nosings. A guard that is 36 inches above the deck but only 33 inches above the stair treads because of how it was stepped or sloped does not comply along the stair.
Baluster spacing and the 4-inch sphere rule
Guard height alone does not make a guard safe. The IRC's general guard provisions also require that openings in the guard not allow passage of a sphere 4 inches in diameter. The intent is to prevent a small child from slipping through or becoming trapped. The rule applies to the spaces between balusters, between the bottom rail and the tread or deck surface, and to decorative patterns in prefabricated railing panels.
This is one of the most common inspection failures because it is easy to get wrong by a fraction. A layout that spaces balusters evenly across a panel can produce openings slightly over 4 inches at the ends, and a bottom gap that looks small can still admit the test sphere. The measurement is of the opening, not the center-to-center spacing of the balusters, so the baluster width itself factors in. Deck stairs add a wrinkle: on a sloped stair guard, the openings between balusters are measured perpendicular to the rail, and the triangular gap that forms where a horizontal bottom rail meets a sloped stair can exceed the limit even when the vertical baluster spacing is correct.
Handrail height, grip, and the stair-specific rules
The handrail requirements are where deck stairs diverge most sharply from the deck edge. The IRC's stair provisions require handrails on at least one side of stairways of a certain number of risers (four or more in the commonly adopted residential text), and they set the handrail height at not less than 34 inches and not more than 38 inches, measured vertically from the stair tread nosings to the top of the handrail. Note the measurement point: the nosings of the treads, not the deck surface. On a sloped run, that means the handrail height is checked along the incline, and a rail that is correctly 36 inches above the deck landing can still be out of range over the treads if it was installed level rather than parallel to the stair slope.
Grip is regulated separately. A circular handrail must have an outside diameter of at least 1¼ inches and no more than 2 inches; non-circular profiles must meet perimeter and cross-section limits intended to keep the rail graspable. A wide, flat top rail that feels comfortable as a guard cap often fails as a handrail because the hand cannot close around it. This is the central tension in combined guard-and-handrail assemblies: the guard wants a substantial top member, and the handrail wants a graspable one. Many compliant designs solve this by adding a dedicated graspable rail inside or below the guard's top cap.
Handrails also must be continuous for the full length of the stair, must return to a wall, guard, or post at the ends, and must be separated from the adjacent surface by enough clearance for the hand to grip without scraping knuckles. The IRC's stair chapter addresses these details, and they apply to deck stairs the same way they apply to interior stairs.
A quick comparison of the key dimensions
| Requirement | Typical IRC residential standard | Measured from |
|---|---|---|
| Guard required on open stair sides | Drop exceeds 30 inches | Floor or grade below, within 36 inches horizontally of the edge |
| Guard height | Minimum 36 inches (42 inches under IBC and some local amendments) | Deck, landing, or tread nosing to top of guard |
| Guard opening limit | 4-inch sphere must not pass | The opening itself, perpendicular to the rail |
| Handrail height on stairs | 34 to 38 inches | Stair tread nosings to top of handrail |
| Handrail grip (circular) | 1¼ to 2 inches outside diameter | The rail's cross section |
The table reflects the widely adopted IRC baseline; it is not a substitute for the code text your jurisdiction enforces.
Why local adoption changes the answer
The IRC is a model code. It has no legal force until a state or local government adopts it, and adoption comes with amendments. That produces three layers of variation that matter to anyone asking "what does the code require":
Edition. The IRC is revised on a three-year cycle, and jurisdictions adopt different editions. Provisions on guards and handrails have been refined across editions, so a detail that was acceptable under one edition may not be under a later one. The 2024 edition is the most recent in the cycle, but many jurisdictions still enforce earlier editions.
Amendments. States and cities routinely amend height requirements, handrail rules, and guard details. California's higher guard requirement is the best-known example, but it is not the only one. Some jurisdictions require handrails on both sides of wider stairs, tighten baluster spacing, or add requirements for deck stair construction that go beyond the model text.
Use and occupancy. A deck attached to a single-family home is generally governed by the residential code. Decks serving multi-family buildings or commercial occupancies fall under the IBC, with its 42-inch guard height and other differences. The same physical stair can therefore be regulated differently depending on what it serves.
For a real project, the controlling documents are the code edition and local amendments adopted by your building department, together with the permit drawings approved for your job. A deck contractor's "standard" practice, a manufacturer's installation guide, or a number found online is not a substitute for those documents—and where a manufacturer's guide is more restrictive than the code, following the guide is usually the safer course, and sometimes a condition of the product's listing.
Permits, inspections, and existing decks
New deck stairs and railings almost always require a building permit, and the railing is a standard inspection item. Inspectors check guard height, the 4-inch sphere rule, handrail height along the stair, grip dimensions, continuity and end returns, and the attachment of posts and rails. Posts that are merely toenailed or lagged into the deck rim without proper blocking or hardware are a frequent point of failure, because a guard must resist a concentrated load applied at its top—it is a safety barrier, not decoration.
For existing decks, the question is more nuanced. Code requirements generally attach at the time of construction or when a permit is issued, and a deck built decades ago may have been legal under the rules then in force. But a railing that is unsafe by current standards is still unsafe, and many jurisdictions require upgrades when a deck is substantially altered, repaired, or when a property changes use. When in doubt, the building department can tell you what triggers an upgrade, and a reputable deck contractor can assess whether an existing stair railing meets current guard and handrail criteria.
What this means for your project
The practical answer to "what does the deck stair railing code require" is a layered one. Start with the IRC baseline—guards where the drop exceeds 30 inches, guards at least 36 inches high with openings that reject a 4-inch sphere, handrails at 34 to 38 inches above the stair nosings with a graspable profile—then confirm the edition and amendments your local building department enforces, and confirm which code family applies to your building's use. Get the permit before building, build to the approved drawings, and treat the manufacturer's instructions for prefabricated railing systems as part of the requirement rather than an optional suggestion. The numbers are simple; applying the right numbers to your specific stair, in your specific jurisdiction, is where the care is required.
This article provides general information about commonly adopted building code provisions and is not a code determination for any specific project. Building codes vary by jurisdiction, edition, and occupancy, and only your local building department or a licensed design professional can confirm the requirements that apply to your deck and stairs.