Spindle Spacing Calculator - Baluster Spacing Tool
Calculate the clear gap between balusters or how many spindles a railing needs, and check the result against the 4-inch code rule. Metric and imperial units.
Spindle Spacing Calculator
Results
Visualization
Documentation
Spindle Spacing Calculator
A spindle spacing calculator works out the gap between the vertical bars of a railing, called spindles or balusters, or how many of them a given length needs. It helps a deck, stair, or fence railing meet the building-code rule that limits how wide any gap in a guard can be.
What is spindle spacing?
Spindle spacing is the open gap between the vertical bars of a railing. "Spindle" and "baluster" mean the same thing. Builders in the United States tend to say baluster, while spindle is more common in the UK and Canada. The spindles sit in the run between two fixed posts, with open gaps around and between them.
Two problems come up on a real job. First: given a set number of spindles, how wide is each gap? Second: given a target gap width, how many spindles are needed? Both questions use the same three numbers: the length of the railing section, the width of one spindle, and either the spindle count or the target gap.
The 4-inch rule
Most North American building codes limit railing gaps so that a 4-inch (10 cm) sphere cannot pass through. The rule appears in the International Residential Code (IRC), section R312.1.3, and in most local codes based on it. It exists to stop young children from getting their heads caught between rails. Building inspectors check it with a physical 4-inch ball.
The 4-inch limit applies to the clear opening, meaning the actual gap a sphere could pass through. It is not measured from the center of one spindle to the center of the next.
How to calculate spindle spacing
A spindle sits inside the run between two posts. If N spindles are installed, they create N + 1 open gaps: one gap next to each post, plus the gaps between spindles. That detail changes the formula, so it is worth stating clearly before doing any math.
Spacing formula
Given the total length between posts, the width of each spindle, and the number of spindles, the clear gap between them is:
- Total length: the distance from the inside face of one post to the inside face of the other.
- Spindle width: the actual measured width of one spindle, not its nominal size.
- Number of spindles: how many spindles are being installed.
Spindle count formula
Given the total length, the spindle width, and the maximum gap allowed, the minimum number of spindles needed is:
The result is always rounded up to the next whole spindle. Rounding down would remove a spindle and stretch every remaining gap past the target, which could push the railing over the 4-inch legal maximum.
Worked examples
Example: finding the spacing
A railing section runs 100 inches between two posts. It will use 20 spindles, each 2 inches wide.
The clear gap works out to about 2.86 inches, comfortably under the 4-inch maximum.
Example: finding the spindle count
The same 100-inch section will use 2-inch-wide spindles, and the gap must stay at or under 3.5 inches.
Eighteen spindles are needed. Checking the actual gap that produces confirms it meets the target:
How to measure a railing
Measure the total length from the inside face of one post to the inside face of the other, not center to center. Measure an actual spindle rather than trusting the size printed on a label. A piece of lumber sold as "2×2" is usually 1.5 by 1.5 inches after milling, not a true 2 inches.
In the calculator's imperial mode, total length is entered in feet while spindle width and spacing are entered in inches. In metric mode, total length is entered in centimeters while spindle width and spacing are entered in millimeters. Both modes solve the same two formulas above.
Building code basics
Requirements vary by location, but most US jurisdictions base their rules on the IRC. For residential guards, the IRC generally requires:
- No opening large enough to pass a 4-inch sphere.
- A minimum guard height of 36 inches, measured from the walking surface.
- A top rail able to resist a 200-pound force applied at any point.
Commercial buildings usually follow the International Building Code, which raises the minimum guard height to 42 inches while keeping the same 4-inch opening limit. Local amendments can add stricter rules, especially for pool enclosures, so check with the local building department before finalizing a design.
Frequently asked questions
What is the maximum spacing allowed between deck spindles?
4 inches, or about 10 cm, under the IRC and most codes based on it. The limit is measured as the widest sphere that can pass through an opening, not center to center between spindles.
Why does the spindle-count formula round up instead of down?
Rounding down would remove one spindle and make every remaining gap wider than the target. A 3.5-inch target could end up with a gap over the 4-inch legal limit. Rounding up keeps every gap at or under the target width.
Why does the spacing formula divide by (spindles + 1) instead of (spindles − 1)?
Because the gap next to each post counts as an opening too. With N spindles set between two posts, there are N − 1 gaps between the spindles themselves, plus one more gap beside each post, for N + 1 gaps in total.
Is there a minimum spacing allowed between spindles?
Codes set a maximum, not a minimum. Very narrow gaps make it hard to drive fasteners and let debris collect, so many builders avoid going much below about 1.5 inches. That figure is a practical habit, not a legal requirement.
Does every gap have to be exactly the same width?
No. Codes only require that no single gap exceed the maximum. Some railings use slightly wider spacing near the posts for appearance, as long as every opening still stays under the limit.
Does the 4-inch rule apply to stairs and fences the same way?
Stair guards generally follow the same 4-inch rule, measured perpendicular to the sloped rail. Fence rules vary more by local ordinance. Pool-enclosure fences are usually stricter, often limited to around 4 inches vertically with smaller horizontal openings to discourage climbing.
References
- International Code Council, International Residential Code 2021, Section R312.1.3, "Opening limitations."
- U.S. Consumer Product Safety Commission, safety barrier guidelines for residential pools.