Rectangle Fence Perimeter Calculator

Quick answer

The rectangle fence perimeter calculator finds the perimeter and enclosed area of a rectangular yard, the length of fencing after gates, and the number of posts at your spacing.

Perimeter
Fencing needed
296
Posts
38
Enclosed area
5,000

Fencing is bought by the running foot, so the first number you need is the perimeter of the area. For a closed rectangle there are as many posts as sections (the last section returns to the first post), plus an extra post for each gate opening.

How to use the Rectangle Fence Perimeter Calculator

  1. Length
  2. Width
  3. Gates
  4. Gate width
  5. Post spacing
  6. Every result field is editable: type into Perimeter and Width plus every other field update to match.

Results update as you type, and every field accepts the units shown in its menu.

How it works

Enter the length and width of the rectangle, the number and width of gates and the post spacing. The calculator returns the perimeter, the fencing needed, the posts and the enclosed area. Type a perimeter to find the width that uses exactly that much fence.

Inputs explained

Field What to enter
Length Units: ft, m, in, yd, cm
Width Units: ft, m, in, yd, cm
Gates A number
Gate width Units: ft, m, in, yd, cm
Post spacing Units: ft, m, in, yd, cm

What each result means

  • Perimeter = 2×([Length] + [Width])
  • Fencing needed = max([Perimeter] – [Gates]×[Gate width], 0)
  • Posts = ceil([Fencing needed]÷[Post spacing] – 0.000001) + [Gates]
  • Enclosed area = [Length]×[Width]

Example values

How the main result changes when Width changes and everything else stays at the example values above:

Width (ft) Perimeter (ft)
25 250
37.5 275
50 300
62.5 325
75 350
100 400

Formula

Perimeter = 2 × (L + W) Fencing = perimeter − gates × gate width Posts = ceil(fencing ÷ spacing) + gates (closed loop)

Worked example

Inputs: Length: 100 ft; Width: 50 ft; Gates: 1; Gate width: 4 ft; Post spacing: 8 ft.
Results: Perimeter = 300 ft; Fencing needed = 296 ft; Posts = 38; Enclosed area = 5,000 ft².

Frequently asked questions

What is the perimeter of a rectangle?

Twice the sum of length and width: 2 × (100 + 50) = 300 ft.

What shape encloses the most area for a given fence?

A square (or, in theory, a circle). For 300 ft of fence a 75 × 75 ft square encloses 5,625 ft².

Do gates count as fencing?

Subtract the gate openings from the perimeter; gates are bought separately.

Cite this calculator

Speedy Calculator. (2026). Rectangle Fence Perimeter Calculator. Speedy Calculator. https://speedycalculator.com/calculators/construction/rectangle-fence-perimeter/