Enter your clear span length, spindle diameter, and maximum code-allowed gap to get the minimum number of spindles needed, the actual clear gap between them, and the center-to-center spacing for marking layout points. The calculator divides your span into equal openings that stay at or under your code’s gap limit, then reports exactly how far apart to space each baluster so your railing passes inspection and keeps the design even.

Stair Spindle Spacing Calculator: Code-Compliant Gaps

Find the minimum number of stair spindles, the actual gap between them, and the center-to-center spacing needed to meet your building code's maximum gap rule.

Planning Code-Compliant Spindle Layouts

This calculator figures out how many stair or deck spindles you need across a given span so that no gap between them exceeds your local building code limit. It is built for homeowners planning a railing rebuild, carpenters pricing out material, and contractors double-checking a layout before drilling holes. The calculator works for both level stair runs and straight deck or landing railings.

Results are estimates based on evenly dividing your span. Real-world results depend on your exact measuring accuracy and how your posts and stringer are actually built, so treat the output as a solid starting layout rather than a final stamped drawing. If you also need to work out stringer length, rise, and run for the stairs themselves, a stair stringer length calculator handles that separate part of the project.

Using the Spindle Spacing Calculator Step by Step

Using the Spindle Spacing Calculator Step by Step
Image source: decks.com
  1. Measure the clear span, the exact distance between the inside faces of your two end posts, and enter it in inches or millimeters.
  2. Enter the width or diameter of the spindle you plan to use, measured at its widest face.
  3. Enter the maximum gap allowed by your local building code, commonly 4 inches in the US and Canada or around 100 mm elsewhere.
  4. Keep all three inputs in the same unit system, either all inches or all millimeters, so the math stays accurate.
  5. Review the four results: minimum spindle count, actual clear gap, center-to-center spacing, and code compliance margin, then use the center-to-center number to mark your layout.

What Each Measurement Means for Your Railing

What Each Measurement Means for Your Railing
Image source: carpentry-tips-and-tricks.com

Clear Span Length is the open distance between the inside faces of the two end posts where spindles will sit, measured in inches or millimeters. Do not measure from post center to post center; measure the actual open gap the spindles must fill.

Spindle (Baluster) Width or Diameter is the widest face of the spindle you plan to install. For round balusters, use the outside diameter. For square or rectangular balusters, use the widest flat face, since that dimension takes up the most room along the span.

Maximum Allowed Gap per Code is the largest clear opening your local code permits between spindles, most often 4 inches in the United States and Canada. Some regions and older codes use different limits, so confirm the correct number with your local building department before finalizing a design.

How Spindle Count and Gap Size Are Calculated

The calculator first finds the minimum whole number of spindles, then uses that count to work out the real gap and spacing.

Minimum Spindles Required equals the ceiling of (span_length minus max_gap) divided by (spindle_diameter plus max_gap). This accounts for the fact that adding one spindle also adds one more gap, so the formula solves for the smallest integer count that keeps every resulting gap at or under the code maximum.

Actual Clear Gap equals (span_length minus the total width used by all spindles) divided by (spindle count plus one), because n spindles create n+1 gaps: one at each end against the posts and one between each pair of spindles.

Center-to-Center Spacing equals the actual clear gap plus one spindle_diameter. This is the number you actually mark and measure to when laying out drill points, since it runs from the center of one spindle to the center of the next.

Code Compliance Margin equals max_gap minus the actual clear gap, showing how much buffer you have below the legal limit. All formulas assume span_length, spindle_diameter, and max_gap are entered in the same unit, either all inches or all millimeters.

Four Real Stair and Deck Railing Scenarios

Example 1: Standard interior stair rail.

  • Given: span_length = 60 in, spindle_diameter = 1.25 in, max_gap = 4 in
  • Formula: ceil((span – max_gap) / (diameter + max_gap))
  • Substitution: ceil((60 – 4) / (1.25 + 4)) = ceil(56 / 5.25)
  • Calculation: ceil(10.667) = 11 spindles; gap = (60 – 13.75) / 12 = 3.854 in; center-to-center = 5.104 in
  • Final result: 11 spindles, 3.854 in gap, 5.104 in on-center spacing, 0.146 in margin

