Deck Railing Spindle Spacing Calculator
Enter the space between posts and the spindle width and get the fewest spindles that keep every gap under the IRC's 4-inch sphere, with exact spacing and positions.
Inside face to inside face.
At its narrowest point for turned spindles.
Leave blank for the fewest that meet the limit.
The result updates as you type.
Baluster spacing
13 balusters, 3.643 in gaps
5.143 in on centre · under the 4 in limit · 13 for 1 section
| Fewest balusters with every gap under the limit | 13 |
| Equal gap (post to baluster and between) | 3.6429 in |
| On-centre spacing | 5.1429 in |
Centre of each baluster, measured from the left post
1: 4.393 in 2: 9.536 in 3: 14.679 in (1' 2-11/16") 4: 19.821 in (1' 7-13/16") 5: 24.964 in (2' 0-15/16") 6: 30.107 in (2' 6-1/8") 7: 35.25 in (2' 11-1/4") 8: 40.393 in (3' 4-3/8") 9: 45.536 in (3' 9-9/16") 10: 50.679 in (4' 2-11/16") 11: 55.821 in (4' 7-13/16") 12: 60.964 in (5' 0-15/16") 13: 66.107 in (5' 6-1/8")
What this page cannot tell you
Whether your guard is required, how tall it must be, or whether the posts and rails are strong enough — those are separate code sections. The sphere test applies at the largest opening, which for turned spindles is where they are slimmest — that is why the width asked for is the narrowest point. Local codes can differ from the IRC; check yours.
How to space deck railing spindles
- Measure between posts. The clear distance from one post face to the other, in inches.
- Enter the spindle width. 1.5 in for a 2×2, or the slimmest point of a turned or metal baluster.
- Choose the limit. 4 in for deck and floor guards; 4-3/8 in on the open side of stairs.
- Read the count and gap. The fewest spindles that keep every gap under the limit, spaced equally.
- Mark the centres. Use the list of centre positions measured from the left post.
10 situations where a spindle spacing calculator helps
Passing a deck inspection
A gap even slightly over 4 in fails the sphere test; get a count that keeps every gap under it.
Ordering balusters
Multiply by the number of identical sections for a total.
Even spacing without a spacer block guess
Get the exact gap to cut a spacer to.
Stair railings
Use the 4-3/8 in limit for the open side of stairs.
Metal balusters
Enter the bar width; the narrow profile changes the count.
Turned spindles
Enter the slimmest point, where the opening is widest.
Replacing a few balusters
Check whether old spacing still meets today's limit.
Short and long sections
Each post-to-post run gets its own equal spacing.
Interior stair and balcony guards
The same 4 in rule applies to required guards indoors.
Tighter design spacing
Use a custom limit if your plans call for a smaller gap.
The rule and the arithmetic
2021 IRC Section R312.1.3, Opening limitations: 'Required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter.' Exception 2 allows 4-3/8 in on the open side of stairs, and exception 1 a 6 in sphere for the triangle formed by the riser, tread and bottom rail. Read on the ICC's public code site.
With n spindles of width w between posts a clear distance L apart there are n + 1 equal gaps, each (L − n·w) ÷ (n + 1). The page finds the smallest n that makes the gap strictly less than the limit — a gap of exactly 4 in would let a 4 in sphere through — then spaces them equally.
Limits: the page checks spacing only. Guard height, post and rail strength, the bottom-rail gap and the stair triangle are separate requirements. Local codes can amend the IRC, so check with your building department. Everything runs in your browser.
Sources
- 2021 International Residential Code — Chapter 3, R312.1.3 Opening limitations — 4 in sphere; 4-3/8 in on open side of stairs
Frequently asked questions
What is the 4 inch rule for deck railings?
IRC R312.1.3 says required guards must not have openings that let a 4 in sphere pass, from the walking surface up to the required guard height.
How many spindles do I need for a 6 ft section?
For 72 in between posts with 1.5 in spindles, 13 spindles give 3.75 in gaps — the fewest that stay under 4 in.
What gap should I use between spindles?
Anything under the limit. The page uses equal gaps just under it with the fewest spindles; choose more spindles for tighter gaps.
Is it different on stairs?
Yes: the IRC allows openings up to a 4-3/8 in sphere on the open side of stairs, and 6 in for the riser-tread-bottom rail triangle.
Do I measure at the spindle's widest or narrowest point?
The opening is largest where the spindle is slimmest, so enter the narrowest width.
Does my town use the IRC?
Most US jurisdictions adopt the IRC, sometimes amended. Your building department can tell you which edition and changes apply.
Related tools
Deck Joist Span Calculator
Pick the lumber species, joist size, spacing and load and get the maximum deck joist span from IRC Table R507.6, plus the cantilever for your back span and a check of your own span.
IRC Table R507.6 Maximum Deck Joist Spans (2021 and 2024, identical); AWC DCA 6-2015 Table 2
Lumber Cost Calculator
Enter a cut list and the prices you were quoted — per piece, linear foot, board foot or MBF — and get the board feet, cost per board foot and total with waste and tax.
NIST Handbook 130 (2026) board foot definition and Table 1 lumber sizes
Stair Stringer Calculator
Enter the total rise and tread depth and get the risers, riser height, total run, stringer length, angle and throat, checked against the American Wood Council's DCA 6 deck stair rules.
American Wood Council DCA 6 (2015 IRC): stair requirements, Figures 27–30
Deck Beam Span Chart
Pick the species, load, joist span and joist overhang and get the maximum deck beam span for every built-up beam size from IRC Table R507.5.
IRC 2024 Tables R507.5(1)–(4) Maximum Deck Beam Span
Roof Pitch Calculator
Enter the rise and run and get the pitch as x-in-12, the angle, the slope percentage and the rafter length — plus which roof coverings the IRC allows at that slope.
Geometry, and the 2021 International Residential Code, Chapter 9
Rebar Size Chart
Pick a bar size and get its diameter, cross-sectional area and weight per foot in US and metric units, from a state DOT's published reinforcement table.
Illinois DOT Standard 001001-02, Areas of Reinforcement Bars