Quick answer: sections = fence length ÷ post spacing, rounded up; posts = sections + 1 on each side, minus one for every corner two sides share. A straight 100 ft run with posts every 8 ft needs 13 sections and 14 posts.
How the fence calculator works
- Each side is a straight run. Its gates are taken out first: fence length = side − gates × gate width.
- Sections = fence length ÷ post spacing, rounded up. A gate splits a side into stretches, so one section is added per gate, the most any gate position can need.
- Posts on a side = sections + gates + 1. Sides joined end to end share a corner post (a closed loop shares every corner).
- Rails = sections × rails per section. Pickets or boards = fence length ÷ (board width + gap), rounded up on each side; board on board uses width − overlap.
Worked example
Three sides of a yard, 50, 100 and 50 ft, ends open, one 4 ft gate on the first side, posts every 8 ft, 1×6 boards (5½ in) side by side:
| Side | Fence | Sections | Posts | Boards |
|---|---|---|---|---|
| 1 (gate) | 46 ft | ⌈46 ÷ 8⌉ + 1 = 7 | 9 | ⌈552 ÷ 5.5⌉ = 101 |
| 2 | 100 ft | ⌈12.5⌉ = 13 | 14 | ⌈1,200 ÷ 5.5⌉ = 219 |
| 3 | 50 ft | ⌈6.25⌉ = 7 | 8 | ⌈600 ÷ 5.5⌉ = 110 |
| Total | 196 ft | 27 | 31 − 2 shared = 29 | 430 |
With three rails per section that is 81 rails. These are counts of whole pieces before any extra for mistakes; buy a few spare boards. The calculator does not apply any local building code or HOA rule.
Frequently asked questions
How do I calculate how many fence posts I need?
Divide each side’s fence length by the post spacing and round up to get the sections; each side then has one more post than sections, and sides that meet share their corner post. A 100 ft side with posts every 8 ft has 13 sections and 14 posts.
How far apart should fence posts be?
Wood fences are commonly built with posts 6 to 8 ft (about 1.8 to 2.4 m) apart on centre; vinyl and other panel fences use the spacing in the panel maker’s instructions. Closer posts make a stiffer fence. Local rules and wind exposure can call for less.
How are gates counted?
Enter the number of gates on each side and one gate width. The gate opening is taken out of the fence length and each gate gets a post on both sides. The counts allow for a gate anywhere on the side, so if the gate falls where the sections divide evenly you may have one post and one section to spare per gate.
Does this tell me how deep to set the posts?
No. Post depth and footing size depend on fence height, soil, frost depth and local rules. Use the concrete or Sonotube calculator for the concrete once you know the hole size.
Do I need a permit for a fence?
It depends on where you live. Many towns, HOAs and councils limit fence height and set rules for boundaries and pools. Check with your local building office before you buy materials.
Is this fence calculator free to use online?
Yes. The CalcWall Fence Calculator is completely free and works online in any browser, on a phone, tablet or computer. There is nothing to download and no account to create, and the math runs right in your browser, so results appear as you type.