What the IRC asks for on a stair handrail: when you need one, how high, what shape you can grab, how it ends, and what the code does not require.
A handrail is the one part of a stair people actually hold, usually when they are carrying something or when they slip. That is why the code is specific about its height, its shape and how it ends. This guide covers the residential rules in the IRC and clears up a few points that are often repeated wrongly.
Section numbers and some dimensions change between code editions, and many cities amend them. Use this as a checklist of what to confirm with your building department.
They are different things with different rules:
A stair side can need both, and a single railing can serve as both only if it meets both sets of rules.
A handrail is required on at least one side of every flight with four or more risers. A stair with three risers or fewer does not need one under the model code, although many builders add one anyway.
The top of the handrail must be 34 in to 38 in above the nosings, measured vertically from the sloped line that runs along the front edge of the treads. Fittings used for a smooth transition, such as a turn or the start of a flight, may go above 38 in.
A 2×4 laid flat on top of posts does not qualify: its perimeter is too large and it has no grip.
You will read in many places that a handrail must extend 12 in beyond the top and one tread depth beyond the bottom. That rule comes from accessibility standards and commercial codes. The sources reviewed for this guide do not show a required extension past the top riser in the residential model code, but some cities add one, so check locally before you assume either way.
Handrail height depends on the nosing line, which in turn depends on the riser and tread. The stair calculator gives you the pitch angle, so you can set the rail parallel to it.
Try it with your own numbers.
The stair calculator checks your rise and tread against the IRC, shows the stair in 3D and prints a dimensioned plan.
This guide is general information, not engineering or legal advice. Building codes differ by location and edition, so confirm the rules with your local building department before you build.