Spindle Spacing Calculator

Spindle Spacing Calculator uses spindles = ceil((span−gap)/(width+gap)) to find required spindles, exact gap, O.C. spacing, first center mark, total solid width, and open-air space.

in
in
in
Required Spindles
13 Spindles
Calculated requirement for 72.00 in span.
Exact Gap Spacing
3.750 in
Total Gaps Created 14 Gaps
Gap Reduction 0.250 in under max
The exact open space between each individual spindle to ensure even distribution while remaining under the code limit.
On-Center (O.C.) Layout
5.250 in
Cumulative O.C. Span 63.00 in
Spindle Density 2.17 Spindles / ft
The measurement from the exact center of one spindle to the center of the next. Use the cumulative span to check your tape layout.
First Placement Mark
4.500 in to Center
To Inside Edge 3.750 in
To Exact Center 4.500 in
Measure from the inside edge of your post/wall to mark the position of your very first spindle.
Space Breakdown
19.50 in Solid Width
Total Solid Material 19.50 in
Total Open Air 52.50 in
The total material width of all spindles combined compared to the sum of the open gap space across the run.
Building Code Note
Most local building codes require gaps between spindles to be less than 4 inches to prevent a 4-inch sphere from passing through. This calculator enforces your maximum gap while ensuring perfectly even spacing.

When “Just Pick a Spacing Number” Backfires

A common way people size a railing is to pick a spacing they like — 4 inches, say — and divide the total rail length by it. The trouble is that real spans almost never divide evenly into whole spindles. You either end up needing a fraction of a spindle (which doesn’t exist on a shelf) or you round, and that rounding error gets dumped into one end gap, which is now noticeably wider than the rest. On an inspected deck or stair guard, that one oversized gap is exactly the kind of thing that fails a walk-through.

This calculator works the opposite direction. Instead of starting from a guessed spacing and hoping the leftover fits, it starts from two fixed facts you already know — your spindle’s actual width and the maximum gap you’re allowed (or willing) to leave — and solves for the smallest number of spindles that lets every gap across the entire run come out identical and at or under that limit.

The Formulas Behind Each Result

Every number on this page comes from the same chain of calculations, run in this order:

1. Required spindles:
Spindles = ROUND UP [ (Run Length − Max Gap) ÷ (Spindle Width + Max Gap) ]

2. Number of gaps:
Gaps = Spindles + 1
(one gap on each end of the run, plus one between every pair of spindles)

3. Total solid material:
Solid Width = Spindles × Spindle Width

4. Exact gap (the “Exact Gap Spacing” result):
Exact Gap = (Run Length − Solid Width) ÷ Gaps

5. Gap reduction (how much under your max the real gap ends up):
Gap Reduction = Max Gap − Exact Gap

6. On-center spacing:
On-Center = Exact Gap + Spindle Width

7. Cumulative on-center span (only if more than 1 spindle):
Cumulative O.C. = (Spindles − 1) × On-Center

8. Spindle density:
US mode: Density = Spindles ÷ (Run Length ÷ 12) → spindles per foot
Metric mode: Density = Spindles ÷ (Run Length ÷ 100) → spindles per meter

9. First placement mark:
To Edge = Exact Gap
To Center = Exact Gap + (Spindle Width ÷ 2)

If the run length is shorter than the max gap, step 1 can produce a negative number — the calculator floors that at zero spindles, and steps 4–9 are skipped (displayed as “–“).

Switching the unit toggle between US and metric converts every entered value at the standard 2.54 cm/in factor and re-runs steps 1–9 automatically.

The Catch Most People Miss: Your Real Gap Is Always a Little Tighter

Because step 1 always rounds up to a whole spindle, step 4’s exact gap almost never lands exactly on your entered maximum — it lands slightly under it. That’s the “Gap Reduction” value. It isn’t an error or wasted material; it’s the unavoidable result of needing whole spindles to fill a span that doesn’t divide perfectly. The extra spindle that rounding adds is precisely what brings the gap back under the limit.

On the jobsite, the most common mix-up isn’t with the math but with reading the output: drawings sometimes call out “spacing” as the gap between spindles (step 4) and sometimes as the on-center distance (step 6) — and these two numbers differ by exactly one spindle width. Grabbing the wrong one and marking it straight onto the rail is an easy way to come up a spindle short, or with one extra, at the far end.

The 4-inch default reflects the common residential guard-infill rule that a 4-inch sphere shouldn’t pass through the railing. Some jurisdictions tighten this for stairs or pool enclosures — check your local code and adjust the Max Gap field accordingly rather than relying on the default.

A Real Job: Filling a 6-Foot Rail Section

Closing in a 6-foot run between two deck posts — 72 inches inside-to-inside — with standard 2×2 balusters (1.5 inches actual) and a 4-inch max gap:

Step 1: (72 − 4) ÷ (1.5 + 4) = 68 ÷ 5.5 = 12.36 → rounds up to 13 spindles
Step 2: 13 + 1 = 14 gaps
Step 3: 13 × 1.5 = 19.5 in solid
Step 4: (72 − 19.5) ÷ 14 = 52.5 ÷ 14 = 3.75 in exact gap
Step 5: 4 − 3.75 = 0.25 in under max
Step 6: 3.75 + 1.5 = 5.25 in on-center
Step 7: (13 − 1) × 5.25 = 63 in cumulative span
Step 8: 13 ÷ (72 ÷ 12) = 2.17 spindles/ft
Step 9: edge = 3.75 in, center = 3.75 + 0.75 = 4.5 in to first center

Frequently Asked Questions

What happens if my run length is shorter than the max gap I enter?

Step 1 produces a negative value, which the calculator floors to zero spindles. The On-Center and First Placement Mark cards then show “–” since there’s nothing to space — the gap is already within your limit on its own, so no infill spindles are required.

Why is the “Exact Gap Spacing” result smaller than the max gap I typed in?

Because step 1 rounds up to a whole spindle, the leftover space from step 4 gets divided among slightly more gaps than the bare minimum, tightening each one below your stated maximum. The “Gap Reduction” line is just Max Gap minus this value.

Does the calculation include a gap against the posts at both ends?

Yes — step 2 always sets Gaps = Spindles + 1, meaning a gap is placed at each end of the span as well as between every spindle pair. If one end butts flush against a wall with no gap, calculate only the open portion of the span separately.

Why do my numbers shift slightly when I switch between inches and centimeters?

The toggle converts your current entries at 2.54 cm/in and rounds for display (1 decimal for the run, 2 for width/gap). Repeated back-and-forth switching can introduce small rounding drift — for final layout numbers, re-enter your original measurement in the unit you’re actually building in.

What does the “Spindle Density” number tell me?

It’s step 8: spindles per foot (US) or per meter (metric), based on the rounded-up spindle count from step 1. It’s mainly useful for comparing or pricing multiple rail sections of different lengths on the same job.