Fence Calculator
Work out the posts, rails, pickets or panels, gates and post concrete for your fence, in feet or metres, with an optional cost estimate.
Rule of thumb: dig about one third of the above-ground height, and make the hole about three times the post width.
Most fence projects go wrong in the same two ways. Either you come home from the timber yard three posts short, or you’re left with a stack of boards nobody needs.
This fence calculator gives you a proper materials list before you buy anything: how many posts, rails and pickets (or panels) you need, how long the posts should be, and how many bags of concrete it takes to set them.
It handles real gardens, not just one straight line.
Add up to eight sides, mark whether the fence runs all the way round, put gates on any side, and switch between feet and inches and metres and centimetres.
Add your local prices if you like and you’ll get a cost estimate for the whole job too.
How to Use the Fence Calculator
- Pick a fence type. Boards / pickets is for fences built on site from posts, horizontal rails and vertical boards, such as picket, privacy, dog-ear or closeboard fences. Fence panels is for ready-made panels fixed between posts, the usual choice in the UK, Ireland and much of Australia and New Zealand.
- Enter each straight side. Measure along the ground where the fence will go and enter one length per straight run. A back garden fenced on three sides is three sides. A corner is wherever two sides meet.
- Tick “closed loop” if the fence goes all the way round and the last side joins back to the first. That saves one post, because the start and finish share a corner.
- Add gates. Enter each gate’s opening width and choose the side it sits on. Gate openings are taken out of the fence length.
- Fill in the details: height, post spacing or panel width, post width and, for board fences, rails per bay, board width and any gap between boards.
- Set the concrete. Enter the hole diameter and depth and pick your bag size. If you’re using a different product, choose Custom yield and type the volume printed on the bag.
How the Numbers Are Worked Out
Posts and bays
On each side, the calculator subtracts any gate openings, divides what’s left by the post spacing, and rounds up to a whole number of bays (the gap between two posts).
Each gate adds one more post, because the opening needs a post on both sides. Add one final end post for a fence that doesn’t close on itself:
Posts = bays on every side + number of gates + 1 (leave out the +1 for a closed loop)
Corners are counted automatically, because the last post of one side is the first post of the next.
Rails and pickets
Rails run between neighbouring posts, so rails = bays × rails per bay. Fences up to about 4 ft (1.2 m) usually get two rails, while 6 ft (1.8 m) privacy fences normally get three.
To count pickets, the calculator divides each fenced run by the board width plus the gap and rounds up:
Pickets per side = ⌈(run length + gap) ÷ (board width + gap)⌉
For a solid privacy fence, set the gap to 0. Gates aren’t included, since they’re usually bought ready-made or built separately.
Panels
With panels, the post spacing isn’t something you choose. It’s fixed by the panel. Measured centre to centre, each bay is one panel width plus one post width.
A standard 6 ft (1.83 m) panel with 4×4 posts, which are actually 3.5 in wide, gives bays of about 6.29 ft. The calculator divides each side by this figure and rounds up, so the last panel on a side may need cutting to fit.
Concrete
Each hole is treated as a cylinder, minus the space the square post takes up:
Concrete per hole = (π × diameter² ÷ 4 − post width²) × depth
Multiply by the number of posts, divide by the yield of one bag, and round up to get the number of bags to buy.
Imperial bag yields are the figures printed on standard bags: 0.30 cu ft for 40 lb, 0.375 for 50 lb, 0.45 for 60 lb and 0.60 for 80 lb. The metric 20 kg and 25 kg options are scaled from the same mix, at about 9.4 and 11.7 litres.
Fast-setting post mixes vary, so check your bag and use a custom yield if it’s different.
Worked Example
Say you’re fencing a back garden on three sides: 60 ft, 100 ft and 60 ft, with a 4 ft gate in the long side.
You’ll use 6 ft boards with posts 8 ft apart, three rails per bay and 5.5 in boards with no gap.
- Side 1: 60 ÷ 8 = 7.5, rounded up to 8 bays
- Side 2: 100 − 4 = 96 ft of fence, 96 ÷ 8 = 12 bays, plus the gate
- Side 3: 8 bays
- Posts: 28 bays + 1 gate + 1 end post = 30 posts
- Rails: 28 × 3 = 84 rails, each 8 ft long
- Pickets: 131 + 210 + 131 = 472 boards
- Concrete: 10 in holes, 24 in deep, with 3.5 in posts, need about 0.92 cu ft each. That’s 27.6 cu ft for all 30 posts, or 74 bags of 50 lb mix.
Each post needs to be at least 6 ft + 2 ft = 8 ft long, so standard 8 ft posts work. Buy one or two extra for anything that splits or warps.
Tips Before You Buy
- Check boundaries and rules first. Many towns, councils and homeowners’ associations limit fence height, often to around 6 ft (1.8 m) in back gardens and less at the front. Some also need a permit or a neighbour’s agreement. Find out where your boundary actually is before digging.
- Locate buried services. Call your local utility locating service before you dig post holes, such as 811 in the US or the equivalent dig-safe service in Canada, Australia, the UK and Ireland.
- Dig deep enough. A common rule is to bury about a third of the post’s above-ground height, and deeper in frost-prone or windy areas. Holes about three times the post width give the concrete enough grip.
- Add a little gravel. A few inches of gravel at the bottom of each hole helps drainage and makes timber posts last longer.
- Allow for waste. Add 5–10% to boards and rails to cover offcuts, knots and warped lengths.
Frequently Asked Questions
How far apart should fence posts be?
For timber board fences, 6–8 ft (1.8–2.4 m) centre to centre is normal, and 8 ft matches standard rail lengths. Panel fences are spaced by the panel itself, usually 6 ft or 1.83 m plus the post width.
How many bags of concrete per fence post?
It depends on the hole. A 10 in × 24 in hole around a 4×4 post takes about 0.92 cu ft, which is roughly two and a half 50 lb bags.
Use the calculator with your own hole size for an exact figure.
How many posts do I need for 100 feet of fence?
For one straight 100 ft run with posts every 8 ft, you need 13 bays and 14 posts. Each gate adds one more post.
Does the calculator include gate hardware?
No. It counts the gates and their posts, but hinges, latches, screws and nails depend on the products you choose.
What does a new fence cost installed? See our fence and deck cost comparison for the US and UK, with cost per foot and per metre side by side.
Related Calculators
More free tools from our Everyday Calculators collection:
Link to this calculator
Teacher, blogger or student? Share this free Fence Calculator with your readers or class by pasting this code into your website:

About the author
Tahir Mehmood
Tahir Mehmood is the founder of Digital Designs SEO LTD, a UK company, with five years of hands-on experience in SEO, content writing and web development. He builds and maintains the calculators on All in Calculators and keeps them up to date. Spotted an error? Contact us and we will fix it.
Last updated: 27 November 2026