Deck Railing Calculator

Calculate balusters, posts, and railing materials needed for deck and stair railings. Code-compliant spacing.

Balusters neededPosts neededEstimated cost

Results

    How to Calculate Deck Railing Balusters

    The number of balusters depends on total railing length and the on-centre spacing between them. With standard 1.5-inch square balusters and code-maximum 4-inch gaps, the on-centre spacing is 5.5 inches (1.5-inch baluster + 4-inch gap). However, most builders use 3.5-inch gaps (5-inch on-centre) for a sturdier look and extra safety margin. The formula: (total railing length in inches / on-centre spacing) + 1 = balusters per section. Calculate each section between posts separately, then add them together.

    For a 6-foot (72-inch) section with 5-inch on-centre spacing: 72 / 5 + 1 = 15.4, rounded to 15 balusters. Note that the end balusters in each section sit against the posts, so some builders subtract 2 per section and rely on the post itself to close the gap. Check your railing system's instructions — kits often specify exact baluster counts per section length.

    Deck Railing Post Spacing and Requirements

    Posts are the structural backbone of any railing system. Code requires posts to withstand a 200-pound lateral force applied at the top, which means proper attachment to the deck framing is critical. Posts should be bolted through the rim joist with two 1/2-inch carriage bolts (not lag screws into the deck boards). Maximum spacing is 6 feet for wood railings; 8 feet may be acceptable for metal systems with engineering documentation.

    Count posts by dividing total railing length by post spacing and adding 1 for each end, plus 1 for each corner. A 40-foot straight run at 6-foot spacing needs 8 posts. A 40-foot run with 2 corners needs 9-10 posts. Posts at corners and stair transitions are structural anchors and should always be present regardless of spacing calculations.

    Deck Railing Cost Estimator

    Total railing cost per linear foot breaks down as: posts ($15-$40 each, every 6 feet), top and bottom rails ($3-$8 per linear foot), balusters ($2-$5 each), and hardware (post brackets, screws, caps — $5-$15 per post). Pressure-treated wood systems cost $15-$30 per linear foot total. Composite systems (Trex, TimberTech, Fiberon) run $30-$60 per foot but require no staining or painting.

    For a typical deck with 40 linear feet of railing: wood materials cost $600-$1,200, composite costs $1,200-$2,400, and aluminium or cable systems run $1,600-$4,800. Labour adds $20-$40 per linear foot ($800-$1,600 for 40 feet). The railing is often the single most expensive component of a deck project after the decking boards themselves.

    Building Code Requirements for Deck Railings

    Key code requirements that inspectors check: minimum railing height 36 inches (some jurisdictions require 42 inches), maximum baluster gap 4 inches (the 4-inch sphere rule), maximum gap under bottom rail 4 inches, posts must resist 200 lbs of lateral force at the top, and the top rail must support 200 lbs of downward force. Guards are required on any deck surface more than 30 inches above grade.

    Stair railings have additional requirements: height measured vertically from the stair nosing line must be 34-38 inches, handrails must be graspable (circular cross-section 1.25-2 inches in diameter), and must extend horizontally at least 12 inches beyond the top riser and at the slope of the stairs for the depth of one tread beyond the bottom riser. Always verify local amendments to the IRC — municipalities frequently adopt stricter requirements for deck railings.

    Frequently Asked Questions

    How many balusters do I need for a deck railing?

    Building code requires balusters spaced so a 4-inch sphere cannot pass between them. With standard 1.5-inch square balusters, space them 3.5 inches apart (on-centre spacing of 5 inches). Formula: (railing length in inches / on-centre spacing) + 1 = number of balusters. A 10-foot section needs about 25 balusters.

    How far apart should deck railing posts be?

    Maximum post spacing is 6 feet (72 inches) for most residential codes, though 4-foot spacing provides a sturdier railing. Posts must be bolted through the rim joist or deck framing — not just screwed to the deck surface. Each post needs two 1/2-inch carriage bolts minimum for structural attachment.

    How tall does a deck railing need to be?

    Minimum 36 inches for residential decks (measured from deck surface to top of rail) per IRC code. Many local codes require 42 inches, especially for decks more than 30 inches above grade. Commercial applications require 42 inches minimum. The top rail must be graspable (1.25 to 2 inches diameter or equivalenlat-top width).

    How much does deck railing cost per linear foot?

    Pressure-treated wood railing: $15-$30 per linear foot (materials). Composite railing: $30-$60 per linear foot. Aluminium railing: $40-$80 per linear foot. Cable railing: $60-$120 per linear foot. Professional installation adds $20-$40 per linear foot. A 40-foot deck perimeter costs $600-$1,200 for wood or $1,200-$3,200 for composite materials.

    Do I need railing on all sides of my deck?

    Railing is required on any side where the deck surface is more than 30 inches above grade (some jurisdictions say 24 inches). The house side and any side with a step-down of less than 30 inches to grade does not require railing. Stair sections need railing on both open sides if the stair is more than 30 inches abovnd at any point.

    How do I calculate railing for deck stairs?

    Measure the stair stringer length (not the horizontal run). The stair railing runs parallel to the stringer at 34-38 inches above the stair nosing line. You'll need a post at top and bottom of the stairs, plus intermediate posts every 6 feet of stringer length. Balusters on stair sections must be plumb (vertical), not angled with the stringer, and still pass the 4-inch sphere test.

    What is the 4-inch sphere rule for deck balusters?

    A 4-inch diameter sphere must not be able to pass through any opening in the railing system — between balusters, under the bottom rail, or between the rail and deck surface. This prevents small children from getting their head stuck. The gap under the bottom rail must also be less than 4 inches. Some builders use 3.5-inch spacing for extra safety margin.

    How many posts do I need for deck railing?

    Count one post at each corner of the deck, one at each side of every stair opening, and intermediate posts every 6 feet along straight runs. A 12x16 deck with stairs on one side typically needs 8-10 posts. Posts at stair transitions often need to be taller to accommodate the height difference between deck railing and stair railing.