Lumber & Framing
Updated Aug 7, 2026

Deck Railing Calculator

Calculate deck railing posts, balusters, and rails with IRC 4-inch sphere rule and code-compliant spacing.

How to Calculate Deck Railing

Deck railings must meet code, resist a 200 pound point load, and produce a clean appearance. The calculation covers posts, balusters, top and bottom rails, and the top cap. Code compliance starts with baluster spacing and post rigidity.

Baluster Count Formula

The IRC requires that no 4 inch sphere can pass between balusters:

Balusters=Rail LengthinBaluster W+Gap

Code Requirements

  • Height - 36 in minimum (decks 30 to 70 in above grade); 42 in above that
  • Baluster gap - 4 inch sphere maximum
  • Load - top rail resists 200 lb point load in any direction
  • Post spacing - typically 6 feet, never exceed 8 feet
  • Post attachment - 1/2 inch through-bolts to rim joist, not lag screws

Material Comparison

MaterialInstalled / LFNotes
Wood (PT)20 to 35 USDCheapest, needs refinishing
Aluminum40 to 80 USDLow maintenance
Cable80 to 200 USDOpen views, stiff posts needed
Glass Panel120 to 300 USDPremium clear view
Stair Railings Are Different
Handrails on stairs must be 34 to 38 inches above the nosing line and gripable (1.25 to 2 inch diameter). Stair balusters can be slightly wider (4-3/8 inch sphere). Extend the rail one tread past the top and bottom steps where possible.

Rail Post Installation Detail

Rail posts attach to the deck's rim joist (or corner post) and must resist both downward and outward loads. The 2015+ IRC shows two accepted details:

  • Notched post - 4x4 notched 1-1/2 inch to wrap around the rim joist - stronger lever arm
  • Un-notched with hold-down - 4x4 mounted to outside of rim with Simpson DTT2Z hold-down bolted through to a blocking frame inside

Never attach posts with just deck screws or lag bolts into the rim. All code-compliant attachments require through-bolts (1/2 inch bolts with washers on both sides).

Top Rail Types

Rail StyleComfortDrink / Snack Use
2x6 flat capGoodYes - set drinks
Molded drink railExcellentYes, shaped groove
Rounded 2x4GripableNo
Tension-Test Cable Railings
Cable railings must be tensioned to 250 to 300 pounds per cable to meet the 4 inch sphere rule under load. Without proper tension, cables flex enough for a child's head to pass through. Use turnbuckles or tensioning fittings designed for the manufacturer's system.

Frequently Asked Questions