Quick answer Under the 2021 IRC a handrail on a stair must sit 34 to 38 inches above the line of the tread nosings, and a flight of four or more risers needs one. A deck guard is a separate rail: at least 36 inches high, with no opening that passes a 4 inch sphere, and required once the drop is more than 30 inches.
The numbers at a glance
| Item | 2021 IRC | Section |
|---|---|---|
| Guard required above | 30 in drop to the ground below | R312.1.1 |
| Guard height | 36 in minimum | R312.1.2 |
| Guard on the open side of a stair | 34 in minimum, from the line of the tread nosings | R312.1.2 |
| Gap in a guard | A 4 in sphere must not pass | R312.1.3 |
| Gap on the open side of a stair | A 4⅜ in sphere must not pass | R312.1.3 |
| Handrail required | Flights of four or more risers | R311.7.8 |
| Handrail height | 34 to 38 in above the tread nosings | R311.7.8.1 |
| Handrail grip | 1¼ to 2 in round, or 4 to 6¼ in around | R311.7.8.5 |
| Load on the guard | 200 lb at the top, any direction | Table R301.5 |
England differs. Approved Document K requires that no gap in a guard lets a 100 mm sphere pass and sets its own heights for stairs and balconies, so read that document if you build there. Section numbers refer to the 2021 IRC; your jurisdiction may use another edition or amend the numbers.
When a deck needs a guard
The test is the drop, measured from the walking surface to the grade or floor below, at any point within 36 inches horizontally of the edge. If the drop is more than 30 inches anywhere along that open side, the whole side needs a guard. A deck that is 24 in high at the house and 40 in high at the far end because the ground slopes away needs a guard where it is higher, and builders usually carry the guard around the whole edge rather than stopping it at an arbitrary point.
A low deck under that height does not need a guard by the code, but a stair from it still needs a handrail when it has four or more risers. Some local rules are stricter, so check before you skip a railing. Your building department may also ask for a guard where the drop is small but the ground below is a hazard, such as a retaining wall, a window well or a stream.
The 30 inch figure is measured to the grade below, not to a step or a planter you have placed there. If you later change the ground level, for example by adding a patio against a low deck, the drop changes and so can the guard requirement.
Guard height
A guard on a deck must be at least 36 inches high, measured vertically from the walking surface to the top of the guard. Posts, top rails and caps all count if they form the top. On the open side of a stair, the guard may be as low as 34 inches, measured vertically from the line connecting the leading edges of the treads (an exception in R312.1.2). Many builders use 36 inches there too, which always passes.
The 36 in figure is a minimum, so a taller rail is allowed, and some jurisdictions require 42 inches for commercial or multi-family decks. Do not trim a guard to look better. If a cap rail is 1½ in thick and sits on a 34½ in rail, the top of the cap is what you measure, and any gap between the cap and the walking surface is included.
| Where | Deck or balcony guard | Stair guard |
|---|---|---|
| US, 2021 IRC | 36 in minimum | 34 in minimum from nosings |
| England, Approved Document K | 1,100 mm for balconies and external landings | 900 mm |
The 1,100 mm figure for balconies is from Approved Document K; check the current table because the guidance has been revised several times.
The gap rule: the 4 inch sphere rule
Balusters, panels or cables must not allow a 4 inch sphere to pass anywhere in the guard. The reason is a child's head. On the open side of a stair, the limit between the tread and the bottom rail is a 4⅜ inch sphere, and the triangle formed by the riser, tread and bottom rail may pass a sphere up to 6 inches. To get the baluster count and the gap for your opening, enter it in the baluster calculator.
The rule is a test, not a spacing. Apply it to every opening: between balusters, between a baluster and a post, between the bottom rail and the deck surface, and between cables. The gap under the bottom rail is the one people forget. A rail that sits 4½ inches above the boards fails, even if every baluster is correctly spaced. Raise the rail, or keep the clearance under 4 inches.
Cable railings are the hardest to pass. A cable can be pushed aside by a person leaning against it, so the 4 inch gap has to hold under load. Many cable systems space cables about 3 inches apart for that reason and need posts closer together or a tension device. Ask the maker for the tested spacing and follow it.
Strength is the rule people skip
A guard also has to resist load. The IRC requires guards to withstand a single concentrated load of 200 pounds applied at the top in any direction, and the infill must resist a smaller load on a one square foot area. Railings fail most often at the post attachment, not at the rail. The American Wood Council's DCA 6 shows post-to-frame connections that have been tested to meet the load. A post screwed into the side of a joist without blocking or hardware usually does not meet it.
A railing that looks solid can still fail the load test. Use the connection details in DCA 6 or an engineered system rather than guessing.
Stair handrail height and shape
A flight with four or more risers needs a handrail on at least one side. The top of the handrail sits 34 to 38 inches above the line of the tread nosings. The handrail is separate from the guard, and one rail can serve both only if it meets both sets of rules. This is the stair handrail height people mean when they ask how high a stair rail should be.
The rail must also be graspable. Handrail grip size is set by cross-section: a round rail between 1¼ and 2 inches across is accepted, and a non-circular rail must have a perimeter of 4 to 6¼ inches with no dimension over 2¼ inches, along with finger recesses where the shape is wide (R311.7.8.5). A flat 2×4 or 2×6 laid on top of a guard is not graspable by this test, so the stair needs a proper handrail.
- Continuity. The handrail runs for the full length of the flight, from above the top riser to above the lowest riser, and its ends return to a post or a wall so a sleeve cannot catch.
- Wall clearance. At least 1½ in between a handrail and an adjacent wall, so a hand can wrap around it.
- Open side. If the handrail is on the open side of the stair, it may form part of the guard, but the guard rules for height and gap still apply to the infill.
The riser and tread limits for the stair itself sit in R311.7 of the same chapter, and the stair calculator checks a rise and run against them.
A pre-inspection checklist
Run through this list before you call for inspection. It is a quick screen from this guide's reading of the code sections above, not an official form.
- Measure the drop at the highest point of every open side. If it is over 30 in, the guard is required.
- Measure from the walking surface to the top of the rail at several points. Every reading must be 36 in or more.
- Pass a 4 in ball, or a 4 in block, through every opening, including under the bottom rail and beside the posts.
- Push hard at the top of each post and each rail section. There should be no looseness at the connection.
- Check that every stair with four or more risers has a graspable handrail at 34 to 38 in.
- Check the stair guard openings with a 4⅜ in sphere, and the triangle at the riser with a 6 in sphere.
- Check that fasteners and hardware are rated for treated lumber and that the guard is fixed to the frame, not the decking.
If you build in England
Approved Document K covers protection from falling. It uses metric limits, and a 100 mm sphere is the test for gaps in a guard. The stair guard height is 900 mm, and for a balcony or external landing the height is 1,100 mm. Stairs have their own pitch and rise limits in the same document. Scotland, Wales and Northern Ireland each have their own building standards, so check the rules for your nation.
4 in sphere (US) = 102 mm 100 mm sphere (England) = 3.94 in 36 in guard (US) = 914 mm; 1,100 mm (England) = 43.3 in
The two systems are close but not equal, and a rail that passes in one can fail in the other by a few millimeters. If you are converting a plan, measure to the local standard rather than converting the number.
Gates, openings and benches
Gates are part of the guard, so the height and sphere limits apply to them as well. A self-closing, self-latching gate is required by some jurisdictions at pool barriers, which have their own rules, but a plain deck gate has to meet the same height and gap as the rail beside it. Check the gap under and beside the gate, which is where it most often fails.
Built-in benches and planters can turn into a climbing step. Where a bench sits against a guard, some inspectors measure the guard from the seat instead of the deck, so a bench can lower the effective height of the guard. The IRC does not spell out the rule, so ask your building department before you build one.
Bringing an old railing up to today's rules
Railings built a generation ago often fail on two counts: they are lower than 36 in, and the gaps between balusters are wider than 4 in. Neither fix is difficult, but both change the look.
- Low railing. Raise the top rail on new posts, or add a second rail on top. Make sure the posts are fixed well enough to carry the extra leverage, since a taller guard puts more moment on the post foot.
- Wide gaps. Add balusters between the existing ones, or replace the infill with a system that meets the 4 in limit.
- Loose posts. Strengthen the connection with the tested details in DCA 6 or an engineered post system.
- Stairs. Add a graspable handrail if the stair has four or more risers and none.
If you replace the railing as part of other work, the new work is normally held to the current code. Ask your building department whether a repair triggers a full upgrade where you live.
What inspectors fail most often
The failures are rarely exotic. Inspectors commonly look at the post connections first, then gaps, then height. The same few items come up again and again:
- Posts fixed with screws and no through-bolts or hold-downs.
- Measuring to the top of the cap in one place and to the rail in another, giving less than 36 in at the lowest point.
- A gap of 4 in or more under the bottom rail or beside a post.
- A stair with four or more risers and no graspable handrail.
- A handrail that stops short of the top or bottom riser, or ends in a way that can catch clothing.
Check them yourself first with a tape and a 4 in block. It is far cheaper than a failed inspection and a second visit.
Sources and further reading
- International Residential Code 2021, Chapter 3: Building Planning (R311.7 stairs, R312 guards)
- American Wood Council, DCA 6: Prescriptive Residential Wood Deck Construction Guide
- Approved Document K: Protection from falling, collision and impact (GOV.UK)
Section numbers are from the 2021 IRC. The handrail grip and wall clearance figures are from R311.7.8; confirm them against the edition your authority enforces.