planmero

01 / 15 · Equal spacing

Equal Spacing Calculator

Enter the length to fill and the width of one element. Then decide the rule: a number of elements, a gap that must not be exceeded, or an exact gap — and what happens at the ends.

How it works

With a fixed number of elements, the free space (length minus all element widths) is split into equal gaps. How many gaps there are depends on the end rule: n + 1 when the ends get a full gap, n − 1 when the elements touch the ends, n when the ends get half a gap.

With a maximum gap, the calculator adds elements one by one until every gap is at or below your limit — the fewest elements that satisfy the rule.

With an exact gap, as many elements as possible are placed, and the space left over is split evenly between both ends, so the layout stays centred.

Marking positions are measured from the start of the run to the left edge and to the centre of every element. Mark from one fixed point to avoid adding up small errors.

What the calculator assumes

  • All elements have the same width and the run is straight.
  • Sizes are exact; real boards vary, so check a few before cutting.
  • Safety rules for railings (for example the common 4 in / 100 mm maximum opening) depend on your local building code.

Questions

How do I space balusters so no gap is more than 4 inches?
Choose “Gap must not exceed”, enter just under 4 in, the run between posts and the baluster width. The calculator returns the fewest balusters and the real gap.
Should the ends get a full gap or a half gap?
Use a full gap between two posts or walls. Use half a gap when several sections repeat side by side, so the spacing continues evenly across the joint.

Planning aid only. It does not size structural members or check loads — follow the manufacturer's instructions and your local building rules.

How to space boards evenly: worked example and formulas

Equal spacing comes down to one subtraction and one division. Here are the formulas the calculator uses, a worked example for a slatted headboard and the marking habits that stop small errors piling up.

The formula behind every even layout

Take the length of the run, subtract the width of all the elements, and what is left is free space. That free space is split into equal gaps. The only real decision is how many gaps there are, and that depends on what you want at the two ends of the run.

Whatever rule you pick, the centre-to-centre distance (the pitch) is always the gap plus one element width.

  • Same gap at the ends as between the elements: n elements make n + 1 gaps, so gap = (run − n × width) ÷ (n + 1).
  • Elements touch the ends: n − 1 gaps, so gap = (run − n × width) ÷ (n − 1).
  • Half a gap at each end: the two halves add up to one gap, so there are n gaps and gap = (run − n × width) ÷ n.
  • Fixed end space: subtract both end spaces from the free space first, then divide by n − 1.

Worked example: slats for a 58-inch headboard

You are filling a 58 in opening between two headboard legs with 1x4 boards. A 1x4 actually measures 3 1/2 in wide, so that is the element width. You want the same gap at both legs as between the slats, and no gap wider than 2 in.

Try 10 slats first: 10 × 3.5 = 35 in of wood, 58 − 35 = 23 in of free space, 11 gaps, 23 ÷ 11 = 2.09 in. That is over the limit, so 10 slats are not enough.

Try 11 slats: 11 × 3.5 = 38.5 in of wood, 58 − 38.5 = 19.5 in of free space, 12 gaps, 19.5 ÷ 12 = 1.625 in, which is 1 5/8 in. That passes, so 11 is the fewest slats that meet the rule. The “Gap must not exceed” mode does exactly this: it adds one element at a time until every gap is within your limit.

The pitch is 1.625 + 3.5 = 5.125 in, or 5 1/8 in. Measured from the left leg, the slats start at 1 5/8, 6 3/4, 11 7/8 and 17 in, and the eleventh one starts at 52 7/8 in. Check the far end: 52.875 + 3.5 + 1.625 = 58 in, so the last gap matches the others. In metric the same job is roughly a 1473 mm opening with 89 mm slats and 41 mm gaps.

How the rule changes the result

Same 58 in opening, same 3 1/2 in slats, different rules. Values in brackets are what the calculator shows when it rounds to the nearest 1/16 in.

  • Use “Gap must not exceed” when the gap is a limit, such as a safety rule.
  • Use “Exact gap” when the gap itself matters, for example with a spacer block. Only 10 slats fit with exactly 2 in gaps, and the 5 in left over is split into 2 1/2 in at each end so the layout stays centred.
  • Use “I know how many” when the count is fixed.
  • The centre-to-centre maximum mode works like the gap limit with one element width taken off first: a 5 1/2 in pitch limit on 3 1/2 in slats is the same as a 2 in gap limit.
58 in opening, 3 1/2 in slats
RuleSlatsGapEnd spacePitch
Gap max. 2 in, same gap at ends111.625 in (1 5/8)1.625 in (1 5/8)5.125 in (5 1/8)
Gap max. 2 in, slats touch the ends111.95 in (1 15/16)05.45 in (5 7/16)
Gap max. 2 in, half a gap at ends111.77 in (1 3/4)0.89 in (7/8)5.27 in (5 1/4)
Exact gap 2 in102 in2.5 in (2 1/2)5.5 in (5 1/2)
Exactly 10 slats, same gap at ends102.09 in (2 1/16)2.09 in (2 1/16)5.59 in (5 9/16)

Common mistakes

  • Using nominal lumber sizes. A 1x4 is 3 1/2 in wide and a 2x2 is 1 1/2 in. Measure your actual boards.
  • Counting gaps wrong. Ten slats between two posts have eleven gaps, not ten.
  • Rounding the gap and stepping along with the tape. With the slats touching the ends, the true gap is 1.95 in. Step off 1 15/16 in ten times and you end up 1/8 in short at the far leg, because each step loses 0.0125 in.
  • Measuring the opening in one place only. Legs and walls are rarely parallel. Measure top and bottom and plan for the smaller number.
  • Treating a code limit as a target. If a rule says an opening must be less than a certain size, set your limit a little below it. Railing rules differ between places, so check your local code.

Workshop tips for marking and fitting

The calculator lists the position of every element measured from the start of the run, both to its left edge and to its centre. Use those numbers rather than adding gaps yourself.

  • Hook the tape on one fixed point, such as the left leg, and mark every position from there. Cumulative marks do not add up rounding errors.
  • Mark the left edge of each slat and put an X on the side where the wood goes.
  • For an exact gap, cut a spacer block to the gap and use it for every slat. Even for an odd gap like 1 5/8 in, a spacer beats a tape.
  • When several sections are the same, transfer the marks to a story stick, a straight scrap with every position on it, and use it on each section.
  • Dry-fit the first and last slat and check both end spaces before you fasten anything. If the run measures slightly different than planned, re-enter the real length and recalculate.