HomeApril 12, 2026

Fence Calculator Guide: How to Plan, Estimate & Build

By The hakaru Team·Last updated March 2026

Quick Answer

  • *Posts: total linear feet ÷ 8 + 1 (for 8-ft spacing). Add extra posts for corners and gates.
  • *Rails: 2–3 per section depending on fence height. Fences over 5 ft need 3 rails.
  • *Pickets: total inches ÷ (picket width + gap). Add 10% for cuts and waste.
  • *Post depth: bury one-third of total post length, minimum 24 inches.

How to Calculate Fence Posts

The number of posts depends on your total fence length and the spacing between posts. The standard formula: divide total linear feet by the post spacing and add one. A 100-foot fence with 8-foot spacing needs 100 ÷ 8 + 1 = 14 posts.

But that assumes a straight line. Every corner requires an extra post. Every gate requires two extra posts (one on each side). A rectangular backyard fence with two corners and one gate might need 4 additional posts beyond the straight-line calculation.

For 6-foot privacy fences, use 4×4 posts that are 8 feet long. This gives you 6 feet of fence height with 24 inches buried. In areas with deep frost lines, use 10-foot posts and bury 36–42 inches.

Rails and Pickets

Horizontal rails connect the posts and support the pickets. Fences under 5 feet tall need two rails (top and bottom). Fences 5–8 feet tall need three rails (top, middle, bottom). Standard rails are 2×4 lumber in 8-foot lengths.

For pickets, measure total fence length in inches and divide by picket width plus gap. A privacy fence with no gaps uses only the picket width. Standard pickets are 1×6 (actual width 5.5 inches) or dog-ear style at 3.5 inches wide.

Post Depth and Concrete

Each post needs about one 50-lb bag of premix concrete for a 24-inch hole, or two bags for a 30-inch hole in a 10-inch diameter. The standard post hole is 3 times the post width (so 12 inches for a 4×4 post) and one-third the total post length deep.

In well-drained soils, some builders use compacted gravel instead of concrete. Gravel allows water to drain away from the post base and makes future post replacement easier. However, concrete is stronger and required by code in many areas.

Gate Planning

Plan gate locations before setting posts. Standard walk-through gates are 36–42 inches wide. Drive-through gates need 10–16 feet of opening. Gate posts should be larger (6×6 instead of 4×4) and set deeper because they bear the swinging weight and repeated stress.

Account for hardware clearance. The gate opening should be 1–2 inches wider than the gate itself to allow for hinge swing and seasonal wood expansion.

Cost Estimation

MaterialCost per Linear Foot150 ft Fence Total
Pressure-treated pine$15–$25$2,250–$3,750
Cedar$20–$35$3,000–$5,250
Vinyl$25–$40$3,750–$6,000
Chain link (4 ft)$8–$15$1,200–$2,250
Composite$30–$50$4,500–$7,500

Installation typically adds $10–$25 per linear foot. The total for a professional 150-foot cedar privacy fence runs $4,500–$9,000 installed.

Before You Build

Call 811 to mark underground utilities before digging post holes. Check your property survey to confirm the boundary line. Most jurisdictions require fences to be set 2–6 inches inside your property line. Building on or over the line can result in a forced removal.

Calculate your fence materials and cost

Use our free Fence Calculator →

Frequently Asked Questions

How far apart should fence posts be?

Standard spacing is 6 to 8 feet on center. For wood privacy fences, 8 feet is most common because standard rails come in 8-foot lengths. Wind-prone areas may require closer spacing.

How deep should fence posts be set?

Bury one-third of the total post length. For a 6-foot fence using 8-foot posts, set them 24–30 inches deep. In cold climates, extend below the frost line.

How many pickets do I need for a privacy fence?

Divide total fence length in inches by picket width. For 100 feet with 5.5-inch pickets (no gap): 1,200 ÷ 5.5 = 218 pickets. Add 5–10% for waste.

How much does a wood fence cost per foot?

A 6-foot wood privacy fence costs $15–$35 per linear foot for materials, or $25–$60 per foot installed. Cedar costs more than pressure-treated pine.

Do I need a permit to build a fence?

Most municipalities require a permit for fences over 6 feet. Many also require permits for front yard fences. Check local zoning codes and HOA rules before building.