Handrail and Railing Height: Stair and Deck Code

As an Amazon Affiliate we earn from qualifying purchases. All earnings are directly reinvested into this site to bring you free tutorials and project files - Thank you for your support!

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)

ItemRequirementIRC section
Handrail requiredOn at least one side of each flight with four or more risersR311.7.8
Handrail height34 to 38 in, measured vertically from the sloped line joining the tread nosingsR311.7.8.1
Handrail grip (round)1-1/4 to 2 in outside diameterR311.7.8.5
Handrail clearance to wallAt least 1-1/2 inR311.7.8.2
When a guard is requiredOpen 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 heightAt least 36 in on decks, porches and landings; at least 34 in on the open sides of stairs, measured from the nosing lineR312.1.2
Guard openingsMust 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 railR312.1.3
Summarised from the 2021 IRC; requirements paraphrased, not quoted. Many states and cities amend these sections, so check the code your building department enforces.

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 widthMaximum on-centre spacing (decks, 4 in rule)On stair sides (4-3/8 in rule)
1-1/4 in round or square5.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 in5.75 in (5-3/4)6.12 in
2 in6.00 in (6)6.38 in
3-1/2 in (decorative 4×4)7.50 in (7-1/2)7.88 in
The clear gap must be less than the sphere: on-centre spacing must be less than baluster width + 4 in (or + 4-3/8 in on stairs). Our arithmetic; aim for a gap of about 3-3/4 in to allow for bowed balusters.
Clear distance between postsBalusters (1-1/2 in wide)Resulting clear gap
69 in (5 ft 9 in)133.54 in (3-9/16)
93 in (7 ft 9 in)173.75 in (3-3/4)
141 in (11 ft 9 in)263.78 in (3-3/4)
Fewest balusters that keep every gap at 3-7/8 in or less (1/8 in margin under the 4 in sphere), with equal gaps at both posts. Our arithmetic: gap = (clear length − n × width) ÷ (n + 1).

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

  1. 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.
  2. International Code Council, 2021 International Building Code, Sections 1014.2 (handrail height) and 1015.3 (guard height), paraphrased.
  3. US Department of Justice, 2010 ADA Standards for Accessible Design, Sections 505.4, 505.7 and 505.10.
  4. 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.