Baluster Spacing Calculator
US building code (IRC Section R312/R321, the “4-inch sphere rule”) requires that guardrail openings not allow a 4-inch diameter sphere to pass through, so this calculator determines how many balusters you need — and the resulting actual gap width — to keep every opening at or under that 4-inch maximum.
Quick Answer
US building code (IRC Section R312/R321, the “4-inch sphere rule”) requires that guardrail openings not allow a 4-inch diameter sphere to pass through, so this calculator determines how many balusters you need — and the resulting actual gap width — to keep every opening at or under that 4-inch maximum.
Baluster Spacing Calculator
Enter your values below for an instant result, then see the formula, worked example, and common mistakes.
Enter your railing length and baluster width, then calculate.
How to Use This Calculator
Measure the total horizontal opening (post to post) in inches that needs balusters.
Common baluster stock is 1.5 in (a finished 2×2) or 2 in square, though sizes vary — use your actual baluster’s width.
The IRC’s 4-inch sphere rule is the default and most common standard for residential guardrails (a sphere 4 inches in diameter must not be able to pass through any opening). Note that stair guards have a special exception allowing up to 4 3/8 in on the open side of stair stringers.
The calculator distributes balusters evenly across your opening and shows the resulting actual gap — if it’s at or under your maximum, the layout passes; if not, add more balusters until it does.
Formula
Balusters Needed = ROUND UP[(Opening Length / (Baluster Width + Max Gap))] – 1. This finds the minimum number of balusters, evenly spaced, so that no resulting gap exceeds the maximum allowed. Actual Gap = (Opening Length – Total Baluster Width) / Number of Gaps, where Number of Gaps = Number of Balusters + 1 (since balusters divide the opening into one more segment than there are balusters).
Reference Table: IRC Guardrail and Baluster Spacing Requirements
| Location | Maximum Opening | Rule |
|---|---|---|
| Guardrails (decks, balconies, landings) | 4 inches | 4-inch sphere cannot pass through |
| Open side of stair stringers (between balusters) | 4 3/8 inches | Special stair exception |
| Triangular opening at stair guard bottom (tread/riser/rail) | 6 inches | 6-inch sphere cannot pass through |
| Minimum guard height (residential) | 36 inches | Measured from walking surface |
Common Mistakes to Avoid
- Assuming baluster spacing is measured center-to-center rather than as the clear gap between balusters — code compliance is based on the open gap (clear space), not the on-center spacing, so you must subtract baluster width from the pitch to check compliance.
- Using the standard 4-inch guard rule for stair baluster spacing on the open side of stairs, where code actually permits a slightly larger 4 3/8-inch gap due to the geometry of stair stringers.
- Spacing balusters unevenly, e.g. fitting as many full-pitch gaps as possible and leaving one larger leftover gap at the end — code requires every single gap along the railing to meet the maximum, so spacing must be evenly distributed across the full opening.
- Forgetting to check local amendments — while the IRC 4-inch sphere rule is the baseline adopted by most US jurisdictions, always confirm with your local building department, since some areas adopt stricter or modified rules.
When the Estimate May Be Wrong
This calculator applies the standard IRC 4-inch sphere rule baseline. Always verify current requirements with your local building department before construction, since code editions and local amendments vary by jurisdiction, and guardrail height, structural load requirements, and specific baluster attachment methods are separate code requirements not covered by this spacing calculation alone.
FAQs
What is the 4-inch sphere rule for balusters?
The 4-inch sphere rule, from IRC Section R312/R321, requires that no opening in a guardrail allow a 4-inch diameter sphere to pass through, which prevents small children from slipping through or getting their heads trapped between balusters.
Is baluster spacing measured between balusters or center to center?
Baluster spacing for code compliance is measured as the clear gap (open space) between balusters, not center-to-center — the baluster’s own width must be subtracted from the total pitch to determine the actual open gap.
Are stair baluster gaps allowed to be different from deck railing gaps?
Yes — on the open side of stairs, code permits a slightly larger opening of 4 3/8 inches between balusters (versus the standard 4-inch rule for guards), due to the specific geometry of stair construction.
How tall does a guardrail need to be by code?
Under the IRC, residential guardrails typically must be at least 36 inches tall as measured from the walking surface, though some code editions and stair-specific rules may differ — always confirm with your local building department.
Sources and Methodology
The 4-inch sphere rule and related guardrail/stair spacing requirements sourced from the 2024 International Residential Code (IRC) Section R312/R321 (guards), cross-referenced against InterNACHI’s published guard code-requirement summary and industry railing-code guides (Viewrail, Senmit, JLC Online) documenting the 4-inch sphere standard, the 4 3/8-inch stair-baluster exception, the 6-inch triangular-opening rule at stair guard bottoms, and the 36-inch minimum residential guard height.