Spindle Spacing Calculator

Space railing spindles evenly or center them between two posts.

Even and centered options, sloped stair spacing, and metric or imperial lengths.

Updated October 24, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Loading calculator…

Introduction

A railing between two fixed ends has to hold a whole number of spindles, and what is left over after those spindles decides where every gap falls. This page takes the clear run, the width of one spindle and the widest gap you are allowed, and returns the count — plus the exact position of the first and last gap.

The question is a mark-out question, not just a shopping one. Two arrangements answer it. Evenly spaced spindles put the leftover into every gap, so one spindle width of setting out repeats from the first end to the last. Centered spindles keep the gaps between spindles at your limit and split what remains between the two end gaps, which leaves the run symmetrical.

Deck and porch railings are the usual case, and so is a stair rail measured along its sloped base. That second case is handled too: give the stair's rise and run, or its pitch, and the mark-out length measured along the slope comes back as well as the horizontal one — they are not the same number. If the deck underneath is still to be worked out, the decking calculator sizes the boards and the fasteners for it.

10 cm / 4 in

The maximum gap the limit starts at

Two arrangements

One repeated gap, or balanced ends

Sloped mark-out

Stair rail spacings follow the pitch

Quick start

1

Measure the clear run between the two ends

Inside face to inside face — from the post, wall or casing that stops the spindles at one end to whatever stops them at the other. If you measured outside to outside instead, take one post width off each end before the figure goes in.

2

Enter the width of one spindle

Measure across the face that forms the opening, at the height where the gap will be checked. On a turned spindle that is the widest part of the profile rather than the neck, because the widest part is what leaves the narrowest opening.

3

Set the gap you are allowed

The box opens with 10 cm (4 in). Replace it with the figure the code you build under enforces, even if it is different: anything above 4 in is flagged, so the difference never passes quietly.

4

Say whether it is a deck or a flight of stairs

A deck needs nothing more. For a stair rail, enter the riser rise and the effective tread run, or the pitch itself — the third of those follows from the other two.

5

Read the card for the arrangement you want

Evenly-spaced spindles returns one gap width used everywhere. Centered spindles returns the gap between spindles — your limit — together with the two equal end gaps. The spindle count is the same in both cards.

A 75 cm run with 2 cm spindles and the 10 cm default

unit\text{unit}==smax⁡+w\mathrm{s}_{\max} + \mathrm{w}==10+210 + 2==12 cm12\ \mathrm{cm}
n\mathrm{n}==⌈77/12⌉−1\left\lceil 77 / 12 \right\rceil - 1==7−17 - 1==6 spindles6\ \text{spindles}
seven\mathrm{s}_{\mathrm{even}}==77/7−277 / 7 - 2==9 cm9\ \mathrm{cm}\qquade\mathrm{e}==75−6×2−5×102\frac{75 - 6 \times 2 - 5 \times 10}{2}==6.5 cm6.5\ \mathrm{cm}

Six spindles, and two ways to set them. The evenly-spaced card gives a 9 cm gap at every position, both ends included. The centered card gives 10 cm between spindles and 6.5 cm at each end, so the first and last spindle sit half a gap closer to their ends than the spindles sit to each other. Nothing is rounded away in either card — the count, the gaps and the end gaps all describe the same six spindles.

How the two spacing options differ

The count comes first, and it rounds up

One spindle plus one gap is the unit that repeats along the rail. The run plus one spindle is what a whole number of those units, plus the two end gaps, has to fill — which is why the count is the ceiling of that division minus one:

n=⌈L+wsmax⁡+w⌉−1\mathrm{n} = \left\lceil \frac{\mathrm{L} + \mathrm{w}}{\mathrm{s}_{\max} + \mathrm{w}} \right\rceil - 1
L\mathrm{L}Inside railing distance: the clear run between the two ends
w\mathrm{w}Width of one spindle across the face that forms the opening
smax⁡\mathrm{s}_{\max}The widest gap the code you build under allows
n\mathrm{n}Whole spindles the run takes

Why the ceiling matters on paper

The quick paper method is to divide the run by spindle-plus-gap and keep the whole part. It is close, but nothing forces the leftover to fit inside the limit, so the last gap can come out too wide. Take a 13 cm run with 4 cm spindles and a 4 cm limit: dividing 13 by 8 gives one whole unit, which sets out one spindle with 4.5 cm either side of it — half a centimetre over the limit.

⌈17/8⌉−1\left\lceil 17 / 8 \right\rceil - 1==3−13 - 1==2 spindles2\ \text{spindles}\qquadseven\mathrm{s}_{\mathrm{even}}==17/3−417 / 3 - 4≈\approx1.67 cm1.67\ \mathrm{cm}

