Handrails and guards (railings) are among the most inspected parts of any stair or deck, because the rules exist to stop falls. This guide sets out the heights and spacing the International Residential Code (IRC) uses for houses and decks, compares them with the rules for commercial buildings, accessible routes and workplaces, and works out baluster spacing so the 4 inch rule is met. For the stair itself (risers, treads and stringers), use the stair calculator; for bedroom and basement escape windows, see the egress window size guide; for wheelchair ramps and their handrails, the ADA ramp slope calculator.
Quick reference: IRC (houses and decks)
| Item | Requirement | IRC section |
|---|---|---|
| Handrail required | On at least one side of each flight with four or more risers | R311.7.8 |
| Handrail height | 34 to 38 in, measured vertically from the sloped line joining the tread nosings | R311.7.8.1 |
| Handrail grip (round) | 1-1/4 to 2 in outside diameter | R311.7.8.5 |
| Handrail clearance to wall | At least 1-1/2 in | R311.7.8.2 |
| When a guard is required | Open sides of walking surfaces, stairs, ramps and landings more than 30 in above the floor or grade below (measured within 36 in horizontally of the edge) | R312.1.1 |
| Guard height | At least 36 in on decks, porches and landings; at least 34 in on the open sides of stairs, measured from the nosing line | R312.1.2 |
| Guard openings | Must not let a 4 in sphere pass; 4-3/8 in sphere on the open sides of stairs; 6 in sphere in the triangle formed by the riser, tread and bottom rail | R312.1.3 |
Where the 34 to 38 inches is measured
Handrail height is measured straight up from the nosing line, the sloped line touching the front edge of each tread, to the top of the rail. It is not measured from the back of the tread, and it is not measured at the landing. In practice builders set a straightedge on the nosings, mark 34 and 38 in up from it at the top and bottom of the flight, and aim for the middle, about 36 in, so small errors stay inside the range. Where a guard on the open side of a stair also serves as the handrail, its top must still fall within 34 to 38 in.
The handrail also has to be graspable: a round rail 1-1/4 to 2 in across, or a shape within the perimeter limits the code sets for non-circular rails. A flat 2×6 cap on a deck guard is fine as a guard top but does not count as a stair handrail; add a separate graspable rail on brackets. Handrails must run continuously for the full length of the flight, from a point above the top riser to a point above the lowest riser, and end in a return, a newel post or a safety terminal so sleeves cannot catch on them.
Baluster spacing that passes the 4 inch sphere
| Baluster width | Maximum on-centre spacing (decks, 4 in rule) | On stair sides (4-3/8 in rule) |
|---|---|---|
| 1-1/4 in round or square | 5.25 in (5-1/4) | 5.62 in |
| 1-1/2 in (2×2 actual) | 5.50 in (5-1/2) | 5.88 in |
| 1-3/4 in | 5.75 in (5-3/4) | 6.12 in |
| 2 in | 6.00 in (6) | 6.38 in |
| 3-1/2 in (decorative 4×4) | 7.50 in (7-1/2) | 7.88 in |
| Clear distance between posts | Balusters (1-1/2 in wide) | Resulting clear gap |
|---|---|---|
| 69 in (5 ft 9 in) | 13 | 3.54 in (3-9/16) |
| 93 in (7 ft 9 in) | 17 | 3.75 in (3-3/4) |
| 141 in (11 ft 9 in) | 26 | 3.78 in (3-3/4) |
Example: an 8 ft deck section with 4×4 posts at 8 ft on centre has 96 − 3.5 = 92.5 in between posts. With 1-1/2 in balusters you need 17, which leaves equal gaps of about 3.72 in. Mark the centre of the section, work out from it, and check the gap at both ends. Remember the bottom rail: the space between the deck surface and the bottom rail also has to pass the 4 in sphere test.
Other rules you may meet
- Commercial buildings (IBC): guards at least 42 in high (IBC 1015.3), handrails 34 to 38 in (IBC 1014.2). Apartment buildings and other non-house occupancies usually fall here.
- Accessible routes (2010 ADA Standards): handrail tops 34 to 38 in above the stair nosings or ramp surface (505.4), round rails 1-1/4 to 2 in (505.7), continuous on both sides of ramps and stairs, with extensions at the top and bottom (505.10).
- Workplaces (OSHA 29 CFR 1910.29): the top rail of a guardrail system is 42 in, plus or minus 3 in, above the walking surface (1910.29(b)(1)), with mid-rails or equivalent openings below.
- Strength: the IRC requires guards and handrails to resist a 200 lb concentrated load applied in any direction at the top (Table R301.5). Posts bolted only through the deck rim board often fail this; use the post-to-joist hardware and blocking your code or the hardware maker shows.
Safety
These are minimums that vary by code edition and local amendment. A permit and inspection are usually required for new decks and stairs. Use the code adopted where you live, the connector maker’s instructions and, for anything unusual (glass, cable, tall decks, commercial use), a licensed professional.
Frequently asked questions
What is the code height for a stair handrail?
34 to 38 in, measured vertically from the line of the stair nosings to the top of the rail (IRC R311.7.8.1). Commercial (IBC) and ADA rules use the same range.
How high does a deck railing have to be?
Under the IRC, at least 36 in on decks more than 30 in above the ground below (R312.1.1, R312.1.2). Commercial buildings require 42 in (IBC 1015.3). Some states and cities amend this.
What is the maximum baluster spacing?
The gap must not pass a 4 in sphere (4-3/8 in on the open side of stairs), so with 1-1/2 in balusters the on-centre spacing must be under 5-1/2 in (IRC R312.1.3).
How many steps before a handrail is required?
Four or more risers in a flight need a handrail on at least one side (IRC R311.7.8).
What is the OSHA railing height?
For guardrail systems in general industry, the top rail is 42 in, plus or minus 3 in, above the walking surface (29 CFR 1910.29(b)(1)).
Sources
- International Code Council, 2021 International Residential Code (IRC). Requirements are paraphrased with their section numbers; local codes and amendments may differ, so confirm with your building department. Sections R301.5, R311.7.8 to R311.7.8.5, R312.1.1 to R312.1.3.
- International Code Council, 2021 International Building Code, Sections 1014.2 (handrail height) and 1015.3 (guard height), paraphrased.
- US Department of Justice, 2010 ADA Standards for Accessible Design, Sections 505.4, 505.7 and 505.10.
- US Department of Labor, OSHA, 29 CFR 1910.29(b)(1), guardrail systems.
Last reviewed: 24 October 2026. Numbers in the tables are our arithmetic from the sources listed; code sections are summarised, not quoted. How we check our work: methodology and corrections. Spotted an error? Please let us know.