Decks & Fences
Fence Calculator
Enter your total fence length and post spacing in feet to get the posts and panels to buy, with gates and multiple runs handled, plus an optional 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 = bays + the number of separate straight runs, because each run needs an end post beyond its last bay. One 100 ft run 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
- Measure each straight run along the ground where the fence will actually sit, and enter the total length; enter the number of separate runs so end posts are counted.
- 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.
- Entering one combined length but forgetting to set the number of runs — each separate run needs its own extra end 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?
ceil(200 ÷ 8) = 25 bays, so a single run needs 25 + 1 = 26 posts. Two separate runs totalling 200 ft would need 27.
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
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-16
- Formula version:
- 1.0.0
- Region reviewed for:
- United States
- Spotted an error?
- Report a correction
Methodology
- Panel bays = total fence length ÷ post spacing, rounded UP to a whole bay. Lengths are converted to metres internally before dividing, so mixing feet and metres between fields is safe.
- Posts = bays + number of separate runs, because each straight run needs one more post than it has bays. 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.
- 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.