Two spindles and 1.67 cm gaps fit inside the same 4 cm limit. The difference between the two methods only appears when a run does not divide evenly, which is most of the time — so it is worth knowing which one your tape should follow.

Evenly-spaced spindles

The leftover, plus one spindle width, is shared by every gap in the run, including the two at the ends. Writing the ceiled unit count as k\mathrm{k}, the gap is simply what is left of each unit once the spindle is taken out of it:

k=⌈L+wsmax⁡+w⌉\mathrm{k} = \left\lceil \frac{\mathrm{L} + \mathrm{w}}{\mathrm{s}_{\max} + \mathrm{w}} \right\rceil\qquadseven=L+wk−w\mathrm{s}_{\mathrm{even}} = \frac{\mathrm{L} + \mathrm{w}}{\mathrm{k}} - \mathrm{w}

Because the divisor is rounded up, this gap is always at or below the limit. That is the reason to prefer it when the rail will be inspected, and the reason to leave it alone once it reads below the limit instead of nudging it back up.

Centered spindles

Here the gaps between spindles are held at the limit and the remainder is split between the two ends, so the count and the end gaps have to satisfy one balance:

2e+n w+(n−1)smax⁡=L2\mathrm{e} + \mathrm{n}\,\mathrm{w} + \left(\mathrm{n} - 1\right)\mathrm{s}_{\max} = \mathrm{L}
e\mathrm{e}==L−n w−(n−1)smax⁡2\frac{\mathrm{L} - \mathrm{n}\,\mathrm{w} - \left(\mathrm{n} - 1\right)\mathrm{s}_{\max}}{2}

This arrangement only works while that remainder is positive. Push the spindles wide relative to the limit and it runs out: a 90 cm run with 10 cm spindles under a 4 cm limit takes seven spindles and six interior gaps, which is 70 cm of spindle and 24 cm of gap — 94 cm of rail in a 90 cm opening. Each end gap would have to be −2 cm. The page prints that negative figure in red rather than hiding it, and the evenly-spaced card still fits the same run with 2.5 cm gaps.

The count does not change with the option

Both cards divide the same run by the same limit, so they always agree on the number of spindles. The option decides where the leftover goes — into every gap, or into the two ends — never how many pieces to buy. Choose it for the look you want.

Marking out a stair rail

A base or shoe rail follows the pitch of the stairs, so a gap measured along that rail is longer than the same gap measured on the level. Two different numbers matter, and they are easy to mix up. The horizontal gap is the one an opening rule applies to, because it is the clear distance a body could pass through. The sloped figure is the one your tape reads when it runs along the rail.

Sslanted=Shorizontalcos⁡α\mathrm{S}_{\mathrm{slanted}} = \frac{\mathrm{S}_{\mathrm{horizontal}}}{\cos \alpha}
α\alphaStair pitch: the angle the steps and the base rail rise at
Shorizontal\mathrm{S}_{\mathrm{horizontal}}The gap as calculated on the level line
Sslanted\mathrm{S}_{\mathrm{slanted}}The same gap measured along the sloped rail

Where the pitch comes from

Two boxes describe the steps: the riser rise, which is the height of one step, and the effective tread run, which is the horizontal distance between the same point on two adjacent steps — nosing to nosing. From those the pitch is one arctangent away, and the triangle works in both directions, so a pitch plus either box returns the other:

α\alpha==arctan⁡rt\arctan \frac{\mathrm{r}}{\mathrm{t}}\qquadr=ttan⁡α\mathrm{r} = \mathrm{t} \tan \alpha\qquadt=rtan⁡α\mathrm{t} = \frac{\mathrm{r}}{\tan \alpha}

A 3.6 m stair rail on 18 cm by 28 cm steps

The run: a clear run of 360 cm along the rail, 5 cm spindles and the 10 cm default limit, on a flight whose risers are 18 cm high with a 28 cm effective tread run.

Entered

Inside railing distance360 cm
Spindle width5 cm
Maximum allowable spacing10 cm
Riser rise18 cm
Effective tread run28 cm

What comes back

α\alpha==arctan⁡1828\arctan \frac{18}{28}==32.74∘32.74^{\circ}
n\mathrm{n}==⌈365/15⌉−1\left\lceil 365 / 15 \right\rceil - 1==24 spindles24\ \text{spindles}

Evenly spaced: 9.6 cm on the level becomes 11.41 cm along the rail. Centered: 10 cm between spindles becomes 11.89 cm, and the 5 cm end gaps become 5.94 cm.

On the rail: measure along the shoe rail, not on the level: the 11.89 cm figure is what separates two spindle faces on the rail itself, while the 10 cm figure is the opening the code measures.

As the pitch approaches zero the sloped figures converge on the level ones, which is the sanity check to keep in mind: on a level rail there is no difference between the two, and the sloped rows only appear because the rail is raked.

