mystaircalculator.com logo mystaircalculator.com
  1. Home
  2. Calculators
  3. Railing, Baluster & Safety
  4. Stair Railing Calculator
Railing, Baluster & Safety

Stair Railing Calculator

Enter your stair's total rise and run and get a full railing material list — baluster count and spacing, newel posts, wall brackets, handrail length and fastener quantities — checked against IRC residential limits as you type.

Free to use No sign-up required Formulas verified against IRC 2021 Imperial & metric supported
Baluster count & spacing calculated Newel posts & brackets included Code-compliance chips built in Last verified July 2026
Checked line-by-line by our in-house stair-planning team before publishing — figures re-verified July 2026.
in

Floor to floor height. Same measurement as the Rise & Run Calculator.

in

The rail follows this same rake — same total run you'd use in the Rise & Run Calculator.

"Open" sides get posts & balusters (a guard). "Wall" sides get a wall-mounted handrail on brackets instead.

turns

Each turn adds one corner newel post and splits the run into more sections.

Advanced: baluster spacing & fasteners
inches
ea
Advanced: posts, brackets & waste
inches
inches
%
Side profile diagram of the calculated stair railing

Results

Rail Run Length
in
Rail Rake Angle
°
Sections
spans
Newel Posts
pcs
Wall Brackets
pcs
Baluster Count
pcs
Baluster Gap
in
Baluster Stock
ea
Rail Material
ft
Baluster Material
ft
Total Fasteners
pcs
Rail Height
in
How to measure

Measuring your stair before you order railing

This calculator builds the whole material list off two numbers you already have from planning the stair itself: total rise and total run.

1

Reuse your total rise and run

If you've already run the Rise & Run Calculator for this stair, enter the same two numbers here — the rail follows the same rake line as the stringer.

2

Decide which sides get a guard vs. a wall rail

An open side (no wall) needs posts and balusters to meet the guard requirement. A side against a stud wall just needs a wall-mounted handrail on brackets — no balusters.

3

Pick a baluster style

Wider balusters mean fewer of them for the same spacing rule, but check the reference table below — cost and look vary a lot between wood and iron.

4

Read the compliance chips

Green means the result sits inside IRC residential limits. Amber flags a manufacturer guideline rather than a hard code number — still worth checking, but confirm it against your specific rail system.

The math

The six formulas behind every result

Nothing on this page is a black box. Here's exactly what runs when you change a number.

Rail Run Length

L = √(Rise² + Run²)

The straight-line rake distance the handrail has to cover, from the Pythagorean triangle formed by total rise and total run.

Rail Rake Angle

θ = atan(Rise ÷ Run)

The overall slope of the stair envelope. Runs a degree or two steeper than the individual riser-to-tread angle — see the worked example for why.

Balusters per Section

n = ceil( (Span − G) ÷ (W + G) )

