Measuring for a guard before you calculate
A guard and a handrail are not the same object, even when they sit on the same post. Get the reference points right first, and everything else on this page follows.
Find your fall height
Measure straight down from the walking surface — the deck, landing, or the leading edge line of the stair treads — to the grade or floor below, at the point where that drop is greatest within 36" horizontally of the edge.
Pick the guard location
An open stair guard is measured from the nosing line (an imaginary line connecting the leading edge of every tread). A deck, landing, porch, or balcony guard is measured straight up from the flat walking surface itself.
Confirm the applicable code
Residential one- and two-family construction almost always falls under the IRC. Multi-family, commercial, and most public buildings fall under the IBC, which sets a taller minimum. Check with your local building department if you're unsure which applies.
Measure your largest opening
Find the widest gap anywhere in the guard's infill — between balusters, cables, or panel edges — and enter it in the Advanced panel to check it against the sphere rule.
The four checks behind every result
Nothing on this page is a black box. Here's exactly what runs when you change a number.
Is a Guard Required?
Once a walking surface drops more than 30" to the grade or floor below at any point within 36" horizontally, a guard becomes mandatory — regardless of whether the edge belongs to a stair, deck, landing, or balcony.
Minimum Guard Height
Residential construction under the IRC needs at least 36". Commercial and multi-family construction under the IBC needs at least 42". Your entered height is checked against whichever you select.
General Opening Limit
A 4" sphere must not be able to pass through any opening in the guard's infill — balusters, cables, horizontal rails, or panel gaps — anywhere except the one exception below.
Stair-Triangle Exception
The triangular gap formed where the sloped bottom rail meets the riser and tread on an open stair is allowed a larger 6" sphere, because the tread geometry makes a 4" gap impractical to build there. Every other opening on the same guard still uses the 4" limit.
Walking through a real 46" deck guard
Same four checks, filled in step by step, for a walkout deck with an attached stair, 46" above grade — the default this calculator loads with.
Is a guard required?
46" of fall height is well past the 30" trigger, so a guard is required on both the flat deck edge and the open side of the attached stair.
Minimum height
This is a single-family home, so the IRC applies: minimum guard height is 36". On the flat deck it's measured straight up from the decking; on the stair it's measured from the nosing line instead, which is why the same 36" rail can look shorter on the rake if you measure from the wrong line.
General opening check
The homeowner is planning 2x2 wood balusters. Spaced to pass the 4" sphere rule everywhere on the flat deck section, that's the number this calculator checks the entered opening against.
Where the stair triangle overrides the general rule
Down the stair section, the same baluster spacing that satisfies the flat-deck 4" rule leaves a larger triangular gap at the bottom of each baluster, where the sloped rail crosses the riser and tread. Rather than forcing tighter, harder-to-build spacing down the whole rake to close that specific triangle to 4", code allows it up to 6" at that one location only — every other opening on the same stair guard still has to pass the 4" test.
This is exactly why the triangle exception exists as a separate check on this page instead of being folded into the general opening limit — treating the whole guard as one flat 4" rule would either fail a perfectly legal stair rail or, applied the other way, let a 6" gap slip through on the flat deck section where it isn't allowed.
IRC vs. IBC guard requirements, quick reference
This calculator checks your result against the limits below. Full code also covers post spacing, guard-to-guard continuity, and handrail requirements — see the linked calculators for those.
| Requirement | Residential (IRC) | Commercial (IBC) |
|---|---|---|
| Guard required above | 30" | 30" |
| Minimum guard height | 36" | 42" |
| Max opening (general) | 4" sphere | 4" sphere |
| Max opening (stair triangle) | 6" sphere | [VERIFY: confirm IBC applies the same 6" stair-triangle sphere exception, or a stricter figure, for commercial occupancies] |
| Concentrated load | [VERIFY: confirm current concentrated load figure, commonly cited around 200 lb, for one- and two-family dwellings] | [VERIFY: confirm current concentrated load figure for commercial occupancy — varies by occupancy category] |
| Uniform load | [VERIFY: confirm current uniform load figure, commonly cited around 50 lb/ft] | [VERIFY: confirm current uniform load figure for commercial occupancy — varies by occupancy category] |
Reference only — always confirm against your local jurisdiction's adopted code edition before building.
Openings, loads & when you don't need a guard
A guard can pass the height check and still fail inspection on three things this section covers — infill spacing, structural load, and confusing it with a handrail.
Guard vs. handrail — not the same object
A guard is a barrier that keeps someone from falling off an edge; a handrail is a graspable rail that helps someone climb or descend stairs safely. They're often the same physical assembly on an open stair, but each has its own height requirement — guard height and handrail height are checked separately, and meeting one does not satisfy the other. See the Handrail Height Calculator for that check.
Structural load requirements
A guard has to resist a single concentrated load applied at any point along the top rail, plus a separate uniform load applied along its length — this is a structural strength requirement, independent of the height and opening checks above, and it governs post size, spacing, and connection hardware. [VERIFY: confirm current load table values before sizing posts or connections]
When a guard isn't required
A single step, a shallow porch, or a low retaining wall under the 30" trigger doesn't require a code guard — though many builders add a rail anyway for comfort or insurance reasons. Re-check this any time grading, decking thickness, or finished floor height changes, since a small change can cross the 30" line.
Post spacing feeds back into opening spacing
The opening check on this page assumes you already know your largest gap. Working the other direction — from post spacing to a baluster layout that satisfies the 4" rule — is its own calculation; use the Baluster Spacing Calculator to get an exact layout before you buy material.
These are planning-stage checks, not a stamped structural design. An unusual load case, a very long unsupported rail span, or a non-standard material may need an engineer's sign-off regardless of what this calculator shows.
Common mistakes when planning guard height
Most failed guard inspections trace back to one of these five planning errors, not to bad carpentry.
Measuring from the wrong reference point
Guard height on an open stair is measured from the nosing line, not from the ground and not from each individual tread — using the wrong reference line can make a code-legal rail look short, or a short rail look legal.
Applying the 6" triangle exception everywhere
The larger sphere allowance only applies to the specific triangular gap at the base of a stair guard. Using it to justify wider baluster spacing across the whole rail, including any flat landing section, is a common and easily-caught mistake.
Forgetting guards apply off stairs too
Guards aren't just a stair item — any deck, porch, balcony, or landing edge that drops more than 30" needs one, and this is the check most often skipped on flat outdoor living spaces.
Confusing guard height with handrail height
Guard height (36"/42") and handrail height (typically 34"–38", measured to the top of the graspable rail) are two different code requirements. Building one rail to satisfy only one of them is a frequent inspection failure on open-stair guards.
Skipping the structural load check
A guard that's tall enough and has correctly-spaced balusters can still fail if the posts, blocking, or fasteners weren't sized for the required concentrated and uniform loads — height compliance and structural compliance are separate checks.
Not re-checking after grading or decking changes
Adding a paver patio below a deck, or swapping to a thicker decking board, changes the fall height and can push a borderline edge across the 30" guard-required line without anyone re-checking it.
When to use a guardrail height calculator
Guard height planning shows up anywhere a walking surface has an open edge and a drop below it.
Deck & Porch Builds
Setting guard height and baluster spacing before ordering railing material.
Walkout Basement Stairs
Checking whether the open side of a basement stair needs a guard, and how tall.
Balcony & Landing Guards
Confirming height and opening size on a flat elevated edge, no stair involved.
Deck Renovation
Checking an existing rail against current code before a resale inspection.
Permit & Plan Review
Confirming guard numbers on a plan set before submitting for permit.
Multi-Family & Commercial (IBC)
Applying the taller 42" commercial guard height on shared landings and stairs.