How this calculator works
A rectangle has two equal lengths and two equal widths. Gates replace a portion of that boundary but do not change the enclosed area. Area-and-perimeter mode solves a quadratic and reports the larger side as length. Gate widths are a total takeoff; each individual gate must also fit on its actual side.
Formula
P = 2(L + W); area = L x W; fencing = P - total gate widths; given area A and half-perimeter s, L = [s + sqrt(s² - 4A)]/2 and W = A/L.
Worked example
A 10 m by 5 m enclosure has a 30 m perimeter and 50 m2 area. A 2 m gate leaves 28 m of fencing.
Advertisement
Frequently asked questions
Does this count fence posts?
No. Post spacing, corners and gate supports need a layout. Use the fence calculator for a material estimate.
Why can area and perimeter be incompatible?
For a fixed perimeter the square encloses the greatest area. Larger entered areas cannot form a rectangle with that boundary.
Can I include several gates?
Yes. Enter their combined clear opening width and check each gate location separately.