Decks & Fences
Fence Calculator
Enter one straight fence length or a comma-separated list of section lengths in feet. Each section is rounded independently, joined corners share posts, and optional supplier prices produce a material cost estimate.
Formula tested · Local units · No sign-up
Project inputs
Enter measurements
Use your preferred units. Results update automatically.
Show the calculation methodFormula, conversions, rounding, and assumptions+
Panel bays = fence length ÷ post spacing, rounded up. US privacy and picket fences are commonly built in 6 ft or 8 ft bays — a 100 ft fence at 8 ft spacing needs ceil(100 ÷ 8) = 13 bays.
Posts = total bays + the number of disconnected fence lines. Straight sections that join at corners share those corner posts. One 100 ft line at 8 ft spacing needs 13 + 1 = 14 posts.
Each gate occupies one bay and hangs on posts already counted, so panels to buy = bays − gates.
Real-world example
Worked example: 100 ft fence, 8 ft post spacing, 1 gate, 1 run
- Panel bays: 100 ÷ 8 = 12.5 → round up to 13 bays.
- Posts: 13 bays + 1 run = 14 posts.
- Panels to buy: 13 bays − 1 gate = 12 panels.
- Example cost: 14 posts × $25 = $350; 12 panels × $55 = $660; materials $1,010.
- Example 7% sales tax: $1,010 × 0.07 = $70.70.
Buy 14 posts and 12 panels (plus the gate, priced separately). With the example prices above and 7% tax, the estimate is $1,080.70 — enter your supplier's quote and your local rate.
Before you start
How to measure
- For one straight fence section, enter its length directly. Where the fence turns, enter every straight-section length as a comma-separated list so each partial bay is rounded separately.
- Use one disconnected fence line when those sections join through shared corner posts. Increase the disconnected-line count only for lines that do not share an end or corner post.
- Choose post spacing to match the panels or rail lengths you're buying — 6 ft and 8 ft bays are the common US choices; pre-built panels dictate the spacing exactly.
- Count each gate as one bay; wide double gates may effectively occupy more than one bay, so adjust the gate count if needed.
Local guidance
Notes for United States
- Confirm the property line before setting any post — a survey or plat map beats guessing, and a fence on the neighbor's side of the line is an expensive mistake.
- Check local rules first: many cities and HOAs limit fence height and placement, and some require a permit.
- Call 811 before you dig. It's the free national utility-location service; buried lines are marked before you auger post holes.
- Post holes are typically backfilled with concrete below the local frost line where freezing occurs — this tool does not estimate concrete; see the post-hole concrete calculator.
- Sales tax varies by state and locality and is entered manually.
Quick reference
Common US post spacings (planning values)
| Fence style | Common bay width |
|---|---|
| Pre-built privacy panels | 6 or 8 ft (match the panel) |
| Stick-built privacy fence | 6–8 ft |
| Picket fence | 6–8 ft |
| Chain link | up to 10 ft (different system — this tool models panel bays) |
Planning values only — the panels or rails you buy set the real spacing.
Good to know
Common mistakes to avoid
- Digging without calling 811 first.
- Building on an assumed boundary line instead of a surveyed one.
- Pooling several straight-section lengths into one number — partial bays do not carry around a corner, so enter the individual lengths instead.
- Counting joined corner sections as disconnected lines — that double-counts the shared corner post.
- Forgetting that panels are sold in fixed widths: if you buy 8 ft panels, the spacing field must be 8 ft, not a rounded metric guess.
- Leaving gate hardware, concrete and fasteners out of the budget — this estimate covers posts and panels only.
Need help?
Frequently asked questions
How many posts for 200 ft of fence at 8 ft spacing?
One straight 200 ft line has ceil(200 ÷ 8) = 25 bays and needs 26 posts. For multiple sections, enter each length separately because each section rounds independently; add one end post per disconnected fence line.
Do I really need to call 811?
Yes — it's free, it's the law in most states before digging, and post-hole augers reach deep enough to hit gas, power and communication lines. Call or submit online a few business days before you dig.
How does the calculator handle gates?
Each gate takes over one panel bay and hangs on posts already counted, so a 13-bay fence with 1 gate needs 12 panels plus the gate itself. Gates, hinges and latches are priced separately from this estimate.
Keep planning
Related calculators
Measure with confidence
Planning guides for this project
Transparency
About this calculator
- Written by:
- BuildMeasure Editorial Team
- Technically reviewed by:
- Pending independent technical reviewer (formula unit-tested; see methodology)
- Last reviewed:
- 2026-07-20
- Formula version:
- 1.2.0
- Region reviewed for:
- United States
- Spotted an error?
- Report a correction
Methodology
- For one straight section, panel bays = section length ÷ post spacing, rounded UP. For a fence with corners, enter every straight-section length: the calculator rounds each section separately before adding its bays, so pooled partial bays cannot cause an under-order. Lengths are converted to metres internally.
- Posts = total bays + number of disconnected fence lines. Straight sections in one connected line share their corner posts; each disconnected line needs one additional end post. Exact multiples are not bumped up an extra bay.
- Each gate is assumed to occupy one bay and hang on posts already counted, so panels to buy = bays − gates. Gates and gate hardware are never costed by this tool.
- The cost estimate multiplies the post and panel counts by the prices you enter, then applies the tax rate you enter. No prices are built in.
- When prices are entered, material cost per foot or metre = the tax-inclusive calculated material total ÷ the full measured fence length in the region's default length unit. It is a comparison rate, not a contractor quote, and excludes gates, concrete, fixings, delivery and labour.
- The formula is covered by automated unit tests, including hand-calculated worked examples, and is versioned (see formula version on this page).
Sources & standards
- Utility location: 811 is the US national 'call before you dig' service.
- Unit definitions: 1 ft = 0.3048 m (exact); calculations run in metres internally.
This tool provides a material estimate for planning purposes only. It is not a quotation, and it does not check boundary positions, wind loading, post embedment or local rules. Confirm the boundary line, any permit or approval requirements, and underground services before digging, and confirm quantities with your supplier before ordering.