Stair Railing Calculator

14balusters3posts3 1/2"gaps103 3/4"rail

Stair railing layout3 posts, 14 balusters, 3 1/2" gaps, rail 103 3/4" along the nosing line at 36" high. Rail 103 3/4" along the slope Rail top 36" above the dashed nosing line 3 posts · 14 balusters · 3 1/2" gaps
Rail and posts
Rail lengthAlong the nosing line, 84" run × 60 7/8" rise103 3/4"
Rail stockLeaves room to trim both ends10 ft
Rake angleMiter saw at 35.9° for plumb cuts on rail and baluster tops35.9°
Posts42" on center, horizontal3
Rail heightMeasured straight up from the nosing line34"–38"
Balusters
Balusters7 in each of 2 sections14
GapClear space; your limit is 4"3 1/2"
On centerLevel, measured along the treads5"
On center along railMark the underside of the rail at this spacing6 3/16"

Code check

  • Every gap is 3 1/2" — a 4" sphere can't pass.
  • 9 risers: a handrail is required on at least one side.
  • Open sides more than 30" above the floor need a guard at least 34" high (IRC R312).
  • The triangle under the bottom rail at each tread must stop a 6" sphere.

Based on the IRC (2021 R311.7 and R312). Local codes vary — confirm with your building department before building.

How to use it

  1. Enter the total rise, from the finished floor to the finished floor above, and your tread depth. The calculator works out the risers the same way as the stair calculator.
  2. Pick your baluster and gap limit. Use 1 1/2” for square wood balusters (2x2) or 3/4” for metal. Keep the gap at 4” unless your building department says the IRC’s 4 3/8” stair-side allowance applies.
  3. Read the layout. You get the number of balusters and posts, the clear gap, the spacing to mark on the rail, and the angle for your saw.

How it’s calculated

The rail follows the nosing line, the straight line through the front edge of every tread. Its run is the number of treads × tread depth, and its rise is the number of treads × riser height. The rail length is the diagonal of those two, and the rake angle is the stair angle.

Posts divide the run into equal sections no wider than your maximum post spacing. Each section’s clear width is the post-to-post distance minus one 3 1/2” post (a 4x4). In each section the calculator uses the fewest balusters that keep every gap at or under your limit:

Spacing is measured level, across the treads, because the sphere test passes between two plumb balusters. To mark the underside of a sloped rail, divide the level on-center spacing by the cosine of the rake angle. The calculator shows both numbers.

Worked example: 68 1/2” rise

A 68 1/2” rise with 10 1/2” treads gives 9 risers of 7 5/8” and 8 treads. The nosing line runs 84” across and rises 60 7/8”, so the rail is 103 3/4” long at 35.9°. A 10 ft board leaves room for both plumb cuts.

With posts no more than 72” apart you need 3 posts, 42” on center. That leaves 38 1/2” clear between them. With 1 1/2” balusters and a 4” limit, each section takes 7 balusters with 3 1/2” gaps: 14 balusters in all, 5” on center level, or 6 3/16” measured along the rail.

Railing code at a glance (IRC)

item requirement
Handrail required 4 or more risers (R311.7.8)
Handrail height 34”–38”, measured straight up from the nosing line
Guard required open sides more than 30” above the floor or grade (R312.1.1)
Guard height on stairs at least 34” from the nosing line
Openings in a stair guard must stop a 4 3/8” sphere under the IRC; many local codes use 4”
Triangle under the bottom rail must stop a 6” sphere
Handrail grip round rail 1 1/4”–2” across (Type I)

These are IRC limits. Decks, commercial work and some cities are stricter, so check with your building department.

Tips from the job site

Frequently Asked Questions

How do you calculate baluster spacing on stairs?

Subtract the post widths from the distance between posts to get the clear width. Divide (clear width − 4") by (4" + baluster width) and round up for the baluster count. The gap is (clear width − count × baluster width) ÷ (count + 1).

What is the 4-inch sphere rule for stair railings?

A 4" ball must not pass through any opening in the guard, which keeps small children from slipping through. The IRC relaxes this to 4 3/8" on the open sides of stairs, but many local codes and inspectors still require 4".

How many balusters per stair tread?

With 1 1/2" square balusters and treads of about 10"–11", two per tread keeps gaps under 4". With 3/4" metal balusters, two per tread usually works too. The calculator gives the exact count for each section between posts.

How long should a stair handrail be?

The rail runs along the nosing line from the first tread to the top nosing. Its length is the square root of (treads × tread depth)² + (treads × riser height)². For a 68 1/2" rise with 10 1/2" treads that is 103 3/4".

What angle do I cut stair balusters and handrails?

Cut them at the stair angle, the arctangent of riser height ÷ tread depth. A 7 5/8" riser and 10 1/2" tread give 35.9°, so set the miter saw to 35.9° for plumb cuts on the rail ends and the baluster tops.