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.