Free Construction Tool

Stair Railing Calculator

Reviewed and updated: August 2026

Calculate balusters, posts, rail length, and cost for any staircase or deck railing. Includes IRC code spacing check to ensure balusters meet the 4-inch maximum clear spacing requirement.

Enter your stair run, baluster size, spacing, and material costs to get a complete railing materials estimate. Always verify requirements with your local building department before installation.

Horizontal distance of staircase
ft
IRC max is 4" clear between balusters
Bottom, top, and any landings
#
$
$
$
YOUR RESULTS
Balusters
—
balusters
Actual Spacing
—
inches clear
IRC Code
—
Posts
—
posts
Rail Length
—
lin ft
Baluster Cost
—
est.
Post Cost
—
est.
Total Cost
—
est.

How to Calculate Stair Balusters

The IRC requires that no opening in a guardrail or balustrade allow a 4-inch sphere to pass through. This is the governing dimension for baluster spacing, it is not a suggestion, and it applies to both stair railings and deck guardrails.

The basic baluster count formula is:

Number of balusters = railing length (in) / (baluster width + desired spacing)

Round up to the next whole number. For example, a 12-foot run (144 inches) with 1.5-inch square balusters at 3.5-inch spacing: 144 / (1.5 + 3.5) = 144 / 5 = 28.8, rounded up to 29 balusters.

Even Spacing Formula

Rounding up the baluster count changes the actual clear spacing. After rounding, recalculate the actual spacing to confirm code compliance:

Actual clear spacing = (run length - (balusters x baluster width)) / (balusters + 1)

Using the example above: (144 - (29 x 1.5)) / (29 + 1) = (144 - 43.5) / 30 = 100.5 / 30 = 3.35 inches clear. This passes the 4-inch maximum. The calculator performs this check automatically and flags any spacing that exceeds 4 inches.

To get perfectly even spacing across the run, divide the total space equally across all bays. Adjust by one baluster up or down and compare the resulting spacing, choose the count that gives the most even distribution while staying under 4 inches clear.

IRC Railing Height Requirements

The IRC sets different height requirements for handrails (the graspable member you hold) and guardrails (the barrier that prevents falls). These are separate requirements and both must be met on a staircase with a guardrail system.

Railing TypeIRC Minimum HeightMeasured FromNotes
Stair handrail34 inches minimum, 38 inches maximumStair nosing (vertically)Required on stairs with 4 or more risers
Stair guardrail36 inches minimumStair nosing (vertically)Required where drop exceeds 30 inches
Landing / deck guardrail36 inches minimumWalking surfaceRequired where drop exceeds 30 inches
Commercial guardrail42 inches minimumWalking surfaceIBC requirement, not IRC residential

The 34 to 38 inch handrail height range applies to the graspable handrail measured vertically above the stair nosing, not measured perpendicular to the slope. This distinction matters on steep stairs where the two measurements can differ significantly. Always measure vertically.

Railing Materials Guide

Material selection affects cost, maintenance, durability, and the baluster spacing calculation since different materials have different standard widths.

MaterialTypical Baluster WidthLifespanMaintenanceNotes
Pressure-treated wood1.5 inches (2x2)15 to 25 yearsPaint or stain every 2 to 4 yearsMost common for exterior stairs and decks
Cedar or redwood1.5 inches (2x2)20 to 30 yearsSeal every 2 to 3 yearsBetter rot resistance than PT; higher cost
Wrought iron / steel0.75 to 1 inch (square)30 to 50 yearsTouch up paint as neededRequires professional welding for custom work
Aluminum0.75 to 1 inch (square)20 to 40 yearsMinimal, powder coat resists corrosionLightweight; good for coastal environments
Cable railing3/16 to 1/4 inch diameter20 to 30 yearsTension check annuallyHorizontal cables must meet 4-inch spacing rule
Composite / PVC1.5 inches25 to 30 yearsMinimal, clean periodicallyNo painting; may expand in heat
Glass panelsN/A (continuous panel)20 to 30 yearsClean periodicallyTempered safety glass required; no baluster count needed

Post Placement and Structural Attachment

Newel posts and guardrail posts are the structural anchors of any railing system. Baluster spacing compliance means nothing if the posts are not properly attached, a post that fails under load is a fall hazard regardless of how well the balusters are spaced.

Stair Newel Posts

Newel posts are required at the bottom of each stair run, at the top, and at any intermediate landing. They must be capable of resisting a 200-pound concentrated load applied in any direction at the top of the post per IRC requirements. Through-bolting a newel post to the stringer or framing below is the strongest attachment method. Surface-mount post anchors are faster to install but provide less resistance to lateral loading.

Deck Guardrail Posts

Deck guardrail posts should be spaced no more than 6 to 8 feet on center. Posts mounted on top of the decking surface (surface mount) provide less resistance to lateral loads than posts that extend through the decking and attach to the rim joist or structural framing below. For decks over 30 inches above grade, through-framing post attachment is strongly preferred and required by many local jurisdictions.

Post Sizing

For wood railing systems, 4x4 posts are standard for deck guardrails up to 36 inches high. Taller railings (42 inches) or longer post spans (over 6 feet) typically require 4x6 or 6x6 posts to meet the load requirements. Metal post sizing is specified by the railing system manufacturer.

