Fence Calculator

Work out how much fencing a run needs — panels, posts and rails, from the fence length and your panel width.

A fence is panels, posts and rails — and the counts follow one another: panels from the length, posts one more than panels, rails two per panel. This calculator gives you all three.

Measure the run, enter the panel width, and the materials follow.

Measure the run along the ground. For a perimeter, add all four sides.
Common: 8 ft (2.44 m) panels, or 6 ft panels.
Enter your local price — the calculator never guesses prices.

Formula

panels = ⌈ fence length ÷ panel width ⌉ posts = panels + 1 (one post at each end, one between panels) rails = panels × 2 (two horizontal rails per panel)

All lengths are converted to a single unit before the calculation: 1 ft = 0.3048 m, 1 in = 25.4 mm, 1 ft² = 0.09290304 m², 1 yd² = 9 ft². Material quantities are rounded up — you cannot buy part of a tile, plank or bag.

How to use this calculator

  1. Measure the fence run along the ground.
  2. Enter the panel width (usually 8 ft).
  3. Add a price per panel if you want a cost estimate.

Worked example

Fence length100 ft
Panel width8 ft
Panels⌈100 ÷ 8⌉ = 13 panels
Posts13 + 1 = 14 posts
Rails13 × 2 = 26 rails

Check it by hand: every step above uses the formula in the box. If your numbers match the example inputs but the calculator gives a different answer, please report it via the contact page.

Frequently asked questions

How many fence panels do I need?

Divide the fence length by the panel width and round up. A 100 ft run with 8 ft panels needs 13 panels — the last panel is cut to fit. This calculator does the same maths for your run.

How many fence posts do I need?

One more than the number of panels — a post at each end and one between every two panels. 13 panels need 14 posts.

How deep should fence posts be?

At least one-third of the post length in the ground — 2 ft deep for a 6 ft fence — set in concrete. Post depth is structural: in frost areas, set posts below the frost line, and check local codes.

What about gates?

A gate replaces one panel and needs its own posts and hardware. Measure the gate opening separately and subtract one panel per gate from the count above.

Related calculators

Estimates only. Results are for planning. Measure twice, confirm box coverage and tile sizes on the packaging you buy, and follow the manufacturer's instructions. See the disclaimer.