Baluster Spacing Calculator
Expert Guide: Deck Railing & Baluster Spacing 2026
Getting baluster spacing wrong is one of the top reasons deck inspections fail. The math seems simple, but uniform spacing that also satisfies the 4-inch rule requires a precise calculation — not a guess. This guide explains the code, the math, and the tricks professionals use.
The 4-Inch Rule Explained
IRC Section R312.1.3 requires that no opening in a deck guardrail allow a 4-inch sphere to pass through. This means the gap between any two balusters — measured at the widest point — must be less than 4 inches (100mm). Most installers target 3.5–3.875 inches to provide a comfortable safety margin and account for wood movement.
Stair Railings: Tighter Rules
For stair guardrails, many jurisdictions reduce the maximum opening to 4-3/8 inches when measured with the sphere resting on the stair nosing. In practice, use the same 3.875-inch target gap for both deck and stair railings — this satisfies both requirements without separate calculations. Our stair mode applies this automatically.
How to Calculate Perfectly Even Spacing
The key insight is that you need to work backwards from the number of balusters, not forwards from a target gap. Here is the professional method: First, divide the rail length by (baluster width + target gap) to get an approximate baluster count. Round up to the next whole number. Then recalculate the exact gap as: (Rail Length - Number of Balusters x Baluster Width) / (Number of Balusters + 1). This gives you the exact spacing that fills the rail perfectly with even gaps on both ends. Our calculator does this in one click.
Railing Height Requirements by Country
US (IRC 2021): 36 inches minimum for decks under 30 inches above grade, 42 inches for decks 30 inches or higher. UK (Part K): 900mm (36 inches) minimum. Canada (NBC 2020): 900mm under 1.8m deck height, 1070mm above 1.8m. Australia (NCC): 1000mm (39 inches) for decks over 1 meter. Handrail height for stairs is 34–38 inches above the stair nosing in the US.
Baluster Materials in 2026
Square wood (1.5"): Most common, lowest cost, must be sealed annually. Composite square (1.5"): Low maintenance, matches Trex/TimberTech decking, costs 2-3x wood. Round metal (3/4"–1"): Aluminum or steel, very durable, popular for modern deck aesthetics. Requires specific post bracket systems. Cable railing: Horizontal cables must be tensioned so a 4-inch sphere cannot pass — typically 3.5-inch spacing. Note: some local codes restrict horizontal railing due to climbability concerns for children.
Post Spacing for Railings
Railing posts should be spaced no more than 6–8 feet apart for most wood and composite systems. Metal post systems vary — always check the manufacturer's specifications. Posts must be secured to the deck framing (not just the decking boards) with through-bolts or approved post base hardware. Notched posts over the rim joist are the traditional method but have been shown to weaken the rim joist — surface-mounted post bases are the modern preferred approach.
Deck Railing Baluster Spacing Calculator — How It Works
Our deck railing baluster spacing calculator takes three inputs: total railing length, baluster width (actual dimension) and maximum allowed gap. It finds the largest even spacing that keeps every gap at or below 4 inches — giving you a perfectly even layout with no odd gaps at the ends.
Calculating Baluster Spacing on Stairs
Calculating baluster spacing on stairs requires measuring along the slope. The 4-inch rule is measured perpendicular to the stringer pitch, not horizontally. Use our stair mode and the calculator handles the angle automatically.
Wood Spindle Spacing Calculator
A wood spindle spacing calculator uses the same formula as a baluster calculator — the terms are interchangeable. In the UK and Australia, vertical railing infills are called spindles. Whether you are spacing 32mm square spindles or 1.5-inch turned balusters, the 4-inch (100mm) maximum gap rule applies in all four countries.
Baluster Spacing Formula
The manual baluster spacing formula is: Spacing = (Total Length + Baluster Width) / (Balusters + 1) − Baluster Width. Divide total length by 5.5 and round up to get the starting baluster count, then verify the gap stays at or below 4 inches. Our calculator does this instantly.