Fence Calculator

Work out how many posts and panels you need for your fence, plus an estimate of the cost — based on your fence length and post spacing.

How to measure a fence — total length and post spacing Post spacing Total length
Measure the total length and your post spacing.

How to calculate a fence

A straight fence run breaks down into sections between posts:

Sections = fence length ÷ post spacing, and posts = sections + 1

The extra post is the end post that closes the final section. Corners and gates need their own posts, so add those separately.

Typical post spacing

Fence typeCommon spacing
Pre-made panels6 or 8 ft (match the panel)
Wood picket / privacy6–8 ft
Chain linkup to 10 ft

Fence materials compared

Material drives the cost, the look, and how much maintenance the fence needs:

MaterialRelative costLifespanUpkeep
Chain link$ (lowest)15–20 yrsAlmost none
Pressure-treated wood$$15–20 yrsSeal/stain every 2–3 yrs
Cedar$$–$$$20–30 yrsSeal every few years
Vinyl$$$20–30+ yrsWash only
Aluminum$$$30+ yrsAlmost none

Set your posts deep enough

The rule of thumb is to bury about one-third of the post's above-ground height (a 6 ft fence wants a post set ~2 ft deep), and always below your local frost line so frost heave can't lift it. Set posts in concrete for a privacy or panel fence; a compacted-gravel set is sometimes used for lighter fences and better drainage. Get each post plumb and let the concrete cure before hanging panels or gates.

Don't forget

  • Concrete for posts. Each post typically needs 1–2 bags — size it with our concrete calculator.
  • Rails. Non-panel fences usually need 2–3 horizontal rails per section.
  • Pickets. For a picket fence, divide the length (in inches) by picket width + gap to count pickets.
  • Corners, ends, and gates. Each corner and end needs a post, and every gate needs its own pair of sturdy posts and hardware.

How much does a fence cost?

Cost depends heavily on material and height — chain link is cheapest, then wood, with vinyl and aluminum higher. For installed per-foot ranges and a full project breakdown, see our guide on how much it costs to install a fence.

Before you build: lines, utilities, and rules

A fence is permanent and sits on a boundary, so a little homework up front saves expensive mistakes:

  • Call 811 first. Have underground utilities located before you dig postholes — it's free and required in most areas.
  • Confirm the property line. Don't guess from a hedge or an old fence; check your survey, or set the fence a few inches inside the line to be safe.
  • Check setbacks and permits. Many towns limit fence height (often ~6 ft in back, ~3–4 ft in front) and require a permit; an HOA may dictate style and color.
  • Talk to your neighbor. A quick conversation about the line and sharing costs heads off disputes later.

Frequently asked questions

How many posts for a 100 ft fence?
With posts every 8 ft, that's 13 sections and 14 posts (one extra for the end). Add posts for corners and gates.
How far apart should posts be?
6–8 ft for most wood and vinyl fences; match the spacing to your panel width if using pre-made panels. Chain link can stretch to 10 ft.
How deep should fence posts be?
About one-third of the above-ground height (≈2 ft for a 6 ft fence), and always below the frost line in cold climates to prevent heaving.
How much concrete per post?
Roughly 1–2 bags per post. Use our concrete calculator with your post count to get a precise figure.
Do fence posts need concrete?
Privacy, panel, and gate posts are best set in concrete for stability. Lighter fences are sometimes set in compacted gravel, which drains better and can extend wood-post life.
What's the cheapest fence?
Chain link is the lowest cost and lowest maintenance; pressure-treated wood is the cheapest privacy option but needs periodic sealing.
How do I count pickets?
Divide the total fence length in inches by the picket width plus the gap. For example, a 3.5 in picket with a 2 in gap covers 5.5 in each.
Do I need a permit to build a fence?
Often yes — many areas require a permit and limit fence height (commonly ~6 ft in back, ~3–4 ft in front). Check local code and your HOA, and confirm the property line, before you build.
Which side of the fence faces out?
By custom (and some codes), the finished side — rails and posts hidden — faces the neighbors and the street. It's worth confirming local rules and talking it over with your neighbor.

How we calculate this

  • Posts = number of sections + 1, with extras at corners, ends, and gates
  • Typical post spacing is about 6–8 ft
  • Concrete is estimated per post hole

Sources: Standard fencing practice. Last reviewed: June 2026. See our methodology for how we build every estimate.