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
- Length
- Width
- Gates
- Gate width
- Post spacing
- 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.
Tips for an accurate estimate
- Take measurements at floor level and at the ceiling – walls and rooms are often slightly out of square.
- Use the manufacturer’s coverage, spacing and installation data when it differs from the typical values here.
- Keep a little extra of every finish material for touch-ups and repairs later.
- Check local building codes and permits before structural, electrical, plumbing or gas work.
Common mistakes to avoid
- Sizing heating or cooling equipment by area alone when insulation, windows and climate make a big difference.
- Buying too little paint, stain or flooring and ending up with mismatched batches.
- Overlooking the extra material for steps, railings, gables and trim.
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 widthPosts = 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.
What formula does the Rectangle Fence Perimeter Calculator use?
Perimeter = 2 × (L + W).