Woodworking calculator
Equal Spacing Calculator
Spacing pickets, balusters, shelves, slats, or a row of holes so every gap comes out even is a one-line division problem with plenty of room for layout mistakes. Enter the span, how many pieces go in it, and how wide each one is, and this calculator returns the exact gap, the on-center spacing, and a mark-by-mark list you can take straight to the workbench, in inch fractions or millimeters.
How it works
With equal gaps at both ends, a span holding n pieces of width w contains n + 1 identical gaps, so each gap is (span - n x w) / (n + 1). If instead the first and last piece sit at a fixed distance from the ends, for example flush against the posts, only the n - 1 gaps between pieces get equalized: gap = (span - end offsets - n x w) / (n - 1). In both cases the on-center spacing is the gap plus one piece width. Set the piece width to zero and the same math lays out evenly spaced holes, shelf pins, or pencil marks: each center lands at span / (n + 1) intervals.
The mark list gives every piece's left edge, center, and right edge measured from one reference end of the span. Working from cumulative marks like these beats stepping off gap-by-gap with a spacer block or dividers, because a small error in a stepped-off gap repeats and stacks across the run, while tape marks from a single hooked end each carry only their own error. Round the marks to the fraction your tape can hold, 1/16 inch is plenty for carpentry, and put the leftover rounding error in the last gap where nobody will see it.
For deck and stair guards there is a hard limit on the gap: US residential codes based on the International Residential Code (Section R312.1.3 in recent editions, renumbered in some 2024 adoptions) require that guard infill openings reject a 4-inch sphere. Keep the clear gap between balusters under 4 inches; this calculator flags any layout whose gap is 4 inches or more. Code adoption and amendments vary by state and town, so verify the exact rule with your local building department before you build a guard.
Worked example
A guard rail section with 72 1/2 in between posts takes 15 pickets, each 1 1/2 in wide, with equal gaps at both ends: gap = (72.5 - 15 x 1.5) / 16 = 3 1/8 in exactly, on-center spacing 4 5/8 in. The first three left-edge marks from the left post are 3 1/8, 7 3/4, 12 3/8 in, and the 3 1/8 in gap clears the 4 in guard-opening limit.
Frequently asked questions
How do you calculate equal spacing?
Multiply the piece width by how many pieces you have, subtract that from the span, then divide by the number of gaps. With even spaces at both ends, n pieces make n + 1 gaps; with the end pieces fixed in place, only the n - 1 gaps between pieces count. This calculator does both and lists every mark position.
What is the difference between gap spacing and on-center spacing?
The gap is the clear distance between the edges of neighboring pieces, what you check with a spacer block. On-center spacing is the distance between piece centers, what you mark on a tape, and it always equals the gap plus one piece width. Layout goes faster on centers; codes and looks are judged on the gap.
How far apart can deck balusters be?
US residential codes based on the IRC require that guard openings not pass a 4-inch sphere, so the clear gap between balusters must stay under 4 inches. Many builders leave margin by aiming for around 3 1/2 to 3 3/4 inches. Adoption varies by state and town, so confirm the exact limit with your local building department.
How do I lay out evenly spaced holes?
Set the piece width to zero. The calculator then treats each position as a point and puts the hole centers at span / (n + 1) intervals, so five holes across 36 inches land at 6, 12, 18, 24 and 30 inches from the end. The mark list gives every center measured from one reference edge, ready for an awl or a drill press fence.
Is there an equal spacing calculator app?
This page is the app: it is free, runs in any phone or shop-computer browser with nothing to install, takes tape-measure fractions like 72 1/2 directly, and shows the whole mark list at once. Bookmark it on your phone's home screen and it opens like a native spacing app at the bench.
Related calculators
Sources
These calculators are for planning and estimation. Engineering results (shelf sag, wood movement) use published average material properties; real boards vary by grade, grain, moisture and defects. Verify load-bearing designs with a professional.