Baluster Spacing Calculator
Find the baluster count and the equal gap that stays under the 4 inch sphere.
Enter the clear distance between the posts.
- Railing
- Level
- Clear distance
- —
- Sections
- 1
- Baluster width
- 1 1/2"
- Max gap
- 4"
- Extra
- 0%
Railing
1 to 240 inches, inside face of one post to the inside face of the next.
1 to 100 identical openings.
1/4 to 6 inches. A 2x2 is 1 1/2 inches.
1 to 6 inches. The space between balusters stays under this.
0 to 20 percent spare balusters.
Enter the clear distance between the posts.
Code reference
-
Baluster gap
Under 4 inches
IRC R312.1.3 (2024: R321)
A 4 inch sphere must not pass a level guard.
-
Stair baluster gap
Under 4 3/8 inches
IRC R312.1.3 (2024: R321)
The open side of a stair uses the larger sphere.
-
Gap near the limit
3 3/4 to 4 inches
Rule of thumb
A warning. Wood movement can open a gap this close to 4 inches.
-
Stair triangle
6 inch sphere
IRC R312.1.3 (2024: R321)
Shown as a note. This page does not draw the tread triangle.
-
Guard height
36 in level, 34 in stair
IRC R312.1.2
Shown as a note. Height is not an input on this page.
Code checks reference the 2021 International Residential Code (section numbers for the 2024 edition shown in parentheses). States and cities adopt different editions and often amend them, so limits in your area may differ.
Based on the IRC model code. Your local jurisdiction may adopt a different edition or amendments — confirm with your building department.
How to measure
Clear distance is the opening between the inside faces of two posts. Set the tape on the inside face of one post and read it at the inside face of the next post. Do not include either post. On a level rail the tape can run level along the opening. On a stair you can measure the same opening two ways. Horizontal means the level distance between the posts. Along the rail means the sloping distance following the handrail, and the page turns that length into a level opening before it spaces the balusters. Record inches, or feet and inches. Measure each opening that has a different length as its own section. Identical openings can share one section count. A 2x2 baluster is 1 1/2 inches wide. A metal baluster is often 3/4 inch. The max gap is the largest space you will accept, and the finished gap stays strictly under it.
Formula
The page finds the smallest number of balusters that keeps every gap strictly under the limit you set. On a level rail the opening is the clear distance. On a stair measured along the rail, the level opening is that length times the cosine of the stair angle. The count is one more than the whole number of the opening minus the limit, divided by the baluster width plus the limit. When the opening is already no wider than the limit, the count is zero. The gap splits the leftover space into one more space than the number of balusters. On center is the gap plus the width. Along a stair rail, that spacing is divided by the cosine of the angle.
A 72 inch opening with 1.5 inch balusters and a 4 inch limit needs 13 balusters, a 3.75 inch gap, and a first center at 4.50 inches.
Common mistakes
- Measuring outside of post to outside of post and counting the posts as opening.
- Leaving the stair angle blank after measuring along the sloping rail.
- Setting a 4 inch max gap and accepting a finished gap that lands on 4 inches.
- Using the level spacing as the mark along a sloping rail.
- Forgetting that the spare percent rounds each order up, not to the nearest piece.
FAQ
How do I measure the clear distance?
Measure from the inside face of one post to the inside face of the next post. Leave the posts out of the number. On a level rail, keep the tape level. On a stair, choose horizontal when the tape is level, or along the rail when the tape follows the sloping handrail. Record inches, or feet and inches. A different opening needs its own clear distance.
What is the 4 inch rule?
A level guard must not let a 4 inch sphere pass through the balusters. The page spaces the balusters so every gap is strictly under the limit you enter. The model-code check still compares the finished gap with 4 inches on a level rail. A stair open side uses 4 3/8 inches. A gap from 3 3/4 inches up to 4 inches passes that check and also shows a warning, because wood movement can open it.
How does a stair railing change the count?
Enter the stair angle in degrees. If you measured along the rail, the page multiplies that length by the cosine of the angle and spaces the balusters on the level opening. The on-center mark along the rail is the level spacing divided by the same cosine. A 7.5 inch rise and a 10 inch run is about 36.87 degrees. The angle is required only for a stair railing.
Why are the end gaps the same as the middle gaps?
The leftover space is split into one more gap than the number of balusters. That puts the same gap against each post and between the balusters. The first edge is that gap, measured from the inside of the post to the near edge of the first baluster. The first center adds half the baluster width. Later centers step by the on-center distance, which is the gap plus the width.
What does the extra percent buy?
Extra is spare stock for a split or a short piece. The page multiplies the balusters in one section by the number of identical sections, then by one plus the percent, and rounds up. Zero extra buys exactly the layout count. Ten percent on two sections of a 13-baluster opening rounds 28.6 up to 29. The shopping list uses that total. It does not add posts or rails.
Does a passing check mean the guard meets my local code?
A passing row means the gap meets the model-code limit printed beside it. Guard height and the question of when a guard is required are notes, not measurements this page can check. The triangle under a stair rail is also a note: that opening must not pass a 6 inch sphere. Your city may adopt another edition or change a number. A pass is not a permit. Confirm the adopted code before you order the balusters.
Related tools
By Lumber Calc Editorial Team · Verified against 2021/2024 IRC & AWC DCA 6 · Last updated Oct 24, 2026