Space anything evenly along a wall, rail or board: pickets, posts, slats, shelves, hooks or picture frames. Enter the total length, the width of one item and either how many items or the largest gap you want, and get the equal gap, on-center spacing and a mark for every item.
Last updated:
Units
Wall, rail or board length, inside edge to inside edge
Picket, post, frame or shelf bracket width; 0 for hooks
Layout
I know the
The tool finds the fewest items that keep every gap at or below this
Enter your values to see the result.
Advertisement
Advertisement
How to use the Even Spacing Calculator
Pick your units: inches (shown with fractions) or centimeters/millimeters.
Enter the total length of the space and the width of one item. Use 0 for hooks, nails or other thin items.
Choose a layout: gaps at both ends (pickets between posts, frames on a wall), first and last item at the ends (posts along a run), or centered in equal sections (hooks, lights).
Enter the number of items, or switch to Maximum gap to let the calculator choose how many you need.
Press Calculate spacing and mark the centers or left edges from the table, or cut a spacer block to the gap size.
Even spacing formulas
Let L be the total length, n the number of items and w the width of one item. The free space is L − n × w; how it is shared depends on the layout.
Layout
Number of gaps
Gap
Typical use
Equal gaps at both ends
n + 1
(L − n·w) ÷ (n + 1)
Pickets or balusters between posts, frames on a wall, shelves in a cabinet
First and last item at the ends
n − 1
(L − n·w) ÷ (n − 1)
Fence posts along a run, joists, studs, columns
Centered in equal sections
n − 1 full + 2 half
L ÷ n − w
Hooks, knobs, pendant lights, recessed lights
On-center spacing is w + gap (or L ÷ n for equal sections). The left edge of item k is the end gap plus (k − 1) × on-center, and its center is that plus w ÷ 2.
Worked example: pickets between two posts
A fence section is 92½″ between posts and the pickets are 3½″ wide. You want gaps no wider than 2½″. Each picket plus gap takes at most 6″, so you need at least (92.5 − 2.5) ÷ 6 = 15 pickets. With 15 pickets the gap is (92.5 − 15 × 3.5) ÷ 16 = 2.5″ exactly, and the on-center spacing is 6″.
Tips for accurate spacing
Cut a spacer block to the exact gap and use it between items; it is faster and more consistent than measuring each gap.
Measure every mark from the same end using the table, so small errors do not add up.
Check the real width of lumber: a 1×4 is about 3½″ wide and a 2×2 about 1½″.
Railings have rules: for stair and deck guards most US codes do not let a 4″ sphere pass through; use the baluster spacing calculator for those.
For pictures, measure to the frame centers and then adjust each hook for the hanging hardware.
Frequently asked questions
How do I calculate equal spacing between items?
Subtract the total width of the items from the total length, then divide by the number of gaps. With a gap at both ends there is one more gap than items: gap = (length − items × width) ÷ (items + 1). If the first and last items sit right at the ends, there is one fewer gap than items: gap = (length − items × width) ÷ (items − 1).
What is on-center spacing?
On-center (O.C.) spacing is the distance from the center of one item to the center of the next. It equals the item width plus the gap. Builders use it because it is easier to measure and mark repeatedly than the gaps themselves.
How do I space pictures evenly on a wall?
Measure the wall width and the width of each frame, choose Equal gaps at both ends and enter the number of frames. The result gives the gap between frames and the distance from the left end of the wall to each frame's center, which is where you measure for the hook (adjusting for the hanging wire or bracket).
How many pickets do I need for a fence section?
Use Maximum gap: enter the distance between posts, the picket width and the largest gap you want, for example 2½ inches. The calculator returns the fewest pickets that keep every gap at or below that size, plus the exact equal gap to cut a spacer block to.
What does Centered in equal sections mean?
The space is split into equal sections and one item is centered in each. The gaps between items are equal and each end gets half a gap. It is the usual way to place hooks on a rack, pendant lights over an island or lights along a ceiling.
Why do my marks not add up exactly to the length?
Inch results are rounded to the nearest 1/16 inch for easy reading with a tape measure, so small rounding can add up over many items. The exact decimal is shown in brackets; marking every item from the same starting point, rather than from the previous mark, avoids accumulating error.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.