Skip to content

Baluster Spacing Calculator (IRC 4 Inch Rule)

Enter the clear length between posts in inches, the baluster width and the number of sections to get the balusters per section, the equal gap and the on-center spacing, checked against the IRC 2021 guard rules.

Calculator Details

Balusters:68See results ↓

NBC 2020 in Canada (the same limits in NBC 2025; provinces adopt it with amendments), IRC 2021 in most US states

A level deck, balcony or landing, or the open side of a stair

Millimetres or inches

Measured horizontally between the post faces

Sections of this length

A 2 × 2 is 38 mm (1½ in); metal balusters are often 16–19 mm (⅝–¾ in)

0 = the code maximum; many builders aim a little under it

Walking surface to the ground below (sets whether a guard is needed and how high)

Your Results

Balusters: 68

Balusters

68

17 per section × 4 sections

Equal gap

3.917 in

Limit 4 in (IRC 2021 (US))

Centre to centre

5.417 in

First centre 4.667 in from the post

Minimum guard height

36 in

IRC R312.1.2

Code limits are for the opening, not the spacing: no gap anywhere in the guard may let the sphere through, including under the bottom rail. Local amendments and your building inspector govern, and guards must also resist the code loads.

4 sections of 96 in need 17 balusters each (68 in all), with equal gaps of 3.917 in and centres 5.417 in apart, under the 4 in limit (IRC 2021 (US)).

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

Layout marks for one section (from the post face, in)
BalusterNear edgeCentre
13.9174.667
29.33310.083
314.7515.5
420.16720.917
525.58326.333
63131.75
736.41737.167
841.83342.583
947.2548
1052.66753.417
1158.08358.833
1263.564.25
1368.91769.667
1474.33375.083
1579.7580.5
1685.16785.917
1790.58391.333

Measure from the same post every time to avoid adding up small errors.

How This Calculator Works

How the spacing is calculated

Balusters = ⌈(length − largest gap) ÷ (baluster width + largest gap)⌉

Equal gap = (length − balusters × width) ÷ (balusters + 1)

Your numbers: ⌈(96 − 4) ÷ (1.5 + 4)⌉ = 17; (96 − 17 × 1.5) ÷ 18 = 3.917 in.

Frequently Asked Questions

How many balusters for an 8 ft railing section?

17 balusters of 1½ inches for 96 inches between the posts, at an even gap of about 3.92 inches and 5.42 inches on center. That keeps every opening under the IRC's 4 inch sphere. Four such sections take 68 balusters.

Is the stair baluster spacing different from the deck?

Slightly. IRC 2021 R312.1.3 allows openings on the open sides of a stair that won't pass a 4⅜ inch sphere, against 4 inches on a deck or landing. Measured along the slope of a 7½ by 10 inch stair, an 8 ft section takes 16 balusters at a gap of about 4.24 inches.

How high does a stair railing have to be in the US?

Under IRC 2021, a guard on the open side of a stair is at least 34 inches high measured vertically from the line of the tread nosings, and the handrail is 34 to 38 inches. On decks, porches and landings more than 30 inches above the ground the guard is 36 inches; many states and HOAs, and the commercial code, require 42 inches.

What spacing does OSHA require for guardrails?

OSHA's workplace rule (29 CFR 1910.29) asks for a top rail 42 inches high, plus or minus 3 inches, and openings no wider than 19 inches, a much looser limit than the residential 4 inch rule. It applies to employers, not to the railing on your house; residential guards follow the code your city has adopted.

Opening and height limits from the National Building Code of Canada 2020 (same in NBC 2025), Division B, Articles 9.8.8.1, 9.8.8.3 and 9.8.8.5 (wording checked in the BC Building Code 2018 Part 9), and the International Residential Code 2021 R312.1 (US values from secondary sources, still being checked). Your province's or state's code, local amendments and your building inspector govern. It lays out equal gaps between vertical balusters in straight sections; it leaves out the bottom-rail gap and the stair triangle, curved and angled sections, posts and rails, guard load resistance (NBC Table 4.1.5.14), glass and cable guards, and handrail rules.

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.

  1. Each baluster plus its gap must be no more than 1.5 + 4 = 5.5 inches on center.
  2. Gaps needed: the 96 inches, plus one baluster width, divided by 5.5, rounded up gives 18 gaps, so 17 balusters.
  3. 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.
  4. 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.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy