Fence post count:
one more post than there are gaps
A fence always has one more post than it has spans, which is the detail that most often leaves a run one post short.
Calcylator Editorial Team
Updated · 4 min read

Why the answer is spans plus one
Count the gaps between posts and you have the spans. Count the posts and you always have one more, because both ends of an open run need a post. Picture a single 3 m panel: it needs two posts, not one. Add a second panel and it needs three.
That off-by-one is the classic fencing error, sometimes called the fence-post problem. Dividing the length by the spacing gives spans, not posts, so a final step has to add the end post back in.
The second subtlety is that a fence rarely divides evenly. If your posts can be at most 3 m apart, 38 m cannot be done with 12.67 spans, so you round up to 13 spans and then space the posts a little closer than the maximum.
The post count formula
- L:
- total length of the straight, open run, in metres
- s:
- maximum allowed post spacing, in metres
- ceil:
- round up to the next whole number
Rounding up is deliberate. Rounding to the nearest value could give spacing wider than the panels or rails allow, which weakens the fence or leaves a gap.
Fence length
38 m
Maximum spacing
3 m
Posts needed
14 posts
38 ÷ 3 = 12.67, rounded up to 13 spans, plus 1 end post = 14 posts. Actual spacing = 38 ÷ 13 ≈ 2.92 m.
The even spacing of about 2.92 m is what you mark on the ground, not 3 m with a short leftover bay at the end. Equal bays look better and keep panel sizes uniform.
Variations: panels, loops and neat divisions
The same calculation covers several layouts. The table sets out how the +1 changes with the shape of the run, using different lengths so you can see when the division lands exactly.
| Layout | Length | Spacing | Spans | Posts |
|---|---|---|---|---|
| Open straight run | 38 m | 3 m | 13 | 14 |
| Open run, exact fit | 30 m | 2.5 m | 12 | 13 |
| Closed rectangle | 40 m | 2.5 m | 16 | 16 |
| Open run, short | 7 m | 3 m | 3 | 4 |
In the closed rectangle there is no free end, so the last span returns to the first post and the count equals the number of spans. Corners are real posts inside that count and do not need adding again.
Sloping ground and soft soil
On level ground the bay width measured along the fence equals the distance on the plan. On a slope, the posts follow the ground, and the true distance along the slope is longer than the plan distance. A 3 m bay on a 1 in 5 slope measures about 3.06 m along the incline, which is within tolerance for most panels, but steeper ground makes the difference matter.
There are two common ways to deal with a slope. Racked fencing, where the panel itself follows the incline, keeps the panel and post count as calculated. Stepped fencing, where each panel stays level and the base rises in steps, usually needs a shorter spacing or a taller post, and the number of posts stays the same only if each step fits within the maximum bay.
Soft ground or heavy wind exposure can push you to tighten the spacing to 2 m or 2.4 m. Redo the sum with the new maximum: 38 ÷ 2.4 = 15.83, rounded up to 16 spans, plus 1 gives 17 posts. That is three more holes, three more posts and more concrete than the 3 m layout needed, which is worth knowing before you buy.
Extras the basic formula leaves out
The formula gives line posts at an even spacing. Real fences add structure on top, and the added posts should be budgeted separately.
- Gates need a post on each side, and a heavy gate often wants a thicker hanging post.
- Corners and sharp direction changes need a post exactly at the angle, which may split a run into several open runs; calculate each separately and add them.
- A long run on sloping ground may need posts closer together or stepped panels.
- End posts, strainers and braces for wire or mesh fencing are often heavier than line posts.
- Spare posts for damage or poor ground are worth one or two on a long job.
Turning the count into a shopping list
The post count drives most of the other quantities, so it is the first number to settle. For a timber panel fence, panels equal spans, so 13 panels for the 38 m run. For a rail-and-board fence, rails equal spans multiplied by the number of rails per bay, usually two or three.
- Calculate spans and posts from length and maximum spacing.
- Count panels or rails from the spans, then add the gate hardware.
- Add the heavier corner, gate and end posts as separate items.
- Estimate concrete or backfill for each post hole from the hole size and depth.
- Add a small allowance, usually one or two units, for damage or a changed layout.
If the same run has a gate, subtract the gate opening from the length first and treat each side as its own open run. A 38 m boundary with a 3 m gate becomes 35 m of fence, or two shorter sections, and the extra gate posts are then counted separately.
Setting out and buying the posts
Mark the two ends first and the gate positions next, then divide what is left into equal bays. Stretching a string line between end posts keeps the intermediate posts straight, and checking the spacing before digging avoids moving a hole later.
If the panels are a fixed width, such as a 1.8 m trellis or a 2.4 m rail, the maximum spacing is really panel width plus the post thickness, and the run should be planned in whole panels. In that case adjust the length to suit the panel, or shorten one panel on site. A material length calculator is a handy second check when you are converting run length into rails, wire or mesh.
Finally, local rules and the type of fence control how deep posts must be set and how far apart they can be, so confirm those limits with the fence supplier and the site conditions.
Common questions
How do I calculate how many fence posts I need?
Divide the fence length by your maximum post spacing, round the answer up to a whole number to get the spans, then add 1 for the final post. For 38 m at 3 m spacing that is 13 spans and 14 posts.
Why do I add one to the number of spans?
An open fence has a post at both ends, so posts always outnumber the gaps between them by one. Without the extra post the last span would have nothing to attach to. A single 3 m panel needs two posts.
Does the formula change for a closed fence?
Yes. A fully enclosed loop has no free end, so the number of posts equals the number of spans. A 40 m perimeter at a 2.5 m maximum spacing needs 16 spans and 16 posts, with corners included.
Should I round the spacing or the number of spans?
Round the number of spans up, then divide the length by that count to get an even spacing. That keeps every bay at or under the maximum, whereas rounding down would create bays wider than the panel or rail allows.
Was this guide helpful?
Continue reading
View all blogsHow Much Grout Do You Need for a Tiled Area?
Grout fills thin joints, so volume is tile edge length × width × depth. 20 m² of 300 mm tiles with 3 × 5 mm joints needs about 2.0 L of grout before waste.
5 min read
How Many Wallpaper Rolls Do You Need for a Room?
An 18 m perimeter with 0.53 m wide rolls needs 34 strips. At 4 strips per 10 m roll that is 9 rolls, and a pattern repeat can push it to 12. Check the steps.
5 min read
Pool Water Volume: Litres in a Pool by Size
Pool volume in litres = length × width × average depth (all in metres) × 1,000. An 8 m × 4 m pool averaging 1.5 m deep holds about 48,000 litres.
5 min read




