How to Install a Stair Handrail to Code (Height, Brackets, and Returns)
A half-day DIY guide to installing a graspable stair handrail at the correct 34 to 38 inch height, with solid bracket mounting, returned ends, and the IRC rules that matter.
s)
A handrail is the one part of a staircase your hand finds in the dark, on a slippery tread, mid-stumble. It is also the part most often installed at the wrong height, with the wrong profile, or with gaps that break the grip right where someone reaches for it. Installing a code-compliant handrail is a half-day project, and the rules fit on an index card. This guide covers the IRC requirements, the layout for getting the height right on a sloped wall, and the mounting details that keep the rail solid for decades.
The code requirements in plain language
The International Residential Code covers handrails in section R311.7.8. Here is what it demands.
Height: 34 to 38 inches (R311.7.8.1). Measure vertically from the sloped line connecting the tread nosings to the top of the rail. The whole rail must sit inside this band at every point. Thirty-six inches is the natural target.
At least one side (R311.7.8). Any flight with four or more risers needs a handrail on at least one side. Both sides are allowed and safer on wide stairs, open stairs, and stairs used by kids or older adults.
Continuous grip (R311.7.8.4). The rail must run continuously from a point directly above the top riser to a point directly above the lowest riser. You cannot break the rail at a post and restart it; the hand must slide along it without letting go.
Returned or terminated ends (R311.7.8.4). Each end must return to the wall or terminate in a newel post or safety terminal. An open rail end snags sleeves and bags, and a snag at the top of a stair is a fall.
1-1/2 inch wall clearance (R311.7.8.3). At least 1-1/2 inches of clear space between the rail and the wall, so fingers wrap fully around it. Brackets must not block the grip.
Graspable profile (R311.7.8.5). A round rail must be 1-1/4 to 2 inches in diameter, the size a hand can close around with real strength. A flat 2x4 is not a legal handrail, no matter how solid it feels.
Width allowance (R311.7.1). Handrails may project up to 4-1/2 inches into the required 36-inch stair width without breaking the width rule.
One more distinction: a handrail (34 to 38 inches, for gripping on a stair) is not a guardrail. Guards protect open edges of landings and must be at least 36 inches tall. A stair with an open side typically needs both. Our guide to installing stair balusters covers the guard side, and the stair railing calculator helps with the material takeoff.
Tools and materials
Handrail stock long enough for the flight, plus 12 inches at each end for cuts and returns. Oak and poplar are the common wood choices; metal and vinyl-clad rails are fine if the profile is graspable.
Wall brackets rated for handrails: one every 4 feet maximum, plus one within 12 inches of each end. Choose brackets with a standoff that guarantees the 1-1/2 inch wall clearance.
Wood screws long enough to reach studs, or the correct anchors for your wall type. Drywall anchors alone are not acceptable for a safety rail.
Stud finder, 4-foot level, tape measure, chalk line, drill and bits, miter saw or handsaw, sandpaper, and finish.
A helper to hold the rail while you mark bracket positions.
Step 1: Mark the height line on the wall
At the bottom tread, measure 36 inches straight up from the nosing and mark the wall. Do the same at the top tread, then snap a chalk line between the marks. That line runs parallel to the stair slope at 36 inches above the nosings.
Check at a middle tread too. Walls lean and floors settle; if the middle reading drifts outside 34 to 38 inches, adjust the marks. The band is the requirement, not the chalk line.
Step 2: Locate studs and plan bracket positions
Run a stud finder along the chalk line and mark every stud. Brackets must land on studs or solid blocking behind the drywall, never on drywall alone. Space brackets no more than 48 inches apart, with one within 12 inches of each rail end so the ends do not flex.
If the studs fall in awkward spots, add blocking: open a section of drywall, screw a horizontal 2x4 between the studs at rail height, and patch. An hour of work that turns a wobbly rail into a structural one.
Step 3: Mount the brackets to the wall
Brackets mount to the wall first, rail second. Hold each bracket so its saddle sits just below the chalk line; the offset depends on your bracket design, so measure from the saddle to where the rail top will sit and shift the bracket down by that amount. The goal is the rail's top surface landing between 34 and 38 inches above the nosings.
Drive screws into the center of each stud, pre-drilling for hardwood, and use the screws the bracket manufacturer specifies. Leave brackets slightly loose until the rail is seated, then tighten everything.
Step 4: Cut, fit, and attach the rail
Measure the rail against the mounted brackets and cut to length, allowing for the returns. A wall return is a short piece of rail, cut at the stair angle, that turns the rail end back into the wall. Cut returns on a miter saw set to the stair angle and dry-fit them before fastening; the return should meet the wall cleanly with no gap a finger could catch on.
Set the rail into the bracket saddles and fasten from below. Check the 1-1/2 inch wall clearance along the full length, then give the rail a hard pull at mid-span. Any movement means a bracket missed solid wood; go back to step 2.
Step 5: Sand, finish, and final-check
Sand the rail smooth, especially the returns and joints where splinters start. Finish with paint or polyurethane; a smooth film finish is easier to grip and clean. Then walk the checklist: height 34 to 38 inches everywhere, continuous with no breaks, ends returned, 1-1/2 inch clearance, graspable profile, brackets solid. If all six check out, the rail is done.
Common mistakes to avoid
Mounting to drywall only. Drywall anchors pull out under a real load. Studs or blocking, no exceptions.
Copying the guard height. Guards are 36 inches minimum above a landing; handrails are 34 to 38 above the stair nosings. Different measurements, different surfaces.
Breaking continuity at a post. Restarting the rail at a newel violates the continuity rule and creates the gap a falling person reaches across.
Leaving open rail ends. An unreturned end is a snag hazard and a code violation; return every end to the wall or a newel.
Using a non-graspable profile. Flat boards and chunky decorative moldings fail the graspability rule. If your hand cannot close around it, it is decoration, not a handrail.
Stopping the rail short. The rail must reach from above the top riser to above the bottom riser. A rail that ends two treads early leaves the most dangerous steps unprotected.
Spacing brackets too far. Brackets 6 feet apart let the rail flex and bounce. Keep them within 4 feet and near both ends.
FAQs
Do I need handrails on both sides? The IRC requires one side minimum for flights with four or more risers. Both sides are permitted and recommended for wide stairs, open sides, and households with children or older adults.
Can I use a 2x4 as a handrail? No. A standard 2x4 has too large a perimeter to grip and fails the graspability rule. Use a rail profile in the 1-1/4 to 2 inch diameter range or a manufactured handrail molding.
What is the difference between a handrail and a guardrail? A handrail is a graspable rail 34 to 38 inches above the stair nosings, meant to be held while climbing. A guardrail is a barrier at least 36 inches tall that prevents falls from open edges of landings and balconies. Many stairs need both.
Do residential stairs need the 12-inch rail extensions seen in commercial buildings? No. Those horizontal extensions come from ADA and commercial codes. The IRC requires continuity from the top riser to the bottom riser plus returned ends.
How do I measure height with wainscoting or thick trim on the wall? Always measure from the nosing line to the top of the rail, regardless of wall finishes. Thick trim may eat into your wall clearance, so verify the full 1-1/2 inches remains between the rail and the finished wall surface.
Plan the numbers first
Before buying rail stock, run your stair dimensions through the standard stair calculator to confirm the flight geometry, and use the handrail calculator to estimate rail length and bracket count. Getting the layout right on paper is what makes the half-day install go smoothly.