Railings & finishes

Stair railing calculator

A stair railing calculator turns the rise and run of a flight into the numbers a rail actually needs: the angle it sits at, the length of handrail to buy, and how many posts hold it up. Get the angle wrong and every miter on the rail ends looks off; get the length short and you're splicing a joint nobody wants to see.

This page walks through the geometry a carpenter uses to lay out a rail before it's cut: how the rail angle matches the stair angle, how much extra length to add at the top and bottom for newel connections, and how post spacing works out along a sloped run.

Stair railing calculator

Number of treads × tread depth.

Measured along the rail. Many rail systems are made for 6 ft or 8 ft sections.

Horizontal handrail continuing past the top riser.

Sloped continuation past the bottom riser, if required.

Rail angle 36.3°, rake length 182 7/16″, handrail 194 7/16″ with extensions, 4 posts.

Rail angle

36.3°

same as the stair angle

Rake length

15′ 2 7/16″

nosing to nosing

Handrail length

16′ 2 7/16″

with extensions

Buy length

18 ft

+10 %, next whole foot

Posts

4

60 13/16″ apart on the rake

Transition miter

18.2°

half the rail angle

Rise, run and angle triangle diagramRight triangle with rise 108″, run 147″, hypotenuse 182 7/16″, and angle 36.3°.36.3°Run 147″Rise 108″Hyp 182 7/16″
The handrail follows the same triangle as the stair.

Need presets, code profiles, printing or sharing? Continue with these values.

Open the full angle calculator

What this calculator figures out

Enter the total rise and total run of the flight and the calculator returns three things: the stair angle in degrees, the straight-line handrail length along the slope, and a post count based on the spacing you set. All three come from the same right triangle you'd use to lay out stringers.

The rail angle is the same angle the stringer makes with the floor, because a sloped handrail is installed parallel to the nosing line. If your stringers run at 34 degrees, your rail runs at 34 degrees too, and every angled cut on the rail ends is referenced from that number.

Measuring rise and run for a rail

Use the same total rise and total run you'd use for the stringers: rise is floor-to-floor height, run is the horizontal distance from the first riser face to the last. If the rail continues past the top or bottom newel with a level section, measure that separately and add it after the sloped length is known.

For an open-string rail that follows the nosings, measure from the outside edge of the bottom nosing to the outside edge of the top nosing rather than from the wall framing, since that's the line the rail actually parallels.

The formulas

Rail angle = arctan(rise ÷ run), identical to stair angle. Sloped rail length (the stringer-line length) = √(rise² + run²). For a 108 in rise and 147 in run, that's √(108² + 147²) ≈ 182.4 in, at an angle of about 36.3°.

Handrail length for ordering is that sloped length plus extensions at both ends. A common approach adds roughly 12 in of horizontal run at the top for a level return into a wall or post, plus a shorter extension at the bottom, commonly cited as about one tread depth for some code-covered occupancies (hedged, and this varies by jurisdiction and whether the stair is residential or commercial).

Post count from spacing: number of posts ≈ round(run ÷ postSpacing) + 1. With a 147 in run and 72 in target spacing, that's 147 ÷ 72 ≈ 2.04, rounding to 2 intermediate posts plus the top and bottom newels.

Cutting and coping the rail ends

Where a sloped rail meets a level rail (at a landing or the top of the stair), the two pieces are joined with a compound cut, sometimes called a gooseneck or volute fitting on stock stair parts, rather than a simple butt joint. Where a sloped rail dies into a newel post, the end is typically cut at the stair angle so the rail face sits flush against the post.

Mark the angle directly off the stringer or a bevel gauge set to the calculated angle rather than trusting a tape measure alone; a half-degree error compounds visibly over a long rail run.

Working out post spacing

Posts (balusters or newels supporting the rail itself, as opposed to the smaller balusters that fill the guard) are usually spaced by structural need and appearance rather than a fixed code number, though very long unsupported rail spans can feel bouncy under hand pressure.

A practical rule many builders use is a post at every third or fourth tread, or roughly every 60–72 in of horizontal run, then adjusting to land posts near landings and turns. The calculator's postSpacing input lets you test different targets and see how many posts that implies.

