Deck railing calculator
Deck railing calculator: post spacing and balusters
Enter each straight run of railing and the post spacing your system allows. Get the posts, the fewest balusters that keep every gap under 4 inches, the rails and the hardware — run by run.
Enter your runsOptional
What will it cost?
Every material the calculator worked out gets its own price. Each field starts at a typical US figure so you have something to work from — change any of them to what your own supplier charges.
These prices are approximate. They are national US retail figures, and what you actually pay varies with your region, your supplier, the season and how much you buy at once. Treat them as a starting point, not a quote — always price the job from your own supplier's current figures before you order.
Your prices
More in this series
The rest of the deck
A deck is boards, frame, stairs, railing and finish. The sizes you have entered here carry across to the rest.
- Deck Material Calculator Deck boards by length, joists, beam, posts, hangers and screws or hidden clips
- Deck Stair Stringer Calculator Stringers, treads, risers and the cut that keeps every step even
- Deck Stain Calculator Gallons of stain for the deck floor and every face of the railing
- Deck Footing Sizes and Spacing Form tube sizes, pad size by load and soil, and frost depth
- Deck Joist and Beam Span Tables Joist spans by species, size and spacing, beam spans, cantilevers and ledger fasteners
- Deck Board Sizes and Lengths Nominal and actual decking sizes, stock lengths, coverage and joist spacing
Based on your result
What you'll need
Set the posts first and measure the real clear span between them before cutting balusters — a post a quarter inch out changes the gaps.
- Railing posts
- Bolted through the rim, never just screwed to it
- Calculate above
- Balusters
- Cut to one length and gapped with a spacer block
- —
- Top and bottom rails
- A 2 × 6 cap over a 2 × 4, or the system rail
- —
- Rail brackets
- One at each end of every rail
- —
- Spacer block
- Cut to the gap the result gives, so every baluster lands alike
- 1
The maths
How this deck post spacing calculator works
The code does not set a baluster count. It sets a test: a 4 in sphere must not pass through any opening in the guard. With n balusters in a clear span there are n + 1 gaps, so the question is simply the smallest n that brings every gap under 4 inches.
clear span = run ÷ sections − post width
gap = (clear span − n × baluster) ÷ (n + 1)
n = ⌊ (clear span − 4) ÷ (4 + baluster) ⌋ + 1
posts = sections + 1
- 01
Split each run into sections
The run over the maximum post spacing, rounded up, so the posts are evenly spaced and none is further apart than the system allows.
- 02
Take the posts out
The clear span is the section less one post width: the space the balusters actually fill.
- 03
Find the fewest balusters
The smallest count for which every gap is under 4 in. One fewer and a gap reaches 4 in; the calculator checks both.
- 04
Share the corners
Runs are listed in order round the deck, and each corner post serves both runs it joins.
- 05
Add the rails and hardware
A top and a bottom rail on every run, a bracket at each rail end, and two screws top and bottom on every baluster.
Good to know
Deck railing questions, answered
Six feet on center is the common maximum for wood railing, and many aluminium and composite systems are rated for 6 or 8 ft sections. The railing system’s installation instructions set the figure; the calculator takes whatever you enter.
With 4 × 4 posts at 6 ft centres the clear span is 68½ in, and 1½ in wood balusters need 12 of them to keep every gap under 4 in — 3.88 in each. Metal ¾ in balusters need 14.
No opening in a deck guard may let a 4 in sphere pass through. It is written that way so a small child’s head cannot fit between the balusters, and it applies to the gaps between balusters and under the bottom rail.
At least 36 in above the deck surface for a home under the IRC, measured to the top of the rail. Some jurisdictions ask for more; check with the building department.
The IRC requires a guard where the deck surface is more than 30 in above the grade below at any point within 36 in of its edge. Below that height a railing is optional, though often still a good idea.