Graspable Handrail Requirements

The IRC specifies that a handrail must be graspable, meaning a person can wrap their hand around it and maintain a firm grip while descending. This rules out flat 2x6 boards used as handrails, which are common in older construction but do not meet current code.

Common Railing Mistakes

Planning Railing Costs

Material costs for a basic pressure-treated wood railing system run $15 to $30 per linear foot. Composite and aluminum systems run $40 to $80 per linear foot. Cable railing runs $60 to $150 per linear foot including hardware. Glass panel systems start at $100 per linear foot and up. Professional installation adds $20 to $50 per linear foot in labor depending on material and complexity.

For the lumber needed for a wood railing system, use our lumber calculator. For total project budgeting, see our project cost estimation guide.

Baluster Spacing Diagram

Baluster count and spacing are governed by the IRC 4-inch sphere rule. The diagram shows how baluster width, clear spacing, and the number of bays relate to each other along a stair run.

Clear ≤ 4" width Total Run Length

4-inch maximum clear space between balusters (IRC R312.1.3) · Count = run ÷ (width + spacing), round up · Recalculate actual spacing after rounding

Railing Height Requirements by Location

Handrail height and guardrail height are governed by separate IRC sections and measured from different reference points. Both must be met simultaneously on a typical staircase with a guardrail system.

Railing TypeLocationRequired HeightMeasured FromIRC Section
Handrail (graspable)Stairs34"–38" above nosingStair nosing, verticallyR311.7.8
Guardrail (barrier)Stair side36" minimumStair nosing, verticallyR312.1.3
GuardrailDeck ≤30" above grade36" minimumDeck surfaceR312.1.2
GuardrailDeck over 30" above grade42" minimumDeck surfaceR312.1.2
HandrailRamp34"–38"Ramp surfaceR311.8.3
GraspabilityAll handrails1.25"–2" diameter or equivalentN/AR311.7.8.3

Baluster Material Comparison

MaterialCost (per baluster)LifespanMaintenanceBest For
Pressure-treated wood (1.5" sq)$2–$515–20 yearsPaint or stain every 3–5 yearsExterior decks, most economical
Cedar / redwood (1.5" sq)$4–$820–25 yearsStain every 3–5 yearsNatural appearance; better than PT aesthetically
Composite (2" sq)$8–$2025–30 yearsVery low, wash annuallyLow-maintenance exterior; matches composite decking
Wrought iron / steel (3/4" sq)$10–$2530–50 years with paintTouch up paint every 5–10 yearsTraditional look; very strong
Aluminum (3/4" sq)$8–$1830+ yearsVery low, powder coat is durableLow maintenance; won't rust
Cable (1/8"–3/16" stainless)$15–$40 per run30+ yearsLow, occasional tensioningModern/contemporary; unobstructed views
Glass panels$50–$150 per panel20+ yearsLow, clean regularlyPremium decks; unobstructed views

For deck framing and material estimates, see our deck calculator and deck materials guide.

Frequently Asked Questions
What is the maximum baluster spacing per code? ▾
The IRC requires that no opening in a guardrail or balustrade be large enough to pass a 4-inch sphere. For standard 1.5-inch square balusters, this means no more than 4 inches of clear space between balusters. Most installers target 3.5 inches of clear spacing to provide a margin against slight installation variations. The 4-inch rule applies in all directions, horizontal balusters and cable must also meet this requirement.
How many balusters per stair tread? ▾
Many jurisdictions require 2 balusters per tread as a minimum, one near the front nosing and one near the back of the tread. This requirement exists separately from the 4-inch spacing rule and ensures the railing is properly supported along the full stringer length. However, the 4-inch clear spacing rule takes precedence, if your tread width requires more than 2 balusters to achieve 4-inch spacing, use as many as needed to meet the spacing requirement.
How tall should stair railings be? ▾
The IRC requires stair handrails to be between 34 and 38 inches measured vertically above the stair nosing. Guardrails on stairs must be at least 36 inches high measured vertically above the nosing. Guardrails on landings, decks, and balconies must be at least 36 inches above the walking surface (42 inches for commercial occupancies under IBC). Always measure vertically, not perpendicular to the slope of the stair.
What is the difference between a handrail and a guardrail? ▾
A handrail is the graspable member you hold while walking up or down stairs, it is a safety aid for balance and fall recovery. A guardrail (also called a balustrade or guardrail system) is the barrier that prevents people from falling off the edge of a stair, landing, deck, or balcony, it includes the top rail, balusters, and posts. A staircase can have both: the handrail for gripping and the guardrail system for fall protection. Both have separate IRC requirements for height, graspability, and structural capacity.
Do deck railings have the same requirements as stair railings? ▾
Deck guardrails share the same 4-inch baluster spacing requirement as stair railings, but the height requirement is 36 inches above the deck surface (not 34 to 38 inches like stair handrails). Deck guardrails are required when the deck surface is more than 30 inches above grade. The structural requirements are also the same, posts must resist a 200-pound concentrated lateral load. Deck handrails on stairs leading down from the deck must still meet the 34 to 38 inch stair handrail height requirement.