Rail height and graspability

Handrail height is commonly cited in residential reference values as 34–38 in measured vertically from the nosing of the tread to the top of the rail, with continuous graspability (a round profile or one with a similar grip) required along the full run in most jurisdictions.

These are hedged, code-referenced figures, not guarantees, since local amendments and occupancy type change the numbers. Confirm the exact height and profile requirement with your local building department before installing.

Typical rail dimension reference points (hedged, verify locally)
ItemCommonly cited residential value
Handrail height above nosing34–38 in
Graspable diameter (round profile)1¼–2 in
Handrail height above landing34–38 in
Guard height (open sides)36 in minimum

Common mistakes

  • Ordering rail stock at the sloped length alone with no allowance for the top and bottom fittings, then coming up short.
  • Cutting the rail-to-newel joint square instead of at the stair angle, leaving a visible gap on one side.
  • Spacing posts evenly by eye instead of calculating from the actual run, so the last post lands awkwardly close to the newel.
  • Measuring rail height from the tread surface instead of the nosing, which understates the code-referenced dimension.

When to use a different tool

If you haven't settled on riser and tread dimensions yet, start with the stair rise and run calculator or the stair stringer calculator to lock in the flight geometry first, then come back here for the rail. For the balusters that fill the space under the rail, use the baluster spacing calculator.

Worked math

Railing for a 108 in rise, 147 in run flight

Given

  • Total rise: 108 in
  • Total run: 147 in
  • Post spacing target: 72 in

Steps

  1. Stringer/rail angle = arctan(108 ÷ 147) ≈ 36.3°
  2. Sloped rail length = √(108² + 147²) ≈ 182.4 in
  3. Add extensions: 182.4 + 12 (top return) + 10.5 (bottom, one tread depth) ≈ 204.9 in to order
  4. Post count = round(147 ÷ 72) + 1 = 2 + 1 = 3 posts total (including one intermediate)

Order roughly 205 in of handrail stock, cut the newel ends at 36.3°, and plan for at least one intermediate post along the run.

Questions

Stair railing calculator FAQ

What angle do you cut a stair handrail?

Cut the rail ends at the stair angle, arctan(rise ÷ run), which matches the angle of the stringers. For a 108 in rise and 147 in run that's about 36.3°. Where the rail meets a level section or a newel, a compound or coped joint is often used instead of a single flat cut.

How long should a stair handrail be?

Start with the sloped stringer length, √(rise² + run²), then add extra for the top and bottom terminations. A common allowance is around 10–14 in combined for a level return and a newel connection, though volutes, gooseneck fittings, and wall returns each need slightly different amounts.

How do you calculate handrail height?

Handrail height is measured vertically from the nosing line of the treads (or the landing surface) up to the top of the rail, not from the floor. Residential reference values are commonly cited at 34–38 in, though this varies by jurisdiction and should be confirmed locally.

How far apart should stair railing posts be?

There's no single universal number, but many builders target roughly 60–72 in of horizontal spacing between intermediate posts, adjusting so posts land near landings and direction changes. Enter your preferred spacing into the calculator to see how many posts a given run requires.

Is a stair rail angle the same as the stair angle?

Yes, for a sloped rail that runs parallel to the nosing line, the rail angle equals the stair angle: arctan(total rise ÷ total run). Level sections at landings or at the top of the flight are, by definition, at 0°.

Do all stairs need a handrail?

Most residential and commercial codes require a handrail on at least one side of a stair with more than a small number of risers, commonly three or four, but the exact trigger and which side varies by jurisdiction. Check with your local building department for the rule that applies to your project.

Keep going

Important

Disclaimer

StairCalculator.app provides calculations and educational information. Building codes and construction requirements vary by location. Verify final dimensions and requirements with the applicable local building authority or qualified professional.

Calculations are only as accurate as the measurements and inputs you provide; small errors in measuring total rise or floor thickness can shift the results, so double-check field measurements before cutting materials, and treat every reference value and worked example on this site as illustrative rather than a guarantee of code compliance.