Example 2: Metric deck landing rail.

  • Given: span_length = 1000 mm, spindle_diameter = 32 mm, max_gap = 100 mm
  • Formula: ceil((span – max_gap) / (diameter + max_gap))
  • Substitution: ceil((1000 – 100) / (32 + 100)) = ceil(900 / 132)
  • Calculation: ceil(6.818) = 7 spindles; gap = (1000 – 224) / 8 = 97 mm; center-to-center = 129 mm
  • Final result: 7 spindles, 97 mm gap, 129 mm on-center spacing, 3 mm margin

Example 3: Narrow basement stair opening.

  • Given: span_length = 42 in, spindle_diameter = 1.5 in, max_gap = 4 in
  • Formula: ceil((span – max_gap) / (diameter + max_gap))
  • Substitution: ceil((42 – 4) / (1.5 + 4)) = ceil(38 / 5.5)
  • Calculation: ceil(6.909) = 7 spindles; gap = (42 – 10.5) / 8 = 3.938 in; center-to-center = 5.438 in
  • Final result: 7 spindles, 3.938 in gap, 5.438 in on-center spacing, 0.063 in margin

Example 4: Long deck railing run.

  • Given: span_length = 120 in, spindle_diameter = 2 in, max_gap = 4 in
  • Formula: ceil((span – max_gap) / (diameter + max_gap))
  • Substitution: ceil((120 – 4) / (2 + 4)) = ceil(116 / 6)
  • Calculation: ceil(19.333) = 20 spindles; gap = (120 – 40) / 21 = 3.810 in; center-to-center = 5.810 in
  • Final result: 20 spindles, 3.810 in gap, 5.810 in on-center spacing, 0.190 in margin

Quick Spindle Counts for Common Span Lengths

This table shows minimum spindle counts and resulting spacing for common stair rail spans, assuming a 1.25 in spindle diameter and a 4 in maximum code gap. Recalculate with your own numbers if your spindle size or local code differs.

Clear Span (in)Min. SpindlesActual Gap (in)Center-to-Center (in)
3673.4064.656
4893.6754.925
60113.8545.104
72133.9825.232
96183.8685.118
120233.8025.052

Reading Your Spindle Count and Spacing Results

Minimum Spindles Required is the primary result and the number you should order, rounded up to a whole spindle since you cannot install a fraction of one. Actual Clear Gap and Center-to-Center Spacing are the two numbers you use on the tape measure and pencil marks during layout; center-to-center is usually easier to mark because it runs point to point instead of edge to edge. Code Compliance Margin shows how much room you have before hitting the legal maximum, so a small margin near zero means you should measure carefully during installation, while a larger margin gives more tolerance for minor errors.

What Changes Your Spindle Spacing Numbers

Span length directly changes how many spindles fit; the calculator recalculates automatically whenever you adjust it. Spindle diameter matters because wider balusters use up more of the span, which usually lowers spindle count but can shrink the compliance margin. Maximum gap comes from your local code and is not something the calculator can verify for you; you must confirm the correct figure for your jurisdiction. Rounding is handled automatically since spindle count is always rounded up to the next whole number, which is why the actual gap almost always comes in slightly under the stated maximum rather than exactly matching it. The calculator does not account for angled stair rake, curved rails, or uneven post spacing, all of which are covered in the limitations below.

Layout Errors That Fail Inspection

  • Measuring post-to-post instead of clear span: use the open distance between the inside faces of the posts, not the outside centerline distance.
  • Mixing inches and millimeters: keep every input in the same unit system or the results will be meaningless.
  • Using the wrong code gap: confirm your local maximum gap with your building department instead of assuming 4 inches applies everywhere.
  • Measuring spindle width at the wrong face: for square or rectangular balusters, always use the widest face, not the narrowest.
  • Rounding spindle count down: always round up to the next whole spindle, since rounding down can push the gap over the legal limit.
  • Ignoring the compliance margin: a margin near zero leaves little room for measuring error during actual installation.
  • Assuming stairs and level rails calculate the same way: angled stair runs need spacing measured along the sloped rail line, not the horizontal projection.

Where This Calculator Stops and a Professional Starts

This calculator handles straight, evenly divided spans and assumes equal gaps on both ends against the flanking posts. It does not model curved rails, mitered corners, irregular post placement, or decorative spindle groupings such as double balusters at newel posts. Building codes vary by country, state, and even by local amendment, so the 4 inch figure common in the US and Canada may not match your jurisdiction. Always confirm your exact maximum gap requirement, post spacing rules, and any additional structural requirements with your local building department or a qualified contractor before ordering materials or beginning installation. This tool provides planning estimates only and is not a substitute for an inspected, code-approved design.

