Calcylator
Fence Length

Fence length to buy:
perimeter − gate openings

Work out the length of panels, rails or mesh for a plot once the gate openings are taken out, and turn that into panels and rails.

Calcylator Editorial Team

Updated · 6 min read

How much fencing do you need?

The fence material length is the plot perimeter minus the total gate opening. A 20 m by 12 m plot has a 64 m perimeter, and with 3.6 m of gates you need 64 − 3.6 = 60.4 metres of fencing.

The calculator takes the perimeter in metres and the total gate opening in metres, and returns the length, never below zero. The gate itself is a separate item, so it is taken out of the run of panel, rail or mesh.

Fence length formula and worked example

Fence material length =length = max(0, perimeter − gates)
perimeter:
total distance around the area to be fenced, in m
gates:
total width of all gate openings, in m
length:
fencing to buy, in m
The max(0, ...) part means the answer cannot go negative.
  • Plot

    20 m × 12 m

  • Perimeter

    2 × (20 + 12) = 64 m

  • Gate openings

    3.6 m in total

Fence length

60.4 m

64 − 3.6 = 60.4 metres.

  1. Measure every side of the area to be fenced and add them up.
  2. Measure each gate opening, and add them together.
  3. Subtract the gates from the perimeter.
  4. Use the result to count panels, rails or rolls of mesh.

Turning the length into panels and rails

Once you have the length, divide by the width of one panel or the spacing between posts. With 2.5 m panels, 60.4 m ÷ 2.5 = 24.16, so you need 25 panels, rounding up. A run of rails is the length times the number of rails per bay: three rails along 60.4 m is 181.2 m of rail.

From 60.4 m of fence
ItemCalculationQuantity
Panels, 2.5 m wide60.4 ÷ 2.5 = 24.16, rounded up25
Rail, 3 rows3 × 60.4181.2 m

A second plot shows how the numbers scale. A 30 m by 18 m field has a 96 m perimeter, and with a 4 m gate opening the fence length is 92 m. With 1.8 m panels that is 92 ÷ 1.8 = 51.1, so 52 panels, while 2.5 m panels would need 92 ÷ 2.5 = 36.8, so 37.

Posts are the usual extra. On a straight run you need one more post than there are panels, and each gate needs its own heavier posts, so count them separately.

Edge cases and checks

If you enter gate openings larger than the perimeter, the result is zero rather than a negative length. For a 48 m perimeter with 52 m of gates the answer is 0 m, which is a signal to recheck your measurements.

Fencing is also a good place to keep a spare. Keep one extra panel or a few metres of rail from the same batch, since weathered timber and a new delivery never match perfectly once the original fence has aged.

  • Measure along the actual fence line, not the property deed, because the fence may sit slightly inside the boundary.
  • Where an existing wall or building already closes one side, add that length to the gate openings figure so it is not counted as fencing.
  • Allow a little extra for uneven ground, where a panel run follows the slope.
  • Check local rules on boundary fences before you buy.

Common mistakes when estimating fencing

  • Using the area of the plot instead of its perimeter.
  • Forgetting a gate and then paying for panels you do not need.
  • Counting panels and forgetting to round up.
  • Mixing feet and metres, which makes the total wrong by a factor of three.

Common questions

How do I calculate how much fencing I need?

Add up the length of all sides to get the perimeter, then subtract the total width of gate openings. A 64 m perimeter with 3.6 m of gates needs 60.4 m of fencing. The answer is never below zero.

Do I subtract the gate from the fence length?

Yes. Gates are bought separately, so remove their opening width from the perimeter. The calculator does this: length = perimeter − gates, with a minimum of zero, so the number shown is the fencing material to buy.

How many fence panels do I need?

Divide the fence length by the width of one panel and round up. For 60.4 m of fence and 2.5 m panels, you need 60.4 ÷ 2.5 = 24.16, so 25 panels. Add posts, which are usually one more than the panels.

What if the gate width is more than the perimeter?

The calculator returns 0 m, because the fence length cannot be negative. This usually means a measurement is wrong, so recheck the perimeter and gate widths before you order any material.

Was this guide helpful?

Continue reading

View all blogs