Guards · IRC R312

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.

1 Railing runs
ft
Outside of end posts
ft
ft
ft
0 to skip
2 System
Center to center. Follow your system’s rating
Code: a 4″ sphere must not pass
Balusters
81
3 3/4″ max gap
Posts
10
Corners counted once per run end
Sections
7
40′ total
Rails
7
3×10′, 4×12′ (top + bottom)
Guards are required where the deck is more than 30″ above grade within 36″ of the edge. They must be at least 36″ high, and a 4″ sphere must not pass through any opening (IRC R312). Many jurisdictions require 42″ on some buildings, so check locally.

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.

RunSectionsClear per sectionBalusters / sectionGap
1: 16′359 5/16″113 9/16″
2: 12′266 3/4″123 3/4″
3: 12′266 3/4″123 3/4″

One section, to scale

run 1
4″ sphere59 5/16″ between posts · 11 balusters · 3 9/16″ gaps

Laying 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.

Questions people ask

How many balusters do I need per foot?
With 2x2 wood balusters (1½″ actual) and gaps just under 4″, plan on a little over two balusters per foot of clear railing. A 6 ft section between 4x4 posts (about 68½″ clear) needs 13 balusters for gaps of 3.5″.
What is the maximum baluster spacing for deck railings?
The IRC requires that a 4″ sphere cannot pass through any opening in a guard (R312.1.3). Builders aim for 3½″ to 3¾″ clear gaps, which leaves room for boards to shrink or bow.
When is a deck railing required?
When the walking surface is more than 30″ above the grade below, measured within 36″ horizontally of the edge (IRC R312.1.1). The guard must then be at least 36″ high.
How far apart should railing posts be?
Wood guard posts are commonly spaced 6 ft on center or less. Manufactured railing systems are tested at specific spacings, often 6 or 8 ft, so follow the system’s instructions.

Related calculators

All calculators →