Fence Calculator: Posts, Rails, Pickets and Panels
Enter how long a fence is, how far apart the posts stand and how many gates it has to get a parts list: posts, sections, rails, pickets or panels, and concrete for the post holes.
An estimate for planning and school projects. Fence height, position and post depth can be covered by local rules and the building code, and buried pipes and cables must be located before anyone digs. Real work needs the local code and a qualified builder; young students work with an adult.
This tool runs in your browser. Nothing you type is uploaded or saved, and there is nothing to install or sign up for.
The fence-post problem, with a real fence
Ask a class how many posts a 100 ft fence needs with a post every 10 ft, and most hands say 10. The answer is 11, because a fence starts and ends with a post. Mathematicians call slips of this kind off-by-one errors, and the fence-post problem is the standard example. This fence calculator gets the count right, then goes on to the rest of the shopping list: the rails that join the posts, the pickets or panels that fill the spaces, and the concrete that holds each post in the ground.
A few terms first. A section is the stretch between two neighboring posts. Rails are the level boards running from post to post. Pickets are the upright boards fixed to the rails, and a panel is a ready-made section of fence that replaces rails and pickets together.
Filling in the fence details
- Choose your units and enter the total fence length, gates included.
- Type the post spacing. It starts as an example value; yours is set by the length of your rails or panels and the maker’s instructions.
- Enter the number of gates and how wide each one is.
- Say whether the fence is a line with two ends or a closed loop, and add any extra posts for corners.
- Pick what goes between the posts: rails and pickets, ready-made panels, or rails only. The boxes change to match.
- For concrete, check the hole diameter, hole depth and the amount one bag makes. Clear both hole boxes if the posts will not be set in concrete.
- Add prices for a cost line if you like.
Worked example: 100 ft with one gate
The opening example is a straight 100 ft fence with one 4 ft gate and posts 8 ft apart. The gate is not fenced, so:
fence without gates = 100 - 4 = 96 ft
sections = 96 / 8 = 12
posts = 12 sections + 1 end post + 1 for the gate = 14
Two rails per section is 24 rails, and the example 5% extra rounds that up to 26. For the pickets, 96 ft is 1,152 in, and each picket with its gap takes up 5.5 + 0.25 = 5.75 in. That gives 200.348, so 201 pickets, or 211 with the extra.
Each post hole in the example is a cylinder 10 in across and 30 in deep, which holds 1.36354 cu ft. Fourteen holes need 19.0895 cu ft, about 0.707 cu yd, and at an example yield of 0.6 cu ft per bag that is 32 bags.
How the post count is built
sections = (fence length - total gate width) / post spacing, rounded up
posts = sections + 1 + one per gate + extra posts
The division counts spaces. One more post is needed to close the last space, which is the plus 1. Rounding up matters too: 97 ft at 8 ft spacing is 12.125, so 13 sections, each a little shorter than 8 ft. The sections row shows that average length so you can see how the fence will actually be divided.
Each gate adds one post because a gate hangs between two posts of its own and breaks the run of fence into one more piece. The tool treats gates as sitting within the line of the fence.
Lines and loops count differently
| Fence shape | Posts for 8 sections, no gates | Why |
|---|---|---|
| A line with two ends | 9 | a post at both ends |
| A closed loop | 8 | the last section ends on the first post |
A 64 ft loop round a square school garden, with posts every 8 ft, is 8 sections and exactly 8 posts. Open the same fence into a straight line and it needs 9. If you do not know the length of a loop yet, add up the sides with the perimeter calculator first.
Pickets, panels and the concrete
Pickets are counted along the whole fenced length rather than section by section:
pickets = fenced length / (picket width + gap), rounded up
This slightly overcounts, because the posts themselves take up some of the length, which is a safe direction to be wrong in. Panels are simpler: the fenced length divided by the panel width, rounded up. No waste is added to panels.
The concrete line uses the volume of a cylinder, pi x (diameter / 2)^2 x depth, and does not subtract the space the post fills, so it leans high. To explore that formula with other sizes, try the cylinder volume calculator. For a slab or a mowing strip under the fence, the concrete calculator handles rectangular pours.
The hole size, the depth and the bag yield are example values, not advice. How deep a post has to go depends on the fence height, the soil and how far the ground freezes in winter, and the local building code or the fence maker gives the figure. The yield of a bag is printed on it.
Where the estimate can go wrong
- Corners. A corner needs a post exactly at the corner. If your corners do not land on the regular spacing, count them in the extra posts box, or run each straight side separately.
- Slopes. Measure along the ground. Stepped or raked fences on steep ground can need longer posts and more cutting.
- Gate hardware and end details. Hinges, latches, post caps, screws and nails are not listed.
- Rules about fences. Height limits, boundary positions and pool barriers are set locally.
Before any digging, the location of buried pipes and cables has to be confirmed through the local utility-marking service. Digging and setting posts is adult work.
Turning it into a lesson
Give students ten paper clips as posts and ask how long a chain of 8 cm straws they can support. Nine straws, not ten. Then bend the chain into a ring and the tenth straw fits. That one demonstration covers the line and loop rows of the table above.
For a planning task, measure the edge of the school garden, enter it as a closed loop and compare pickets against panels with prices typed in. The metric example, a 30 m line with a 1.2 m gate and 2.4 m spacing, also comes to 14 posts and 12 sections. If the garden needs a platform or walkway inside the fence, the deck board calculator counts the boards.
The other building pages are grouped under home and DIY calculators, and you can browse everything on the free online tools page.
Frequently asked questions
How many fence posts do I need for 100 feet of fence?
With posts 8 feet apart and one 4 foot gate, the fenced length is 96 feet, which is 12 sections. That needs 12 posts plus 1 end post plus 1 for the gate, 14 in total.
Why do I need one more post than sections?
Every section needs a post at each end, and neighboring sections share one. A line of 12 sections therefore has 13 posts. A closed loop is the exception, because the last section finishes on the first post.
How many pickets do I need for a fence?
Divide the fenced length by the width of one picket plus one gap, and round up. For 96 feet with 5.5 inch pickets and 0.25 inch gaps that is 1,152 divided by 5.75, which rounds up to 201 pickets before any spares.
How far apart should fence posts be?
It depends on the rails or panels you are using and on the maker’s instructions, and local rules may apply. The 8 feet in the box is only an example value so the tool has something to work with.
How much concrete do I need per fence post?
Work out the hole as a cylinder. A hole 10 inches across and 30 inches deep holds about 1.36 cubic feet before the post is put in. The right hole size and depth for your fence come from the local building code or the fence maker.
How many posts does a fence around a square garden need?
For a closed loop the number of posts equals the number of sections. A 64 foot loop with posts every 8 feet has 8 sections and 8 posts, plus one more for each gate.
