Fence Calculator
Estimate your total fence cost and the number of posts and sections needed from length, price per foot, post spacing and gates.
Reviewed by the CalcCafe editorial team · Last updated 1 July 2026 · How we test our tools
Example
A 150 ft fence at $25/ft with posts every 8 ft and one $200 gate needs 20 posts across 19 sections (150 ÷ 8 = 18.75, rounded up to 19 sections, plus one post to close the run). The materials estimate is 150 × $25 + 1 × $200 = $3,950.
How it works
Sections = ceil(length ÷ post spacing), and posts = sections + 1 because a straight run needs one extra post to finish the last section. Total cost = length × price per foot + number of gates × cost per gate.
Good to know
A fence project comes down to two questions: how much will it cost, and how many pieces do I actually have to buy? This calculator answers both from a handful of numbers you already know — the run length, a rough price per linear foot, how far apart you want your posts, and how many gates you plan to hang. As you type, it returns a total budget alongside the post and section counts that drive most of your hardware list.
Post spacing is the input worth thinking about. Most wood and vinyl fences use 6 to 8 foot spacing, while chain-link often stretches to 10 feet. Closer spacing means more posts, more concrete, and a sturdier fence; wider spacing saves money but can sag or flex in wind. Because the tool rounds the number of sections up, the final section may be shorter than the others, which is normal — you trim the last panel or rail to fit.
The price-per-foot figure should reflect installed or materials cost depending on what you are estimating. Basic chain-link may run a few dollars a foot in materials, pressure-treated wood privacy fence considerably more, and ornamental aluminum or composite more still. Gates are priced separately here because a gate kit, hinges, and latch usually cost far more per opening than the equivalent length of plain fence.
Treat the result as a planning estimate, not a quote. It does not add concrete, fasteners, caps, stain, permits, or labor, and it assumes a single straight run rather than corners that each need their own post. For a firm number, get itemized quotes and measure your actual property line.
Frequently asked questions
How do I figure out how many fence posts I need?
Divide the total fence length by your post spacing and round up to get the number of sections, then add one. A straight run always needs one more post than sections because each section is bounded by a post on both ends.
Does this include concrete, labor and hardware?
No. It estimates fence material cost by length plus the cost of your gates. Concrete, fasteners, post caps, stain, permits, and installation labor are not included, so add those separately for a full budget.
Is my data uploaded anywhere?
No — this calculator runs entirely in your browser. Your inputs never leave your device, and it works offline once loaded.
Is this calculator free?
Yes, completely free with no sign-up and no limits.
People also ask
How far apart should fence posts be?
Wood and vinyl fences are commonly spaced 6 to 8 feet apart, while chain-link can go up to 10 feet. Closer spacing adds strength and cost; check the manufacturer's panel or rail lengths so posts line up with your sections.
How much does a fence cost per foot?
It varies widely by material — chain-link is usually the cheapest per foot, wood privacy fence more, and aluminum or composite the most. Enter your local price per foot to see a total; the tool multiplies it by your length and adds gate costs.
Why do I need one more post than sections?
Each fence section spans the gap between two posts, so a straight line of N sections is capped by a post at both ends, giving N + 1 posts total. Corners and gate openings can require additional posts beyond that.
Related calculators
Sources & references
These tools follow our methodology and provide educational estimates only — verify important figures with a qualified professional.