Rectangle Fence Perimeter Calculator

Find the fence length a rectangular plot needs from its length and width.

Nine length units, eight area units, and an optional gate opening.

Updated October 29, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Loading calculator…

Introduction

A fence around a rectangular plot is one continuous run, so the amount of fence you buy is the distance all the way round: the perimeter. This page works that out from the two sides of the rectangle, keeps the area alongside it, and takes a gate opening out of the run when you tick the checkbox.

It answers a buying question rather than a survey one. A garden boundary, a paddock, a yard around a building or a hoarding around a site all reduce to the same two numbers — the two sides that meet at a corner — and the answer is the length you take to a supplier. If your quote is already in your hand, the page runs the other way and works out the side of the plot from the total length of fence on it.

The part people get wrong is the pair of sides. Length and width are the two sides meeting at one corner, not the two long runs of a plot with a gate in the middle, and not the distance from post to post. Measure the line the fence will sit on, and the rest is a multiplication and an addition.

Nine length units

Includes feet and inches, and metres and centimetres as two boxes

Any box can drive

Give a perimeter, an area or one side, and the others follow

Opening counted once

One gate width is subtracted from the perimeter, no more

Quick start

1

Enter the two sides of the rectangle

Length is the longer side, width the shorter one, and they have to meet at a corner. If the length you type is smaller than the width, both boxes turn red with a reminder, but the numbers stay on screen and the formulas still run, so you can see what you typed instead of losing it.

2

Or type what you actually have

A measured perimeter and one side will fill in the other side. So will an area and one side, which is the useful route when a deed or a land listing gives the area but no dimensions. The pair has to include a side, then the two boxes you left alone are worked out from it.

3

Tick the checkbox if there is a gate

The gate box then appears with 1 m in it. Replace that with the clear opening between the gate posts. From that moment the result box is no longer the perimeter: it is the fencing length, the perimeter with the opening taken out.

4

Read the result

A 30 m × 20 m plot with a 4 m gate. The perimeter is 100 m without the gate, and 96 m of fencing once the opening is subtracted:

P=2 (30+20)P = 2\,(30 + 20)==100 m100\ \mathrm{m}→\rightarrow100−4100 - 4==96 m96\ \mathrm{m}

The area box shows 0.06 ha for the same plot, which is 600 m². That is the number to check before you go shopping: the fence figure is 96 m of run, and the area is only there to help you confirm the plot is the one you think it is.

How the numbers fit together

Two equations, both of them statements about the same rectangle. The perimeter walks round the four sides; the area fills the space inside. Neither one needs a special case for a gate — the opening is simply subtracted from the perimeter once.

P=2 (L+W)P = 2\,(L + W)
Pf=2 (L+W)−oP_{\mathrm{f}} = 2\,(L + W) - o
A=L×WA = L \times W
LLLength of the rectangle, the longer side
WWWidth of the rectangle, the shorter side
PPFence perimeter, one full lap of the four sides
ooClear gate opening between the gate posts
PfP_{\mathrm{f}}Fencing length: the perimeter with the opening taken out
AAArea inside the rectangle, not a length of fencing

Every box can be solved from the others

The arithmetic is reversible, and that is what makes the page useful when a number arrives from somewhere else — a survey, a quote, a land listing. Each of these rearrangements is a real direction the page will take:

LL==P2−W\frac{P}{2} - W\qquadWW==AL\frac{A}{L}
oo==2 (L+W)−Pf2\,(L + W) - P_{\mathrm{f}}\qquadLL==Pf+o2−W\frac{P_{\mathrm{f}} + o}{2} - W

The second worked example takes the last of those four through from a contractor's quote: one dimension comes out of a fencing total, a gate width and one measured side.

Area is not a length, and it does not fix a perimeter

One area can belong to an endless number of rectangles, and they do not all need the same amount of fence. Squeeze the same field into a long strip and the perimeter grows while the area stays put. That is why the area box asks for one side as well, and why the page can never turn an acreage on its own into a fencing figure:

PP==2(L+AL)2\left(L + \frac{A}{L}\right)

Of all the rectangles with a given area, the square needs the least fence, and a square of area AA has a perimeter of 4A4\sqrt{A}. Every other shape costs more. The third example below puts numbers on that difference for a one-acre field.

Corners, gates and the parts that are not fence

A corner is a turn, not extra fence: the perimeter already counts each side once, and the length that goes round the corner is the same length that was already in the sum. What a corner does need is a post and bracing, and a gate needs two posts of its own, a leaf, hinges and the clearance to swing — none of which is a linear length of fence.

The opening is therefore subtracted exactly once, from the run. If the gate sits in a side of 30 m, you lose 4 m of fence there and buy a 4 m gate on top; the page reports the 96 m of fence and leaves the gate to you.

Worked examples

1

A back garden measured in feet and inches

Situation: A plot 82 ft 6 in one way and 54 ft the other, entered in the feet-and-inches boxes, with a 10 ft gate on the long side.

Inputs

Length (L)82 ft 6 in
Width (W)54 ft
Gate opening (o)10 ft

Result

2 (82.5+54)2\,(82.5 + 54)==273 ft273\ \mathrm{ft}→\rightarrow273−10273 - 10==263 ft263\ \mathrm{ft}

The area of the same plot is 4,455 ft², which the area box reads as 0.10 acre.

In practice: Order 263 ft of fence for the run, and keep the gate, its two posts and the hinges as separate items. The 4,455 ft² is about a tenth of an acre, which is worth knowing if you are pricing the plot rather than the fence.

2

Working backwards from a fencing quote

Situation: A contractor quotes 140 m of fencing, the gate is 3 m wide, and the plot is 25.5 m across one way. You want the other dimension to check the quote against your own drawings.

Inputs

Fence length140 m
Gate opening3 m
Width (W)25.5 m

Result

LL==140+32−25.5\frac{140 + 3}{2} - 25.5==46 m46\ \mathrm{m}

Check in the other direction

2 (46+25.5)−32\,(46 + 25.5) - 3==140 m140\ \mathrm{m}

In practice: A 46 m plot side with a 25.5 m one gives an area of 1,173 m², so the quote covers 140 m of fencing around a little over a tenth of a hectare. If your drawing says 42 m rather than 46 m, the quote is 8 m of fence too long — worth spotting before the deposit.

3

One acre, square or long

Situation: A one-acre field, which is 4,046.86 m². Two layouts are on the table: a square, and a rectangle twice as long as it is wide. Both hold one acre; the fencing bills are not the same.

Inputs

Area (A)1 acre
Square side63.615 m
2 : 1 sides44.98 m × 89.97 m

Result

4×63.6154 \times 63.615==254.46 m254.46\ \mathrm{m}≈\approx835 ft835\ \mathrm{ft}
2 (44.98+89.97)2\,(44.98 + 89.97)==269.90 m269.90\ \mathrm{m}≈\approx885 ft885\ \mathrm{ft}

Where those sides come from

Square side=A=63.615 m\text{Square side} = \sqrt{A} = 63.615\ \mathrm{m}\qquad2 : 1 short side=A2=44.98 m\text{2 : 1 short side} = \sqrt{\frac{A}{2}} = 44.98\ \mathrm{m}

In practice: The shape decides the bill. On a single acre the difference is about 50 ft of fencing, and it grows with the area and with how long and thin the plot gets. Neither layout is wrong; the square is simply the cheaper boundary for the same ground.

Measuring and ordering advice

Measure the fence line, not the deed line

Fences usually sit inside the boundary rather than on it, and a hedge, a ditch or a right of way can push the line further in. Walk the line the posts will follow and measure that; the perimeter of the deed is a different shape and can be a different length.

Check the area unit before you type

The area box is set to hectares when the page opens, and a hectare is 10,000 m². A metric plot of 600 m² is 0.06 ha, not 600 ha — a factor of ten thousand, which is the sort of slip that turns a garden into a farm.

Square metres, square feet, square yards, ares, decares and acres are all a tap away.

Measure the opening between the posts

A gate opening is the clear gap the gate closes, so measure from the inside face of one gate post to the inside face of the other. Measuring centre to centre adds half a post at each end and quietly shortens the fencing figure.

Leave room for the leaf to swing, and for a hinge and a latch on each side: a 4 m opening does not take a 4 m gate.

Order for the run, then add the rest

The result is the length to fit, with no waste. Boards split, panels arrive short and the last bay is trimmed to suit, so 5–10% over the figure is the usual allowance on a timber run.

Posts, rails, pickets and the concrete for the footings come from the same run length: the fence calculator turns it into those quantities.

Questions

Q

Can I use this for an L-shaped or irregular plot?

Not directly, because a plot with a notch or a bend is not one rectangle. Split it into rectangles, run each one, and add the lengths of the outside edges only — the side the two rectangles share is not fenced twice, so it comes off one of the two results. Expect the total to be longer than the square of the same area: every bend away from a square adds fence.

Q

My gate is in the short side. Does that change the answer?

No. The opening is subtracted once from the perimeter wherever it sits, so a 96 m result is 96 m of fence whether the gate is in the long side or the short one. What does matter is that the gate has to fit the side it is in: keep the opening narrower than both sides, and remember that the page compares it with the length box, which is the longer of the two.

Q

Is the gate itself included in the fencing figure?

No. Only the run of fence that the gate replaces is taken out. The leaf, the two gate posts, the hinges, the latch, the concrete for those posts and the clearance the gate needs to open are all separate items, and none of them is a linear length of fence.

How far to trust the number

  • A rectangle, not a survey. The answer describes the four sides you typed. It does not check where the boundary actually runs, whether a fence is allowed there, or whether a neighbour has a claim on the ground — those belong to the deed, the local authority or a surveyor.
  • Plan length, not ground length. A fence that follows a slope is longer than the same run measured flat, and a run that steps down a bank is longer still. On noticeably uneven ground, measure along the line the posts will follow rather than scaling off a plan.
  • No waste, no whole panels. The figure is the length to fit. Timber needs an allowance for splits and trimmed ends. A panel system has to close in whole spans, so the last panel is cut and the count is rounded up — the vinyl fence calculator turns the run into spans, columns and panels.
  • The opening check compares one side only. A gate wider than the length box is flagged, but a gate wider than the width box is not caught. Physically an opening cannot be wider than the side it sits in, so keep it below both.
  • Fence only. Posts, bracing, gravel boards, gates, fixings, concrete and labour are outside the figure, and so is the extra run a corner post or an end post can add by standing proud of the line.
  • Two totals do not add up to a plot on their own. An area and a perimeter typed together leave the two sides blank, even though one rectangle does satisfy both. Enter one side as well — or replace one total with a side — and the remaining boxes fill in.
  • Boundary rules are local. Height limits, setback distances, the obligation to keep a boundary stock-proof, and whether you may build at all depend on where the plot is. A correct length does not make a permitted fence: settle that with the local authority before the posts go in.
Rectangle Fence Perimeter Calculator - Fence Length and Area