Span is the clear post-to-post distance, G is the max allowed clear gap (4" by default), and W is baluster width. This is the standard even-spacing solve.

Actual Clear Gap

G_actual = (Span − nW) ÷ (n + 1)

Once n is fixed to a whole number, balusters get spread evenly and the true gap comes out slightly under your target — this is the number that has to stay under 4".

Newel Posts

Posts = (2 + Turns) × Open Sides

Every open (guarded) side needs a start post, an end post, and one more per turn or landing corner.

Rail Material

Material = (L + Turns×4") × Runs × (1 + Waste%)

Each rail run (one per open side, plus one per wall side) needs the rake length plus a small allowance per corner joint, then a waste factor for cuts and mistakes.

Worked example

Walking through a 108" rise, 130" run flight

Same rise and run as the Rise & Run Calculator's own worked example, with the default "open + wall" configuration and square wood balusters.

1

Rail length and angle

√(108² + 130²) = 169.0" of rail run. atan(108 ÷ 130) = 39.7°. That's about 2° steeper than the 37.6° step angle you'd get from riser÷tread alone — total run here is measured across 13 tread depths while total rise spans all 14 risers, so the overall envelope slope always reads a little steeper than the per-step ratio.

2

Baluster span and count

With no turns, the open side is one section. Subtracting roughly 3.5" for the two 4×4 newel post faces leaves a 165.5" clear span. At 1.5" wide balusters and a 4" max gap: n = ceil((165.5−4) ÷ (1.5+4)) = 30 balusters.

3

Actual spacing

Spreading 30 balusters evenly across the 165.5" span gives an actual clear gap of (165.5 − 45) ÷ 31 = 3.89" — under the 4" limit, so the spacing chip passes with a small margin to spare.

4

Posts, brackets, rail and fasteners

One open side with no turns needs 2 newel posts. The wall side needs brackets every 48" or less: ceil(169.0 ÷ 48) + 1 = 5 brackets. Two rail runs (open + wall) at 169.0" each, plus 10% waste, round to about 31.0 linear ft of handrail stock. Fasteners: 30 balusters × 2, plus 2 posts × 4 lag bolts, plus 5 brackets × 3 screws = 83 fasteners total.

This is why the baluster count is so sensitive to post width and turns — the same 169" rail run with one turn splits into two shorter sections, and short sections lose proportionally more clear span to the extra post faces, which usually raises the total baluster count slightly even though the overall rail length barely changes.

Baluster styles compared

How baluster width changes the count

Narrower balusters need more pieces to close the same gap. This is the exact width each style uses in the calculation above.

StyleWidthEffect on countTypical use
Square wood1.5"Baseline — fewest pieces of the four stylesTraditional interior stairs, painted or stained trim
Round wood (turned)1.25"Slightly more pieces than square woodColonial / turned-baluster staircases
Iron, round9/16"Roughly double the count of square woodModern or wrought-iron guard systems
Iron, square1/2"Highest count — narrowest profileSlim modern iron balusters, mixed-material rails

Want spacing solved on its own, without the rest of the material list? Use the Baluster Spacing Calculator.

Code reference

IRC residential railing code, quick reference

This calculator checks your result against the two hard limits below. Full residential code also covers handrail grip profile and guard height on landings — see the linked calculators for those.

ElementResidential (IRC)Commercial (IBC)
Handrail height (stairs)34"–38"34"–38"
Guard height (landings/decks)36" min42" min
Max baluster clear spacing4" (sphere)4" (sphere)
Handrail grip diameter (circular)1.25"–2"1.25"–2"
Guard trigger height above grade30"+30"+

Reference only — always confirm against your local jurisdiction's adopted code before building.

Beyond the baluster count

Posts, brackets & ordering the right stock

A rail can pass every spacing check and still fail in the field over three things this section covers — post sag, bracket blocking, and buying baluster stock that's actually long enough after cutting.

Post spacing and top-rail sag

[VERIFY: confirm your rail system's max post-to-post span before ordering] Typical max ≈ 72"

Unlike baluster spacing, there's no single IRC number for how far apart guard posts can be — it's set by the rail manufacturer's structural rating, and it varies by rail material and post size. 72" is a common wood-rail rule of thumb; confirm against your specific system before finalizing post layout.

Wall bracket blocking

[VERIFY: confirm bracket spec's max span] Typical max ≈ 48"

Wall-mounted handrail brackets need solid blocking behind the drywall at every screw location, not just at the ends. Mark bracket positions before rough-in — retrofitting blocking after drywall is up is the single biggest reason wall rails end up screwed only into drywall anchors.

Baluster stock length

[VERIFY: confirm your baluster hardware's tenon/shoe allowance] Stock ≥ (Rail Height − 1")

Pre-turned balusters are sold in standard lengths (32", 34", 36", 39", 42"). The 1" allowance here is a rough shoe/dowel deduction — some baluster and shoe systems eat significantly more length than that, so this result is a starting point for ordering, not a final cut list.

Continuous graspability

No gaps at newel posts

Code requires the handrail to be continuous, without interruption by newel posts or other obstructions, for the full length of the stair flight. Post caps and rail-to-post transitions have to keep a graspable profile running through, not stop and restart at each post.

These are planning-stage estimates, not a stamped structural design. A long unsupported rail span, an unusual load case, or a custom bracket system may need the manufacturer's engineering data regardless of what this calculator shows.

Avoid these

Common mistakes when planning stair railing

Most rail material shortages — and most failed guard inspections — trace back to one of these five planning errors.

📏

Measuring post-to-post instead of clear span

Forgetting to subtract post width before running the spacing formula overstates the usable span and understates how many balusters you actually need.

🌐

Applying the flat 4" sphere rule on the raked section without a check

The sphere test still applies along the slope, but a very steep rake can tighten the effective triangular opening near the bottom of each baluster more than the flat clear-gap number suggests — inspectors check both.

🪵

Ordering baluster stock without a shoe allowance

Buying pieces at exactly your rail height leaves nothing for the tenon or shoe block — round up to the next standard stock length, not down.

🧱

Skipping blocking for wall brackets

Brackets screwed only into drywall anchors will eventually pull loose under a real hand load. Plan blocking locations before drywall goes up.

🔗

Forgetting handrail continuity at posts

Code requires the graspable rail to run continuously past newel posts. A design that stops and restarts the profile at every post is a common reason for a failed rough-in inspection.

Who uses this

When to use a stair railing calculator

Railing material planning shows up right after rise-and-run layout is locked, for almost every stair project.

🏚️

Basement / Interior Open Guard

Sizing a post-and-baluster guard for a newly opened basement stairwell.

🌳

Deck Stair Railing

Material list for an outdoor guard alongside a deck stair build.

🧱

Wall Handrail Replacement

Swapping an old wall-mounted rail and figuring out bracket count and blocking.

🏠

New-Construction Package

Estimating the full railing bill of materials before ordering for a new-build stair.

📋

Code Compliance Retrofit

Checking whether an older stair's baluster spacing needs to be tightened to pass a current inspection.

⚙️

Iron Baluster Upgrade

Comparing baluster count and material between a wood-to-iron guard upgrade.

FAQ

Common questions

What is the 4" sphere rule for stair balusters?
It's the IRC requirement that a 4" sphere cannot pass through any opening in a guard — meaning the clear gap between balusters, and between a baluster and a post, has to stay under 4". It's meant to keep a small child's head from passing through.
How many balusters do I need per stair tread?
It depends on tread depth and baluster width, not a fixed count — most residential stairs land on one baluster per tread with standard 1.25"–1.5" wood balusters, and sometimes two per tread with narrower iron balusters or deeper treads. This calculator solves the actual count for your numbers instead of assuming one rule fits every stair.
Do I need posts and balusters on both sides of a stair?
Only on open sides. A side that runs along a stud wall just needs a wall-mounted handrail on brackets — no guard is required there because there's no open edge to fall through.
What is the code-required handrail height for stairs?
IRC residential code sets stair handrail height between 34" and 38", measured vertically from the nosing line to the top of the rail. This is different from a landing or deck guard, which has its own separate 36" minimum height requirement.
How much extra rail material should I buy for waste?
A 10% waste factor is a reasonable starting point for straight cuts and mistakes on a single-flight rail run — bump it up if your design has multiple turns, since every mitered corner adds a small amount of unusable offcut on each side of the joint.
Why did my baluster count change when I added a turn?
Each turn splits the rail into more, shorter sections, and every section loses the same fixed amount of clear span to the post faces at each end. Shorter sections lose proportionally more of their length that way, which is why total baluster count can rise slightly even though overall rail length barely changes.
How many newel posts does a straight flight need?
A single straight flight with no turns needs two newel posts per open side — one at the bottom, one at the top. Each turn or landing corner adds one more.
What length should I buy pre-turned balusters in?
Round up to the next standard retail length above your rail height minus roughly an inch for the tenon or shoe block — commonly 32", 34", 36", 39", or 42". Always confirm the exact allowance against your specific baluster and shoe hardware before ordering, since it varies by system.
What's the difference between a handrail and a guard?
A handrail is what you grip while climbing — it has its own height and grip-profile rules. A guard is the barrier (posts, balusters, or panels) that keeps you from falling off an open edge. On most stairs the top of the guard and the handrail are the same 34"–38" rail, doing both jobs at once.
How many fasteners does a typical baluster need?
Two is a common default — one securing the top into the rail, one securing the bottom into the shoe or tread — but pinned, doweled, and screw-mounted baluster systems all differ. Adjust the Advanced field to match your actual hardware.
How far apart can wall-mounted handrail brackets be?
A common manufacturer guideline is no more than 48" between brackets, always with one near each end. This isn't a fixed IRC number the way baluster spacing is — confirm the exact rating against your specific bracket and rail system.
Does baluster spacing code apply to an existing older stair?
Existing stairs are often grandfathered under the code in effect when they were built, but that varies by jurisdiction and by whether you're doing a permitted renovation nearby. Many inspectors require current spacing on any guard you touch during a remodel — check with your local building department before assuming an old rail is exempt.