Baluster Spacing Calculator: The IRC 4 Inch Rule for Deck Railings
By FindMySum · Last reviewed
This baluster calculator spaces the vertical pickets of a deck, porch or stair railing evenly between two posts and checks the result against the International Residential Code 2021. The rule that drives it is the 4 inch sphere: no opening in a residential guard may let a 4 inch ball pass, so that a small child's head can't go through. The calculator finds the fewest balusters that keep every gap under that limit (or under the smaller gap you choose), then gives the exact equal gap and where to put the first baluster.
Worked example: a deck with four 8 ft sections
The US page starts with 96 inches clear between posts, four sections, 1½ inch balusters (a 2×2), the IRC 2021 rules and a deck 40 inches above the ground.
- Each baluster plus its gap must be no more than 1.5 + 4 = 5.5 inches on center.
- Gaps needed: the 96 inches, plus one baluster width, divided by 5.5, rounded up gives 18 gaps, so 17 balusters.
- Equal gap: (96 − 17 × 1.5) ÷ 18 = 3.92 inches; on-center spacing 5.42 inches, the first centered 4.67 inches from the post.
- In all: 68 balusters for four sections.
Because the deck is more than 30 inches above grade, IRC R312.1.1 requires a guard, at least 36 inches high (R312.1.2).
Laying out and installing
Make a spacer block cut to the gap (about 3⅞ inches here) and work from the center of the section out, so any small error ends up evenly at the posts. Check the gap with a 4 inch block or a ball at the bottom too: the triangle between the bottom rail and the stair treads is allowed to pass a 6 inch sphere, but not more. Guards must resist a 200 lb load at the top in any direction, which is why railing posts need through-bolts or tested hardware, not just nails or screws into the rim joist.
Metal and cable railings
Aluminum and steel balusters are often ¾ inch square or round, so you need more of them per section; enter their width to see how many. Horizontal cable railings meet the 4 inch rule only if the cables are tensioned tightly enough that a sphere can't push between them, so follow the maker's post spacing and tension, and check whether your local code allows them, because some jurisdictions treat horizontal infill as climbable.
For millimetres and the 100 mm rule of the National Building Code of Canada, use the baluster calculator.
Sources
This article explains how the calculator works and is general information, not financial, tax or legal advice. Rules change; check the sources above or a qualified professional before you act.