Baluster Spacing Calculator

A railing looks right when every gap is the same, and it is safe when no gap is too wide. Enter the space between two posts, the width of a baluster and the largest gap you will allow, and the calculator finds how many balusters fit, the equal gap between them and where to put the first one.

Enter your railing

Units

The 2021 International Residential Code sets a 4 in sphere for guards and a 4⅜ in sphere on the open side of a stair.

Measure from the face of one post to the face of the next, not center to center.

Measure the actual width.

Must be under the code sphere.

Run the calculator again for sections of another length.

Balusters for this section

13 balusters

3.643 in gaps · 5.143 in on center

Baluster layout
Space between posts70.5 in
Baluster width1.5 in
Largest gap you allow3.75 in
Balusters per section13
Total balusters13
Equal gap (14 gaps)3.643 in, about 3 5/8 in
On-center spacing5.143 in, about 5 1/8 in
First baluster center from the post4.393 in, about 4 3/8 in
Code sphere checked4 in: the gap is smaller

Formula: balusters = (space − gap) ÷ (baluster width + gap), rounded up; equal gap = (space − balusters × width) ÷ (balusters + 1). Limits from the 2021 International Residential Code, R312.1.3. Your local code may differ, so check it.

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.

Railing limits in the 2021 International Residential Code
RuleLimitSection
Opening in a guardNo 4-inch sphere passesR312.1.3
Guard on the open side of a stairNo 4⅜-inch sphere passesR312.1.3, exception 2
Triangle at riser, tread and bottom railNo 6-inch sphere passesR312.1.3, exception 1
Guard height36 inches minimum (34 on the open side of a stair)R312.1.2
Handrail height above the nosings34 to 38 inchesR311.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.

Balusters per section, 1½-inch balusters, gaps of 3¾ inches or less
Space between postsBalustersEqual gapOn center
36 inches73.188 in4.688 in
48 inches93.45 in4.95 in
60 inches113.625 in5.125 in
72 inches133.75 in5.25 in
84 inches163.529 in5.029 in
96 inches183.632 in5.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.

Last updated . Free to use, no sign-up. How we check our numbers.