Fence Calculator
Find how many fence panels or posts you need from your fence length, gates, and spacing — calculate by panels or by linear feet, plus cost.
How to use the fence calculator
- 1
Choose By panels for prefab fence sections, or By linear feet for continuous material.
- 2
Enter your total fence length, gates, and their width.
- 3
Set your panel width or post spacing, plus any corners and a waste factor.
- 4
Your panels or linear feet, posts, and cost appear instantly.
By panels vs. by linear feet
Fencing is bought two different ways, so this calculator has two modes:
- By panels — for prefabricated sections sold at a fixed width, like 6 ft or 8 ft wood or vinyl privacy panels. Panels needed = (fence length − gate widths) ÷ panel width, with your waste factor applied before rounding up.
- By linear feet — for continuous material like chain link fabric, wire mesh, or board-by-board picket fencing, where posts are set at a chosen spacing (8 ft is a common default) rather than tied to a panel width.
Worked example (by panels): A 150 ft fence with one 4 ft gate and 6 ft panels needs (150 − 4) ÷ 6 ≈ 24.3 panels before waste. Adding a 5% waste factor brings that to about 25.5 — round up to 26 panels. Posts = 26 + 1 (the panel run) + 2 (one gate) + 0 (no corners specified) = 29 posts.
Corner and gate post guidance
Corner posts sit exactly at every turn in the fence line, not wherever the straight-line spacing math happens to land. This calculator adds one post per corner you specify — treat that number as a minimum, and confirm each corner's exact position on a site sketch before ordering.
Gate posts are load-bearing in a way line posts aren't: they carry the gate's full weight and the leverage of it swinging open, so they're typically set deeper, in a wider concrete footing, and sometimes in a heavier post size than the rest of the run. This calculator adds 2 posts per gate — one on each side of the opening.
Both corner and gate posts should generally use more concrete per footing than a standard line post — see this calculator's FAQ for typical bag counts, or use the Concrete, Mulch & Topsoil Calculator for a full footing volume estimate.
Tips for slope and uneven ground
- Stepped layout: each panel stays level and horizontal, with a small vertical gap or step down to the next panel. Simpler to build and works with most prefab panels, but leaves gaps under each step.
- Raked (racked) layout: panels and rails follow the slope's angle continuously, keeping a consistent gap to the ground. Looks more seamless but needs custom-cut, angled panels rather than off-the-shelf ones.
- Measure along the actual slope, not a flat horizontal projection — a sloped run covers more true ground distance than its horizontal footprint suggests, so measuring flat will undercount your fence length.
- Set posts to a consistent height above grade relative to the ground directly beneath each post, not a single fixed height for the whole run, so the fence reads as level even as the ground beneath it changes.
- Budget extra waste for sloped or uneven terrain — 10-15% instead of the standard 5%, since angled cuts and adjustments are far more common.
Setting posts in concrete footings? Try the Concrete, Mulch & Topsoil Calculator →
Frequently asked questions
Related calculators
Find your exact age in years, months, and days, plus your birth day of the week and next birthday countdown.
Try it →Calculate your Body Mass Index and healthy weight range using metric or imperial units.
Try it →Estimate how much paint and how many gallons or liters you need for any room, with cost estimates.
Try it →Find the exact number of days, weeks, or months between any two dates, plus a business-day count.
Try it →Estimate how many boxes of tile, hardwood, or laminate flooring you need for any room, with cost estimates.
Try it →Estimate cubic yards, bags needed, and cost for concrete, mulch, or topsoil in any rectangular or circular area.
Try it →Get cubic yards, tons, and cost for driveways, paths, and drainage — includes pea gravel, crushed stone, sand, and river rock.
Try it →Find your roof's pitch ratio, angle in degrees, and slope percentage from rise and run, plus rafter length and roof area.
Try it →Find how many deck boards, joists, screws, and footing concrete bags you need from your deck's dimensions, board size, and layout — plus cost.
Try it →Find the exact offspring of any two Pals, work backward from a target Pal, or see every mutated egg outcome — all 299 Pals.
Try it →