How to use the baluster spacing calculator
- Enter the opening between posts in feet and inches.
- Enter the baluster width, the face width of one baluster.
- Enter the largest gap allowed. Local building codes set the actual maximum, so check yours.
- Read the number of balusters, the exact gap and where each baluster sits from the post.
Formula
n balusters leave n + 1 equal gaps, so n x width + (n + 1) x gap = opening
Smallest n for a gap of at most the maximum: n = rounded up (opening - maximum gap) / (width + maximum gap)
Gap = (opening - n x width) / (n + 1)
Center to center spacing = width + gap
Center of baluster k from the left post = gap + width / 2 + (k - 1) x (width + gap).
A 10 foot rail with 1.5 inch balusters and a 4 inch maximum gap
The opening is 120 inches. The smallest count that keeps every gap at 4 inches or less is rounded up (120 - 4) / (1.5 + 4) = 21.09, so 22 balusters. The gap is (120 - 22 x 1.5) / 23 = 3.783 inches, and balusters sit 5.283 inches center to center. The first baluster center is 4.53 inches from the post.
For a 3 foot opening, (36 - 4) / 5.5 = 5.82, so 6 balusters with 3.857 inch gaps.
Equal spacing between posts
For a level run, equal gaps look best. With n balusters there are n + 1 gaps, one at each end next to the posts and n - 1 between balusters. Setting all of them equal gives a single gap size, and picking the smallest n that keeps that gap under your maximum uses the fewest balusters.
The table of center positions measures from the left post, which helps when you mark a rail for drilling or cut a spacer block to the gap width.
Check your local code
Your local building code sets the maximum gap and other railing rules, and they can differ for stairs, decks and different heights. This page does not state a required number, and the maximum in the box is simply what you enter. Confirm the rule with your building department before you buy materials.
On a stair rail that follows the slope, spacing is measured differently and post and rail strength matter too, and none of that is modeled here. For related work see the deck calculator, the stair stringer calculator, the fence calculator and the linear feet calculator.
Assumptions and limits
- The rail section is level and straight between two posts.
- All balusters have the same width and gaps are equal, including those next to the posts.
- The maximum gap is a number you enter and is not a statement of any code.
- Posts, rails and fastening are not part of the calculation.
Frequently asked questions
How do you calculate baluster spacing?
Find the smallest number of balusters that keeps every gap under your maximum, then divide the leftover space equally into one more gap than there are balusters.
What is the maximum gap between balusters?
Local building codes decide that, and it can vary by place and type of railing. Check with your building department. The tool uses the number you enter.
How many balusters do I need for a 10 foot rail?
With 1.5 inch balusters and a 4 inch maximum gap you need 22, with gaps of about 3.78 inches.
Why are the gaps next to the posts the same as the others?
For an even look the end gaps are made equal to the gaps between balusters. You could shift balusters to make the end gaps different, but the tool keeps them equal.