Practical tools for measured work
Fence Picket Spacing Calculator
Lay out fence picket spacing across a run, with a live diagram of the finished fence section.
How it works
How to use it: enter the opening width between posts, the picket width, the picket height (used only to draw the diagram), and the largest gap you'll allow between pickets. The tool finds a symmetric layout - including the gaps at both ends - that keeps every gap at or under your maximum.
Formula. For n pickets there are always n + 1 gaps (one before the first picket, one after the last, and one between each pair), so the tool searches upward from n = 1 for the smallest picket count where the resulting gap is no larger than your maximum:
gap = (opening − n × picket width) ÷ (n + 1)
It stops at the first n where gap ≤ maximum gap (and gap is non-negative), then reports center-to-center spacing as picket width + gap.
Worked example. With the defaults above (2400 mm opening, 90 mm picket, 80 mm max gap): at n = 13 pickets, gap = (2400 − 13×90) ÷ 14 = 1230 ÷ 14 ≈ 87.9 mm, which exceeds 80 mm. At n = 14 pickets, gap = (2400 − 14×90) ÷ 15 = 1140 ÷ 15 = 76.0 mm, which fits - so the tool settles on 14 pickets, a 76 mm gap, and 90 + 76 = 166.0 mm center-to-center spacing.
Current-input example
The result above uses these exact values. This snapshot is included when the page is printed so the output can be checked against the original measurements.
- Opening width
- 2400 mm
- Picket width
- 90 mm
- Picket height
- 900 mm
- Maximum gap
- 80 mm
Primary result: Pickets: 14.
Before using the result
- Measure from the datum or reference edge described by this tool, and do not mix inside, outside and centerline dimensions.
- Keep inputs in the displayed units and preserve more precision than the final cutting or purchasing tolerance requires.
- When the result is close to a limit, verify it with a test piece, field measurement, manufacturer drawing or qualified project professional.
Limitations
The opening width you enter should be the real clear distance between posts (or other fixed boundaries) at installation, not a nominal or on-paper dimension - actual post positions, out-of-square framing, and timber that has swelled or shrunk will all shift real gaps slightly from this calculation.
The tool assumes a single row of identically sized pickets with uniform gaps and doesn't account for corner or end conditions that need a narrower picket, fasteners that take up space, or pickets installed at an angle (shadow-box or louvre styles).
Maximum-gap requirements for fences and railings are set by local building codes and vary by jurisdiction and application (pool fencing is typically stricter than a boundary fence) - treat any number you use here as something to verify locally, not a universal standard.
Frequently asked questions
Why does the tool sometimes give a gap much smaller than my maximum?
It always picks the fewest pickets that keep every gap at or under your maximum, then divides the leftover space evenly. If adding one more picket is what it takes to get under your limit, the gap can end up noticeably smaller than the maximum you entered rather than sitting right at it.
Does the picket height field affect the calculation?
No - picket height only affects the proportions of the diagram. Picket count, gap and center spacing are driven entirely by opening width, picket width and maximum gap.
What maximum gap should I use for pool fencing or a deck railing?
It depends on your local code - a 100 mm (about 4 in) maximum is commonly cited for pool safety fencing and stair/deck railings in several jurisdictions, but requirements vary by region and by application, so confirm the correct figure with your local building authority before building.
Related tools
Baluster Spacing Calculator
Enter the railing opening, baluster width and maximum gap you intend to use to calculate an equal-spacing layout.
Even Spacing Calculator
Evenly space any number of objects across an opening - holes, hooks, posts, anything.
Stair Calculator
Work out riser and tread count, riser height and stair angle from total rise and run.
Roof Pitch Calculator
Visualize roof pitch as rise/run, degrees and a scaled triangle diagram.
