Spindle Spacing Calculator
Find how many spindles your railing needs with even, code-compliant spacing. Enter the railing length between posts, the number of sections, the spindle width, and the maximum gap, and get the spindle count, the exact gap and on-center spacing, a pass/fail check against the US 4-inch rule, and estimated cost — with spacing options, a by-width table, and a downloadable PDF.
| Spindles | Gap | On-center | Code |
|---|---|---|---|
| Enter a railing to compare | |||
| Width | Spindles | Gap | Total |
|---|---|---|---|
| Enter a railing to compare | |||
How to use the spindle spacing calculator
Enter the clear railing length between posts, the number of sections, the spindle width and the maximum gap, and get the spindle count, the exact gap and on-center spacing, a pass/fail check against the US 4-inch rule and estimated cost — with spacing options, a by-width table and a downloadable PDF.
Measure the opening
The clear distance between newel posts in inches, and how many identical sections you’re filling.
Set spindle width
Pick ¾″, 1½″ or 2″, or type a custom width to match your balusters.
Confirm the max gap
Leave it at 4″ for US code, or lower it for a tighter, safer look.
Read the result & save a PDF
See the count, gap, on-center and a pass/fail check, compare options, and download it.
How spindle spacing is calculated
Even spacing is a balance: the spindles and the gaps share the opening, and there’s always one more gap than spindles. The goal is the smallest count that keeps every gap under the code limit.
Worked example — 96″ opening, 1½″ spindles, 4″ max gap
Try 23 spindles: gap = (96 − 23 × 1.5) ÷ (23 + 1)
= (96 − 34.5) ÷ 24 = 61.5 ÷ 24 = 2.56 in
On-center: 2.56 + 1.5 = 4.06 in
Code check: 2.56 in < 4 in → pass
A 96-inch opening with 1½-inch spindles takes 23 spindles, leaving even 2.56-inch gaps — comfortably under the 4-inch limit, at about 4.06 inches on-center.
Spindle spacing reference charts
The numbers that come up most — spindle count by opening length, how spindle width changes the count, and the code rules that govern the gaps.
| Opening | Spindles | Gap | On-center |
|---|---|---|---|
| 36 in | 8 | 2.67 in | 4.17 in |
| 48 in | 11 | 2.63 in | 4.13 in |
| 60 in | 14 | 2.60 in | 4.10 in |
| 72 in | 17 | 2.58 in | 4.08 in |
| 96 in | 23 | 2.56 in | 4.06 in |
The gap settles near 2.6 inches because the layout always rounds up to the next whole spindle to stay under 4 inches. Longer openings simply repeat the same even rhythm.
| Spindle width | Spindles | Gap | On-center |
|---|---|---|---|
| 3/4 in (metal) | 21 | 3.64 in | 4.39 in |
| 1 in | 22 | 3.30 in | 4.30 in |
| 1-1/2 in (2×2) | 23 | 2.56 in | 4.06 in |
| 2 in | 24 | 1.92 in | 3.92 in |
| 2-1/2 in | 25 | 1.33 in | 3.83 in |
Wider spindles fill more of the opening, so the gap shrinks and you need a few more to keep every space even. Thin metal balusters use the fewest pieces.
| Rule | Limit | Where it applies |
|---|---|---|
| Spindle gap (4″ sphere) | Under 4 in | Guards on decks, balconies and level rails |
| Stair baluster gap | Under 4-3/8 in | Open guards along a stairway |
| Stair triangle (6″ sphere) | Under 6 in | Tread, riser and bottom rail opening |
| Guard height | 36 in typical | Deck and balcony guards (varies by code) |
The calculator checks the 4-inch spindle-gap rule. The stair triangle and guard-height rules are separate — always confirm the exact figures with your local building department.
The spindle count is a balance of three things: the opening between posts is the space to fill, the width of each spindle eats into it, and the gap must stay under 4 inches — together they set the count.
- One more gap than spindles — the gaps sit on both ends and between every pair.
- Round up to pass — add one more spindle whenever the gap would reach 4 inches.
- Mark on-center — lay out the gap plus one width repeatedly, rather than measuring each gap.
Everything the calculator works out
One set of inputs gives you the spindle count per section and total, the exact gap and on-center spacing, a pass/fail code check and the cost — plus spacing options and a by-width comparison, and a report to save.
The figures behind every railing
Built for anyone filling a railing with spindles
A deck guard, a porch rail, an interior stair, a balcony — the even-spacing math and the 4-inch rule are the same, and getting the count and gap right before you cut means an even railing that passes inspection.
Building a deck or porch rail and wanting an even spindle layout that passes the inspector’s 4-inch sphere.
- Measure between posts
- Keep gaps under 4″
- Mark on-center to install
Spacing several railing sections at once and ordering the right spindle count for the whole deck.
- Add each run as a section
- Compare widths for cost
- Save the PDF to the job
Laying out balusters on a stair or balcony rail where even spacing and the code gaps both have to be right.
- Same 4″ gap on the rake
- Check the 6″ stair triangle
- Confirm with local code
7 tips for even, code-legal spindle spacing
The things that throw off a railing layout or fail an inspection — and the checks that keep every gap even and legal.
Spindle spacing FAQ
The spacing, code and layout questions people ask most when filling a deck, porch or stair railing with spindles.
Close enough that a 4-inch sphere can’t pass between them — that’s the US building-code rule (IRC R312.1.3), so every gap must be less than 4 inches. In practice spindles are spaced evenly at just under that, often around 3.5 to 4 inches apart.
To find the count, divide the opening so each gap stays under 4 inches: gap = (railing length − spindles × spindle width) ÷ (spindles + 1). The calculator picks the smallest number of spindles that keeps every gap legal and even.
The 4-inch rule says a 4-inch sphere must not be able to pass through any opening in a guard, including the gaps between spindles. It exists to stop a small child’s head or body from fitting through, and it’s set by the International Residential Code (IRC R312.1.3).
Because it’s a sphere test, the clear gap between spindles has to be under 4 inches — exactly 4 is too much. The calculator flags any spacing of 4 inches or more as failing and shows you how many spindles bring it back under.
Take the clear opening between posts, then find the smallest spindle count where the even gap is under 4 inches. With n spindles the gap is (length − n × width) ÷ (n + 1), and there’s always one more gap than spindles.
For a 96-inch opening with 1.5-inch spindles, you need about 23 spindles to keep gaps just under 4 inches. Multiply by the number of identical sections for the total. The calculator does this and rounds to a whole, even layout.
On-center spacing is the distance from the center of one spindle to the center of the next — the gap plus one spindle width. It’s the measurement you actually mark out when installing, because it repeats evenly down the rail.
So if the gap is 3.75 inches and the spindle is 1.5 inches wide, the on-center spacing is 5.25 inches. Marking on-center is faster and more accurate than measuring each gap, and the calculator gives you both numbers.
Measure the clear opening between the newel posts — the space the spindles actually fill — not post-to-post or the full deck length. The posts themselves aren’t part of the spindle run.
If you have several equal openings, enter one length and set the number of sections; the calculator spaces each opening the same and totals the spindles. For unequal runs, do each one separately so every section gets even, code-legal gaps.
Yes. Wider spindles take up more of the opening, so each gap is wider for the same count — which means you need more spindles to keep every gap under 4 inches. Thin metal balusters need fewer; chunky 2-inch wood spindles need more.
The by-width table compares common widths side by side for your railing, so you can see how switching from a ¾-inch baluster to a 1.5-inch spindle changes the count and the gap before you buy.
No — the rule is that a 4-inch sphere must not pass, so the opening has to be less than 4 inches, not equal to it. A gap of exactly 4 inches would let the sphere through and fails the check.
The calculator treats 4 inches or more as failing and nudges you to add a spindle or lower the maximum gap. Many builders aim a little under 4 inches to leave a safety margin and allow for small variations in installation.
The 4-inch gap rule between spindles applies to stair guards the same way it does on a level deck, so the even-spacing math is identical along the rake of the stairs.
The one extra rule is at the bottom: the triangular opening formed by the tread, riser and bottom rail on open stairs allows a slightly larger 6-inch sphere. That’s a separate check from the spindle gaps — confirm it on its own, and verify both with your local building code.
Estimate Only — Verify With Your Local Code: This calculator spaces spindles evenly so every gap stays under 4 inches, matching the US IRC guard rule (R312.1.3) that a 4-inch sphere must not pass through. It uses gap = (opening − spindles × width) ÷ (spindles + 1) and assumes a single clear opening between posts with equal end gaps. It does not check guard height, post spacing, structural attachment, the 4-3/8-inch stair-baluster rule, or the 6-inch stair-triangle rule — confirm those separately. Codes and amendments vary by jurisdiction. For reference and estimating only; verify spindle spacing, guard height and all railing requirements with your local building department before building.


