Railing Calculator
Calculate balusters, posts, and rails for deck or stair railing from run length and baluster spacing.
Returns a full materials list and code-compliant count.
Deck and stair railings must meet building codes in almost every jurisdiction, so calculating materials before you buy is both a money-saving step and a safety-planning step. The main variables are the total linear footage of railing, the post spacing, the baluster spacing, and the rail height.
Key formulas:
Number of Posts = (Total Linear Feet ÷ Post Spacing) + 1 Number of Balusters = (Total Linear Feet × 12) ÷ Baluster Spacing (inches) − 1 Top Rail Length = Total Linear Feet (plus 10% for waste and cuts)
What each variable means:
- Post Spacing — typically 6 to 8 feet on center for wood, 4 to 6 feet for aluminum.
- Baluster Spacing — most codes require no gap wider than 4 inches (so a 4-inch sphere cannot pass through).
- Rail Height — residential decks typically require 36 inches; decks more than 30 inches above grade usually require 42 inches. Always check your local code.
Worked example: A deck has 40 linear feet of railing. Posts every 8 feet, balusters every 4 inches.
Posts = (40 ÷ 8) + 1 = 6 posts Balusters = (40 × 12) ÷ 4 − 1 = 480 ÷ 4 − 1 = 119 balusters Top rail = 40 × 1.10 = 44 linear feet (with waste)
Typical material quantities:
- A 20-foot deck section needs roughly 60–65 balusters at code-compliant spacing.
- Always add 5–10% waste factor for angle cuts on stair sections.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.