Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Fence Posts Needed
20
posts (corners included)
Total Perimeter 160 ft
Post Spacing 8 ft

What This Calculator Does

This tool estimates how many fence posts you need to enclose a rectangular yard. You provide the yard's length, width, and the desired spacing between posts, and it returns the total number of posts required—with the four corners automatically accounted for. It's a quick planning aid for fencing projects, garden enclosures, and material budgeting.

Rectangular yard outline with evenly spaced fence posts including corner posts
Fence posts spaced evenly around a rectangular yard, with a post at each corner.

How to Use It

Enter the length and width of your yard in feet, then enter the post spacing—the distance you want between adjacent posts (commonly 6 to 8 feet for wood fences). Click calculate to see the total number of posts plus the full perimeter. Buy a few extra posts to allow for gates and uneven ground.

The Formula Explained

First the perimeter is found as \(P = 2 \times (L + W)\). Dividing the perimeter by the spacing gives the number of spans, and because each span ends at a post, the number of posts equals the number of spans around a closed loop. We round up with the ceiling function so the spacing never exceeds your chosen maximum:

$$\text{Posts} = \left\lceil \frac{2\left(\text{Length (ft)} + \text{Width (ft)}\right)}{\text{Spacing (ft)}} \right\rceil$$

Because the loop closes back on itself, corner posts are naturally included in this count.

Advertisement
Diagram of post spacing s along a single fence segment between two posts
Post spacing s is the distance between two adjacent posts along the perimeter.

Worked Example

For a yard that is 50 ft long and 30 ft wide with posts every 8 ft: the perimeter is

$$2 \times (50 + 30) = 160 \text{ ft}$$

Dividing by 8 gives 20 spans, so you need 20 posts. If the spacing were 7 ft, \(160 / 7 = 22.86\), which rounds up to 23 posts.

FAQ

Are corner posts included? Yes. Treating the fence as a closed loop means the count already includes the four corners.

What about a gate? A gate replaces a span, not usually a post. Add 1–2 spare posts for gate framing to be safe.

Why round up? Rounding up guarantees no gap exceeds your chosen spacing, keeping the fence sturdy and evenly supported.

Last updated: