DeckMath
Stair · IRC R311.7.8 + R312 railings

Stair Railing Calculator

Stair handrail + guardrail sizing across 6 materials (PT pine, cedar, composite, aluminum, steel, cable). Pythagorean sloped length × auto-both-sides for stairs over 44″ wide (IRC R311.7.8.2). Handrail height check (R311.7.8.1, 34-38″). Optional guardrail (R312.1, required if walking surface > 30″ off grade).

IRC R311.7.8 + R3126 materialsAuto both-sides
34-38″·Handrail height
44″·Both-sides threshold
·Pythagorean length
6·Materials

Inputs

ft

in

ft

Stair railing · pt pine
$3207.82ft sloped × 1 side
Sloped length
Pythagorean from rise+run
Handrail LF
1 side
Handrail cost
$12/lf
Total + guard
+$224 guardrail

IRC R311.7.8 + R312 compliance

Handrail 34″ — IRC compliant

IRC R311.7.8.1

Within IRC R311.7.8.1 range. Measure vertically from tread nose at every step.

8 lf handrail × $12/lf = $96

2026-Q1 retail

Sloped length 7.82 ft × 1 side. pt pine pricing.

8 lf guardrail × $28/lf = $224

IRC R312.1

Full balustrade system (top rail + balusters + posts) follows handrail path. Required if walking surface > 30″ off grade per IRC R312.1.

IRC R311.7.8.1 handrail height 34-38″. R311.7.8.2 both sides if stair >44″. R312.1 guardrail required if >30″ off grade. Pair with Railing Cost + Cable Railing + Baluster Spacing Calculators.

How to use

How to use the deck calculator in 3 steps.

  1. 01

    Enter stair run + rise

    Total run in ft (horizontal stair length). Total rise in inches (grade to deck top). These feed Pythagoras for sloped length.

  2. 02

    Set stair width

    If > 44″ (3.67 ft), IRC R311.7.8.2 REQUIRES handrails on BOTH sides — the calculator forces both-sides automatically. Below 44″, one-side is allowed (toggle the both-sides option for design preference).

  3. 03

    Pick handrail height

    IRC R311.7.8.1: 34-38″ measured vertically from tread nose. 36″ is most common. 34″ for shorter users. 38″ for taller. Above 38″ = code violation.

  4. 04

    Pick material

    PT pine ($12/LF). Cedar ($18). Composite ($26 — matches deck). Aluminum ($38 — modern). Steel ($32 — industrial). Cable ($48 — minimalist, premium).

  5. 05

    Include guardrail if needed

    IRC R312.1 — guardrail (full balustrade) required if stair walking surface is >30″ off grade. The calculator adds guardrail cost ($28-95/LF depending on material) on top of handrail cost.

How we calculate

How DeckMath calculates the result — IRC 2021 sources.

The Stair Railing Calculator sizes handrails + guardrails for stairs per IRC R311.7.8 + R312. Pythagorean sloped length × handrail count (1 or 2 sides per IRC R311.7.8.2 — both sides if stair >44″ wide). 6 materials (PT pine, cedar, composite, aluminum, steel, cable) × handrail-only vs handrail+guardrail. Auto-enforces IRC handrail height 34-38″ + handrail-both-sides threshold. Guardrail required separately if stair walking surface >30″ off grade (R312.1).

IRC references

  • IRC R311.7.8.1 — Handrail height 34-38″
  • IRC R311.7.8.2 — Both sides if stair > 44″ wide
  • IRC R312.1 — Guardrail at > 30″ off grade
  • IRC R311.7.8.3 — Grip dimensions Type I or II

IRC 2021 R311.7.8 + R312. Material pricing 2026-Q1 big-box retail.

Sloped length
sloped = √(run² + rise²) / 12 (convert to ft)

Same Pythagorean math as stringer length. For 80″ run × 49″ rise: √(6400 + 2401) = 93.8″ = 7.82 ft sloped length per handrail.

Total handrail LF
total = sloped × handrail_count

1 side or 2 sides. For 7.82 ft × 2 sides = 15.6 ft total — round to 16 ft for ordering.

Handrail cost
cost = total_lf × $/LF

PT pine: 16 × $12 = $192. Aluminum: 16 × $38 = $608. Cable: 16 × $48 = $768 for handrail only.

Guardrail (R312.1)
guardrail_lf = sloped × handrail_count (matches handrail)

Full balustrade follows the same path as handrail. Cost: PT pine $28/LF, aluminum $78/LF, cable $95/LF. Required if stair walking surface > 30″ off grade.

Save your plan

Don’t lose this estimate.

Your inputs are preserved in the URL — email it to yourself or copy the link so you can compare with contractor bids later. No account needed.

People also ask

Deck calculator questions, answered.