A full example in feet and inches

The arithmetic does not care which units the run arrives in. This time the run is 8 feet between two posts, the spindles are 1.5 inches wide and the limit is the 4 inch default.

An 8 ft deck rail with 1.5 in spindles

The run: 96 inches of clear run between two posts, 1.5 inch square spindles, and a 4 inch limit for the openings.

Entered

Inside railing distance8 ft (96 in)
Spindle width1.5 in
Maximum allowable spacing4 in

What comes back

n\mathrm{n}==⌈97.5/5.5⌉−1\left\lceil 97.5 / 5.5 \right\rceil - 1==18−118 - 1==17 spindles17\ \text{spindles}
seven\mathrm{s}_{\mathrm{even}}==97.5/18−1.597.5 / 18 - 1.5≈\approx3.92 in3.92\ \mathrm{in}
e\mathrm{e}==96−17×1.5−16×42\frac{96 - 17 \times 1.5 - 16 \times 4}{2}==3.25 in3.25\ \mathrm{in}

Seventeen spindles. Evenly spaced gives 3.92 in everywhere, ends included. Centered gives 4 in between spindles and 3.25 in at each end.

On the rail: with the centered option, set the first spindle face 3.25 in from the post, then step 5.5 in centre to centre for the next sixteen; the last face lands 3.25 in from the far post.

Seventeen spindles at 1.5 in is 25.5 in of spindle; the sixteen interior gaps at 4 in take 64 in; the two ends take 6.5 in. That totals 96 in, which is the run you started with — a quick way to check any set of figures before you cut.

Measuring and ordering advice

Measure the clear run, not the rail

The figure the calculator wants is the space between the two ends that will stop the spindles. Measuring outside to outside is fine as long as you subtract one post width at each end; a handrail that oversails its post is not part of the run.

Set out centre to centre

Two adjacent spindles are one gap plus one width apart, centre to centre. Mark that pitch repeatedly from the first spindle rather than measuring each gap afresh, and the row stays in rhythm; checking the last spindle against its end catches any drift in one go.

Use the widest part of the profile

The opening is judged at the narrowest place a spindle leaves it, which is beside the widest part of the profile. Turned spindles measured at the neck will set the gaps too wide and the openings too narrow at the belly.

Order one or two spare

Profiles go out of production and a short run often needs one more piece than the arithmetic suggests. Cutting a spindle short, or finding a bowed one in the bundle, is much cheaper when a spare is already on site.

A gap that comes out a little under the limit is the normal result of an even layout — that is the ceiling doing its job. Resist the urge to widen it to the limit: the few millimetres you gain will not be visible, and they are the first thing an inspector measures.

Questions

Q

What if a post or a mullion stands in the middle of the run?

Then the run is really two runs. Measure each one between its own two ends, calculate them separately, and add the counts; the gaps in one segment have nothing to do with the gaps in the other.

If what you need is the total count across a railing that carries posts along its length, that is the other way round: enter the whole run outside to outside plus the posts standing in it, and the baluster calculator takes their widths out of the run before it counts.

Q

Are spindles and balusters the same thing?

In everyday use the words overlap, with baluster usually describing the heavier member and spindle the slimmer one. The arithmetic is identical either way: one piece plus one opening is the unit, and the count is what a run of those units needs.

Q

Why is my end gap smaller than the gap between spindles?

That is the centered arrangement working as intended. It holds every interior gap at your limit and gives the leftover to the two ends, so the ends are always at or below the interior gap — never above it. If you would rather every gap were identical, choose the evenly-spaced option instead; the count stays the same.

How far to trust the result

  • A reminder, not a compliance ruling. The limit box flags any figure above 4 in, but whether that figure is the right one for your job is decided by the code your building department enforces, and the flag cannot know it. Confirm the opening rule that applies where you build before the layout is final.
  • One clear run, one spindle width. Posts inside the run, stepped rails, curved sections and spindles of differing widths all need the segments worked out one at a time. The model assumes every spindle is the same width at the height where the opening is measured.
  • Spacing only. Railing height, post fixing, guard strength, the number of fasteners and the size of any fillet strip or spacer under the spindles are outside this calculation. A permitted railing has to satisfy all of those as well.
  • Your tape sets the tolerance. The figures are exact for the numbers entered. A frame out of square, stock that bows and a rail that moves as it is fitted all shift the finished gaps, so set out to the tape and treat the last millimetres as adjustment rather than error.

For a permitted railing, or any run long enough to be worth a second pair of eyes, have the layout checked against the approved drawings before the spindles are cut. A local building department can confirm the opening figure for your area, and a carpenter who fits railings regularly will spot the site conditions this arithmetic cannot see.

Spindle Spacing Calculator for Deck and Stair Railings