Understanding the fence calculator — concept and principle
This calculator estimates the posts, panels (or bays), rails and post concrete needed for a straight fence. Enter the total fence length, the panel or bay width, and the number of horizontal rails per bay. It is used to price a garden or boundary fence and to order materials before digging the first hole.
How it is calculated
- Bays (panels) = ⌈fence length ÷ panel width⌉.
- Posts = bays + 1.
- Rails = bays × rails per bay.
- Post concrete = posts × 2 bags of 25 kg.
Lengths are in metres. Rounding up means the last bay may be shorter than the others and will need a panel cut to size.
The principle
This is the classic fencepost problem: a straight line divided into n sections needs n + 1 posts, because every section needs a post at each end and neighbouring sections share one. Rails span between posts, so each bay gets its own set. Concrete scales with the number of holes; two 25 kg bags per post is a typical planning figure for a standard garden fence post.
Worked example
Default inputs: length 30 m, bay width 1.8 m, 2 rails per bay.
- Bays = 30 ÷ 1.8 = 16.67, rounded up to 17.
- Posts = 17 + 1 = 18.
- Rails = 17 × 2 = 34.
- Concrete = 18 × 2 = 36 bags (25 kg).
| Panel / bay width (m) | Posts |
|---|---|
| 0.45 | 68 |
| 0.9 | 35 |
| 1.35 | 24 |
| 1.8 | 18 |
| 2.25 | 15 |
| 2.7 | 13 |
| 3.6 | 10 |
How to read the result
For an L-shaped or multi-sided fence, calculate each side separately, because each side rounds up its own last bay; the corner post is shared, so a connected fence with open ends needs the total bays + 1 posts. Gates need stronger posts and often a separate bay calculation. If you enter the panel width only, remember that posts also take up width: with 1.83 m panels and 100 mm posts the post-to-post spacing is about 1.93 m. Taller fences, exposed sites and soft ground need deeper holes and more concrete.
Common mistakes
- Forgetting the extra post at the end of the run.
- Treating several sides of a garden as one straight run.
- Ignoring post width when spacing posts on site.
- Not allowing for a gate, which changes bay widths.
Frequently asked questions
How deep should fence posts be?
A common rule of thumb is about one quarter to one third of the post's above-ground height, but local conditions and product guidance take priority.
How many posts do I need for a 30 m fence?
With 1.8 m bays, 17 bays and 18 posts for a straight run.
How many rails per bay?
Two rails suit lower fences; taller close-board fences often use three.
Sources: BS 1722 — Fences (series of British Standards)