Fence Calculator

Plan a fence side by side. Enter the length of each side and its gates and this fence calculator counts the posts, sections and rails, plus the pickets, boards or vinyl panels, in feet or meters. This free online fence calculator works on any phone or computer, with no sign-up or download.

Jump to:How it worksExampleFAQ

Use the actual width of the board (a 1×6 is about 5½ in or 140 mm). Post spacing: the distance from the centre of one post to the next, from your panel or rail length.

Posts

— posts

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

  1. Each side is a straight run. Its gates are taken out first: fence length = side − gates × gate width.
  2. 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.
  3. Posts on a side = sections + gates + 1. Sides joined end to end share a corner post (a closed loop shares every corner).
  4. 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:

SideFenceSectionsPostsBoards
1 (gate)46 ft⌈46 ÷ 8⌉ + 1 = 79⌈552 ÷ 5.5⌉ = 101
2100 ft⌈12.5⌉ = 1314⌈1,200 ÷ 5.5⌉ = 219
350 ft⌈6.25⌉ = 78⌈600 ÷ 5.5⌉ = 110
Total196 ft2731 − 2 shared = 29430

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.

All Fencing & Railing calculators →

Built and checked by the CalcWall team · Last updated ·How we calculate · Results are estimates; confirm quantities with your supplier.