Square, Rectangular, and Round Spindle Measurements

Round spindles are simple to measure since the outside diameter is a single consistent number. Square and rectangular balusters need the widest flat face entered as the diameter value, because that is the dimension that actually consumes space along the span. Using the narrow face instead of the wide face will understate how much room each spindle takes and can produce a spacing plan that looks compliant on paper but is too tight in reality.

Spacing on Sloped Stairs Versus Level Rails

On a sloped stair run, the clear span should be measured along the angled rail line rather than the flat horizontal distance, since that is the actual path the spindles follow. The gap and spacing formulas stay the same once you have the correct sloped span length. Code inspectors typically check the gap measured perpendicular to the rail, so keep your span input consistent with how the inspector will measure on site.

Applying the Same Method to Decks and Other Projects

The evenly-divided spacing method used here applies to any project where uniform gaps matter, not just stair rails. Deck guard rails, porch railings, and similar evenly spaced vertical elements follow the same logic. If your project also involves sizing the support posts that carry a deck beam, a deck post spacing calculator can help with that separate structural layout. For fence-style vertical spacing with a different gap target, a fence picket spacing calculator uses the same even-division approach.

Stair Spindle Spacing Questions Answered

What is the standard maximum gap allowed between stair spindles?

In the United States and Canada, most residential codes cap the gap at 4 inches so a 4 inch sphere cannot pass through. Some regions use metric limits closer to 100 mm. Always confirm the exact figure with your local building department, since amendments and older codes can differ.

How do I measure the clear span for spindle spacing?

Measure the open horizontal distance between the inside faces of the two end posts where the spindles will be installed. Do not measure from the outside faces or from post center to post center, since that would overstate the space actually available for spindles and gaps.

Can this calculator be used for deck railings as well as stairs?

Yes. The same even-gap math applies to deck guard rails, porch rails, and landing rails, as long as the run is straight. Enter the clear span between your deck posts along with your spindle size and local maximum gap to get the same spindle count and spacing results.

What happens if my calculated spacing doesn't divide evenly?

The calculator already accounts for this by rounding the spindle count up to the next whole number, then dividing the remaining space evenly across all gaps. The actual gap result will always be a decimal value that is at or below your entered maximum, which is normal and expected.

Do square or rectangular balusters need a different calculation than round ones?

The formula itself is the same, but you should enter the widest flat face of a square or rectangular baluster as the diameter value. Using the narrower face would understate the space the spindle occupies and could produce gaps that exceed code once installed.

How does spindle spacing change on a sloped staircase versus a level landing?

On a sloped run, measure the clear span along the angled rail line rather than the flat horizontal projection, since that is the actual distance the spindles will occupy. Once you enter the correct sloped span, the gap and spacing formulas work exactly the same as on a level rail.

What building codes should I check before finalizing spindle spacing?

Check your local residential or building code section covering guards and handrails, since maximum gap requirements can vary by state, province, or country. Local amendments sometimes tighten or adjust the common 4 inch or 100 mm figure, so confirm with your building department before ordering materials.

How many spindles do I need for a typical staircase?

It depends on your span, spindle width, and code limit, but a common 60 inch run with 1.25 inch spindles and a 4 inch maximum gap needs about 11 spindles. Enter your own measurements into the calculator for an exact count specific to your project.

Locking In Your Spindle Layout Before You Drill

Getting spindle spacing right means balancing your exact span, spindle size, and local code gap limit into one evenly divided layout. This calculator gives you the minimum spindle count, the real gap, and the center-to-center marks you need to lay out drill points with confidence. Always confirm your local maximum gap requirement and, for anything structural or code-critical, have a qualified contractor or inspector review your final plan.

Brian Haris

About

Brian Haris is the Owner and Editor of Calculator Factory. He manages the website’s calculator research, content review, testing, and ongoing improvements. His goal is to make practical calculations easier to understand by providing clearly explained formulas, realistic examples, and simple online tools. Readers can report a possible error or suggest an improvement through the Calculator Factory contact page.

Leave a Reply

Your email address will not be published. Required fields are marked *