A fence and gate calculator that turns a few measurements into a complete material take-off: the number of posts, panels, rails, gates and concrete bags you need, plus a full cost estimate. It works in metric or imperial and shows every step of the working, so you can take a confident list to the builders’ merchant instead of guessing — or over-ordering by 20% to be safe.
It is built for anyone fencing a garden boundary, a paddock, an allotment or a yard: homeowners pricing a weekend project, landscapers quoting a job, and smallholders costing a long run. Because gates break a fence into separate stretches and need their own posts, getting the count right by hand is fiddly. This tool handles the gate maths for you.
How it works
The calculator first works out the fenced length by subtracting every gate opening from your total run — you do not want a panel where a gate goes. It then divides that fenced length by your target post spacing (the panel width) and rounds up, so no single bay is wider than your spacing. That gives the number of panel bays. One panel fills each bay.
Posts follow from the bays: a straight run of N bays needs N + 1 line posts (the fence-post rule — the extra post closes the final bay). Each gate then adds one dedicated hanging post. Rails are simply bays multiplied by the rails-per-panel you choose. Concrete is the total post count multiplied by your bags-per-post figure. Finally, a wastage percentage is applied to panels and rails and everything is rounded up to whole units, because you cannot buy a third of a panel.
The cost estimate multiplies each quantity by the unit price you enter and totals them, then reports a handy per-metre (or per-foot) rate so you can compare quotes.
Worked example
Suppose you are fencing a 30 m garden boundary using 1.83 m feather-edge panels (so a 2.4 m post spacing is too wide — use 2.0 m), with 3 rails per panel, one 1 m gate, 2 bags of post mix per post, and 10% wastage.
- Gate opening: 1 m, so fenced length = 29 m.
- Bays: 29 ÷ 2.0 = 14.5, rounded up to 15 panel bays (actual spacing 1.93 m).
- Line posts: 15 + 1 = 16, plus 1 gate post = 17 posts.
- Rails: 15 × 3 = 45, +10% = 50 rails.
- Panels: 15 +10% = 17 panels.
- Concrete: 17 posts × 2 = 34 bags.
At sample prices of 18 per post, 32 per panel, 6 per rail, 85 per gate and 6 per bag, the materials total comes to roughly 1,200 in your chosen currency — about 41 per metre of fence.
Reference: the formulas
bays = ceil( (run − gates) ÷ spacing ) posts = (bays + 1) + gateCount rails = ceil( bays × railsPerPanel × (1 + wastage) ) panels = ceil( bays × (1 + wastage) ) concreteBags = ceil( posts × bagsPerPost )
Length conversions use the exact factor 1 ft = 0.3048 m. Switching the unit selector converts your run, spacing and gate widths in place so you never lose your inputs. Every figure is computed in your browser — nothing is uploaded or stored.
FAQ
The questions below cover the most common sticking points — post counts, panel counts, rails per panel, concrete per post, gates and what the cost figure leaves out. Use the live tool above to test your own run before you buy.