Deck Railing & Baluster Calculator
Enter your railing runs. Get the posts, the fewest balusters that keep every gap under 4 inches, the exact on-center spacing and the rails to buy.
Where two runs meet at a corner they can share a post. Subtract one post per shared corner: 8 posts if the runs form one continuous rail.
| Run | Sections | Clear per section | Balusters / section | Gap |
|---|---|---|---|---|
| 1: 16′ | 3 | 59 5/16″ | 11 | 3 9/16″ |
| 2: 12′ | 2 | 66 3/4″ | 12 | 3 3/4″ |
| 3: 12′ | 2 | 66 3/4″ | 12 | 3 3/4″ |
One section, to scale
run 1Laying out balusters so the gaps come out even
Never start at one post and step across at a fixed spacing. You end up with an odd gap at the far post. Work out the clear distance between posts, then find the fewest balusters that keep every gap under your limit. With n balusters of width b in a clear space C, every gap is (C − n × b) ÷ (n + 1).
Mark the first baluster one gap in from the post, then mark each next one at gap + b on center. A spacer block cut to the gap width makes installation fast and consistent.
Guard rules worth knowing
- Height: 36″ minimum on decks under the IRC, measured from the decking to the top of the rail. Some jurisdictions, and commercial buildings, require 42″.
- Openings: a 4″ sphere must not pass anywhere. On stairs, the triangle between the tread, riser and bottom rail may pass a 6″ sphere, and the rest of the stair guard a 4⅜″ sphere.
- Strength: guards must resist a 200 lb concentrated load at the top. Notched 4x4 posts lag-screwed to the rim usually fail that test. Use through-bolts with blocking or tested post brackets.
Worked example: a 16 × 12 ft deck with a stair opening
Railing runs along the two 12 ft sides and the 16 ft outer edge, minus a 36 in. stair opening: 12 + 12 + 16 − 3 = 37 ft. With posts no more than 6 ft apart (a common limit for wood guard posts) that is about eight sections. At roughly 2.4 balusters per foot for 2×2s spaced at 5 in. on center, plan for around 90 balusters, then let the calculator count each section exactly, because posts at corners and openings change the numbers.
Choosing a railing system
- Wood (2×2 balusters, 2×4 rails, 4×4 or 6×6 posts): cheapest and fully DIY; needs stain or paint.
- Metal balusters in wood rails: thinner balusters improve the view; count goes up because each is narrower.
- Composite or aluminum kits: sold by section length with brackets; follow the kit’s post spacing exactly, since its strength depends on it.
- Cable and glass: require tensioning or engineered panels; the 4 in. sphere rule still applies when the cable is pushed.
Post attachment is the weak link
A guard must resist a 200 lb load at the top (IRC Table R301.5). Most failures happen where the post meets the rim joist, not in the balusters. Through-bolt posts and use blocking or tested hardware as shown in DCA 6, rather than notching posts deeply or relying on lag screws alone. For exact gaps in a single section, use the baluster spacing calculator.
Ordering
Buy balusters by the count per section, not by total length, and add a few spares for splits and warped pieces. Rails come in 8, 10, 12 and 16 ft lengths; with posts about 6 ft apart, a 12 ft rail spans two sections, which reduces joints. Post caps and hardware are per post, so count posts first.
Questions people ask
How many balusters do I need per foot?
What is the maximum baluster spacing for deck railings?
When is a deck railing required?
How far apart should railing posts be?
Related calculators
All deck tools →Deck Stair Calculator
Risers, treads, stringer length and throat, with a drawing to scale.
Deck Planner
Decking, framing, footings, hardware and concrete in one shopping list, with a plan drawing.
Deck Stain Calculator
Gallons for the deck, railings and stairs, using your product’s label coverage.
Deck Board Calculator
Boards by stock length with seams placed on joists, plus screws or hidden clips.
Deck Cost Calculator
Wood vs composite vs PVC tiers, railings, stairs and your region: low, typical and high.
Joist Span Calculator
Maximum joist span and cantilever from IRC Table R507.6, and the joist count.