How much does it cost to build a fence? Enter your linear footage and fence type to get an exact post count, material list, and cost comparison for wood, vinyl, chain link, and composite fencing.
10% typical for fence pickets
Ready to calculate
Select a fence type and enter dimensions
Last updated March 31, 2026 by our expert review team
| Type | Height | Cost/LF | Lifespan | Maintenance |
|---|---|---|---|---|
| Wood Privacy | 6 ft | $12-32/LF | 15-20 years | Medium |
| Wood Board-on-Board | 6 ft | $18-43/LF | 15-20 years | Medium |
| Chain Link | 4 ft | $7-22/LF | 20-30 years | Low |
| Vinyl Privacy | 6 ft | $22-44/LF | 25-30 years | Low |
| Composite | 6 ft | $30-55/LF | 25-50 years | Very Low |
Ehsan Ghazanfari
Licensed Structural Engineer
FISE-certified structural engineer with 11+ years designing bridges, retaining walls, and foundations. MSc from Aalto University.
See full profileCherry Jane Limbago
Licensed Civil Engineer & Master Plumber
Licensed civil engineer and master plumber with 10+ years in structural design, estimation, and project management. Currently Project Engineer at Universal Robina Corporation.
See full profileUpdated March 2026
How we verify our calculatorsUse 6-foot post spacing instead of 8-foot in high-wind areas. The shorter span dramatically reduces lever force and prevents leaning.
Budget 2 bags of fast-setting concrete (50 lb each) per 4x4 post. For 6x6 gate or corner posts, plan 3 to 4 bags per hole. Use our concrete bags calculator for exact quantities.
Place gates at the highest point of your fence run. Gates sag over time, and starting uphill gives extra clearance before dragging.
Call 811 at least 3 business days before digging. It is free and required by law. Check IRC building codes for your area's fence height and setback requirements.
Layer 4 to 6 inches of crushed gravel at the bottom of every post hole before concrete. This prevents water from pooling around the post base.
Pre-stain or seal all six faces of every picket before installation, not after. This single step can add 5 to 7 years to a cedar fence's life.
For vertical board siding, use our board and batten calculator to estimate boards and battens for walls.
This calculator mirrors how professional fence contractors actually bid jobs. You start with total linear footage. Measure along your property line, not in a straight line if your yard has turns or jogs. The calculator subtracts gate openings from the fenceable length, then determines post count based on your chosen spacing. Each gate requires two dedicated posts (called "gate jamb posts"), which is why gate openings add posts even as they reduce fencing. For wood fences, picket count is based on standard 3.5-inch dog-ear pickets; board-on-board style uses a 1.5-inch overlap per picket, which increases material by roughly 75%. Concrete estimates assume a 10-inch diameter hole with two 50-lb bags per post, the same spec most local codes require. Cost estimates reflect 2025-2026 national averages, but lumber prices can swing 20-30% seasonally, so check your local Home Depot or Lowe's pricing before finalizing your budget.
Subtract Gates
Fence length = Linear feet - (gates x gate width)
Calculate Posts
Posts = ceil(fence ft / spacing) + 1 + (gates x 2)
Materials & Cost
Pickets, rails, or panels calculated by type + 10% waste
Key Formulas
Posts = ceil(fence ft / post spacing) + 1 + (gates x 2)
Pickets = ceil(fence ft x 12 / picket width) x 1.10
Concrete = posts x 2 bags (50 lb each)
How much does a fence cost per linear foot?
Chain link: $15 to $22/LF. Wood privacy: $20 to $35/LF. Vinyl: $30 to $45/LF. Composite: $45 to $55/LF. DIY cuts labor costs by 40 to 60%.
How deep should fence posts be set?
Bury one-third of the total post length. A 6-foot fence with 8-foot posts means 24 inches in the ground. Cold climates may require 36 to 48 inches per concrete post depth guidelines.
Cedar vs pressure-treated: which is better?
PT costs 30 to 40% less but warps as it dries. Cedar stays straighter and is naturally rot-resistant, but costs $18 to $25/LF vs $12 to $18 for PT.
Do I need a permit to build a fence?
Most areas require permits for fences over 4 feet in front yards or 6 feet in backyards. Get a property survey before building to avoid teardown orders.
How long does a wood fence last?
Pressure-treated: 15 to 20 years. Cedar: 20 to 25 years with sealing every 2 to 3 years. Vinyl and composite: 25 to 50 years.
How many concrete bags per fence post?
Two 50 lb bags per 4x4 post in a 10-inch hole at 24 inches deep. Gate and corner posts (6x6) need 3 to 4 bags each. Our concrete bags calculator gives precise estimates.
What is the best post spacing?
8 feet on center is standard. Reduce to 6 feet in high-wind areas or for fences taller than 6 feet.
How do I prevent gate sag?
Install a diagonal steel anti-sag kit ($12 to $15) from top hinge corner to bottom latch corner. Required for any gate wider than 4 feet.
150 LF of 6-foot PT wood privacy fence with one 4-foot walk gate. Flat suburban lot.
21 posts · ~570 pickets · 42 concrete bags · DIY ~$2,050 · Pro ~$4,800
80 LF of 4-foot galvanized chain link with a 10-foot double drive gate. Includes old fence removal.
11 posts · 2 fabric rolls · 22 concrete bags · DIY ~$720 · Pro ~$1,760
300 LF of 6-foot white vinyl enclosing entire backyard with two 4-foot walk gates. HOA-mandated.
50 panels · 55 posts · 110 concrete bags · DIY ~$7,260 · Pro ~$13,200
Not calling 811 before digging
Hitting a buried line can cost $5,000 to $25,000. The 811 call is free, legally required, and takes 2 to 3 business days.
Setting posts without gravel drainage
Concrete alone traps water around the post base, accelerating rot. Add 4 to 6 inches of crushed gravel at the bottom of every hole first.
Building on or over the property line
A forced teardown costs the entire fence plus legal fees. Spend $300 to $500 on a survey, or locate your property pins with a metal detector.
Using undersized gate posts
4x4 posts are too weak for gates. Use 6x6 posts for all gate jambs in 12-inch holes with 3 to 4 bags of concrete each.
Ignoring the setback requirement
Most municipalities require 2 to 6 inches of setback from the property line. Check your zoning code before buying materials.
Skipping the string line for alignment
Drive stakes at both ends, stretch a mason line, and set every post to that line. Takes 10 minutes and prevents a wavy fence.
Important Disclaimer
These estimates are for planning purposes only. Actual costs vary by location, material availability, and project complexity. Always get at least 3 local quotes. This calculator does not replace professional advice.