By Zencalcy Editorial TeamLast reviewed About us
Most railing layouts fail at the ends: the spindles are evenly spaced but the last gap is different. The fix is to solve both count and gap at once. This calculator finds the smallest count that keeps every gap under your limit, then reports the single gap that divides the run evenly.
Even spindle spacing with equal end gaps.
N = ⌈(run − max gap) ÷ (width + max gap)⌉ gap = (run − N × width) ÷ (N + 1)
The count must leave a gap at both ends, so there are N + 1 gaps for N spindles. Solving for equality guarantees identical gaps. IRC guards require a gap under 4 inches at every point.
| Symbol | Meaning |
|---|---|
| run | Clear distance between posts. |
| width | Spindle face width. |
| N | Number of spindles. |
| gap | Equal clear space, ends included. |
N = ⌈(120 − 4) ÷ 5.5⌉ = 22 spindles, so the gap is (120 − 33) ÷ 23 = 3.78 inches everywhere.
Continue with the Gravel Calculator, Sand Calculator, Rock Calculator, or the River Rock Calculator — or browse more materials & quantities and all construction calculators.
Dividing gives uneven ends. Solving for the exact gap keeps both end gaps the same as the rest, which is what reads as professional.
Results use standard construction estimating arithmetic: volumes from measured area and depth, unit weights from published material densities, and code-referenced spans or clearances where the page names a code. Quantities are rounded up to whole saleable units and include the stated waste allowance. These tools are planning aids, not structural design, and do not replace a licensed engineer, a local code check, or a contractor's site measurement.
Reference material used to build and check this calculator:
Last reviewed: September 2026. See how we build and check every tool on the about page.
Estimate decking boards by length, screws, hidden fasteners and waste
Calculate concrete blocks needed for wall construction
Calculate full deck materials list including boards, joists, beams, posts, and cost estimates
Price hardwood the way the lumber yard does — by board footage.
Turn measured dimensions into the cubic yards concrete and gravel are sold in.
How many gallons it takes to cover an area at a given depth.
Content updated: September 2026