Fence calculator

Posts, rails, pickets or panels, gate hardware and concrete for every post. A full shopping list you can take to the store or send to a pro.

By the LocalServiceHQ editorial team
Updated Oct 28, 2026
Formulas and sources listed below
Call 811 firstFree utility line marking is required before you dig in every US state.
Photo by Samuel Cruz on Unsplash

How we count it

Posts
ceil(run ÷ spacing) + 1 + corners + gates
Every end, corner and gate side gets its own post. Line posts fill the gaps at your chosen spacing.
Post depth
height × 12 ÷ 3 + 6 in gravel
The common rule is one third of the above-ground height in the ground. Go deeper where frost lines are deeper.
Concrete per post
π × (hole ÷ 24)² × depth − post area × depth
Hole volume minus the post itself, divided by 0.6 cu ft per 80 lb bag (printed bag yield).
Pickets
run ft × 12 ÷ 5.5 in
A nominal 1×6 picket is 5.5 in wide. Board-on-board styles need about 1.6× as many.
Rails
sections × (3 if ≥ 6 ft, else 2)
Fences 6 ft and taller need a middle rail to stop pickets from warping.

How to use the fence calculator

Walk the fence line with a tape or measuring wheel and note each corner and gate. The calculator turns that into a full shopping list.

1
Measure the line
Total length in feet along the path the fence will follow. Include gate openings; we subtract them for you.
2
Count corners and gates
Each corner and each side of a gate needs a stronger terminal post.
3
Pick type and height
Wood, vinyl, chain link or aluminum, at 4, 5, 6 or 8 ft. Check your HOA and city height limits first.
4
Price it locally
Type your store's prices into the list. Print it, or compare it with installed quotes from pros.

Fence materials compared

Cheaper up front is not always cheaper over 20 years. Upkeep and lifespan matter as much as the price per foot.

Material
Typical lifespan
Upkeep
Privacy
Best for
Pressure-treated pine
15–20 yrs
Stain or seal every 2–3 yrs
Full
Budget privacy
Cedar
15–30 yrs
Seal to keep color
Full
Natural look, less warping
Vinyl
20–30+ yrs
Wash once a year
Full
Low maintenance
Chain link
15–20+ yrs
Almost none
None (slats add some)
Pets, large yards, low cost
Aluminum
30+ yrs
Almost none
None
Pools, front yards, views

Lifespans are typical ranges and depend heavily on climate, soil contact and installation quality.

How deep should fence posts be?

The common rule is one third of the post's above-ground height in the ground, plus about 6 inches of gravel for drainage. In cold climates, go below your local frost line.

Fence height
Post length
Concrete depth
Hole depth with gravel
80 lb bags per post*
4 ft
6 ft
16 in
22 in
1.3
5 ft
8 ft
20 in
26 in
1.6
6 ft
8 ft
24 in
30 in
1.9
8 ft
10–12 ft
32 in
38 in
2.6

*10 in hole around a 4×4 post at 0.6 cu ft per bag. Chain-link line posts use 8 in holes.

Before you build

✓
Call 811Free utility locating is required before digging in every US state. Call at least a few working days ahead.
✓
Find your property lineUse your plat or a survey. Many homeowners set the fence 6–12 in inside the line to avoid disputes.
✓
Check HOA and city rulesHeight limits (often 6 ft in back yards, 3–4 ft in front), setbacks and which side must face out.
✓
Pull a permit if neededMany cities require a permit for fences over a set height or for pool barriers.
✓
Talk to neighborsShared fences can split cost. Get any agreement in writing.
✓
Plan for slopesChoose stepped or racked panels. Steep slopes need extra posts and more material.

Common fence mistakes

!
Posts too shallowShort posts lean within a few years, especially for 6 ft privacy fences in wind.
!
No gravel at the bottomWater pooling at the post base rots wood posts from the inside.
!
Concrete flush with the groundCrown the top of the concrete so water runs away from the post.
!
Undersized gate postsGates sag. Use heavier posts and a diagonal brace or anti-sag kit.
!
Skipping the middle rail6 ft wood fences without a third rail warp and bow.
!
Wrong fastenersUse exterior-rated, coated screws or nails; plain steel stains and fails.

Fence calculator FAQ

How many fence posts do I need?

Divide the fence length by your post spacing (usually 8 ft), round up, and add 1. Then add one post for each corner and two for each gate. 150 ft with 2 corners and 1 gate needs about 23 posts.

Multiply the length in feet by 12, then divide by the picket width. A standard 1×6 picket is 5.5 in wide, so 100 ft takes about 219 pickets.

About 2 bags of 80 lb mix for a 4×4 post in a 10 in hole, 30 in deep. Taller fences and bigger holes need more.

6–8 ft on center for wood, set by the panel size for vinyl and aluminum, and up to 10 ft for chain link.

It depends on material and region. Use our cost guides for installed prices in your city, or get quotes from local pros.

It depends on your city. Many require one above a certain height, near streets, or for pool barriers. Check your city's building department.

Many cities and HOAs require the finished side to face out. Check before you build.

Yes, many homeowners do. The hard parts are digging holes, setting posts plumb and building gates that don't sag.