The 4-inch sphere rule
The 2021 International Residential Code (IRC) says in section R312.1.3 that required guards shall not have openings, from the walking surface up to the required guard height, that allow a sphere 4 inches in diameter to pass. On the open side of a stair the limit is a 4⅜-inch sphere, and the triangle formed by a riser, a tread and the bottom rail may be as large as a 6-inch sphere.
| Rule | Limit | Section |
|---|---|---|
| Opening in a guard | No 4-inch sphere passes | R312.1.3 |
| Guard on the open side of a stair | No 4⅜-inch sphere passes | R312.1.3, exception 2 |
| Triangle at riser, tread and bottom rail | No 6-inch sphere passes | R312.1.3, exception 1 |
| Guard height | 36 inches minimum (34 on the open side of a stair) | R312.1.2 |
| Handrail height above the nosings | 34 to 38 inches | R311.7.8.1 |
The gap between two balusters must therefore be less than 4 inches, not equal to it. The calculator refuses a largest gap of 4 inches or more on a deck, and 4⅜ inches or more on a stair. The code wording on this page was read in the 2021 edition, as reproduced by Viewrail in its 2021 International Residential Code Visual Interpretation; the official text is published by the International Code Council. The IRC applies where a city or state adopts it, sometimes with changes, so check the code where you build.
How the spacing is worked out
Between two posts there is always one more gap than there are balusters. The calculator finds the smallest number of balusters that keeps every gap at or under your limit, then spreads them evenly.
Balusters = (space − largest gap) ÷ (baluster width + largest gap), rounded up
Equal gap = (space − balusters × width) ÷ (balusters + 1)
On-center spacing = equal gap + width
Measure the space from the face of one post to the face of the next, not from center to center. On a stair, measure it level, because the sphere passes between two vertical balusters horizontally. Measure the actual width of a baluster rather than going by its name.
Worked example: a section of 70½ inches
The posts are 70½ inches apart, the balusters are 1½ inches wide and the gaps may not exceed 3¾ inches.
- Balusters: (70.5 − 3.75) ÷ (1.5 + 3.75) = 12.714, rounded up to 13
- Width of the balusters: 13 × 1.5 = 19.5 inches
- Equal gap: (70.5 − 19.5) ÷ 14 = 3.643 inches, just over 3⅝
- On center: 3.643 + 1.5 = 5.143 inches
- First baluster center: 4.393 inches from the post face
A deck with six sections of that length needs 78 balusters. An 8-foot section of 96 inches with 2½-inch balusters and a 3½-inch limit takes 16 balusters at 3.294-inch gaps. On the open side of a stair, with a 4¼-inch limit, the 70½-inch section needs 12 balusters and the gap is 4.038 inches, under the 4⅜-inch sphere.
Balusters for common post spacings
The table uses 1½-inch balusters and a largest gap of 3¾ inches. Each row is the calculator's own result.
| Space between posts | Balusters | Equal gap | On center |
|---|---|---|---|
| 36 inches | 7 | 3.188 in | 4.688 in |
| 48 inches | 9 | 3.45 in | 4.95 in |
| 60 inches | 11 | 3.625 in | 5.125 in |
| 72 inches | 13 | 3.75 in | 5.25 in |
| 84 inches | 16 | 3.529 in | 5.029 in |
| 96 inches | 18 | 3.632 in | 5.132 in |
To lay out a section, mark the first center from one post, then step the on-center spacing along the rail. Checking the last gap against the post shows any error before you drive a screw. A spacer block cut to the equal gap does the same job on site.
Heights and what the calculator does not check
The same code sets guard heights in R312.1.2: at least 36 inches above the walking surface, and at least 34 inches measured from the line of the stair nosings on the open side of a stair. Handrails on stairs go 34 to 38 inches above the nosings under R311.7.8.1. The calculator does not check the strength of posts, rails or fasteners, nor the gap under the bottom rail, and your local code is the rule that applies. For the deck itself, see the deck calculator, and for the steps, the stair calculator.
Baluster Spacing Calculator FAQ
What is the maximum spacing between balusters?
Under section R312.1.3 of the 2021 IRC, a 4-inch sphere must not pass through, so each gap must be less than 4 inches. On the open side of a stair the limit is a 4⅜-inch sphere.
How many balusters do I need for a 6-foot section?
For 72 inches between posts with 1½-inch balusters and gaps of 3¾ inches or less, 13 balusters with 3.75-inch gaps.
How do I space balusters evenly?
Subtract the total width of the balusters from the space between the posts, then divide by the number of balusters plus one. That is the gap at both ends and between every pair.
Do I measure between posts center to center?
No. Measure the clear space from the face of one post to the face of the next, because that is the length the balusters and gaps have to fill.
How high does a deck railing have to be?
The 2021 IRC requires required guards on open-sided walking surfaces, such as porches, balconies and landings, to be at least 36 inches high above the walking surface. Check your local code as well.