1. Mark the ends and corners
Drive a stake at each end and every corner of the fence line. Every change of direction starts a new straight side. If the fence is near a boundary, confirm the line against your survey or plat first.
2. Measure each straight side
Measure from stake to stake along each side, including the gate openings. Write the sides down in order as you walk the line; that order tells the calculator which sides share a corner post.
On sloped ground, the distance along the slope is longer than the level distance. Panels can be stepped (each level) or racked (following the slope), and rails span differently in each case. Check which your product needs and measure the distance it spans.
3. Place each gate
For every gate, measure from the start of its side to where the gate opening begins, then the opening width. Use the post-to-post opening the gate maker specifies, not the width of the gate leaf.
4. Choose a maximum post spacing
Pre-built panels set the spacing for you. For a fence built from rails and pickets, the maximum span comes from the rail size and the maker’s guidance. The calculator divides each stretch into the fewest equal sections that don’t exceed it.
Why gates and corners change the count
For one straight side with no gates, posts = sections + 1. Every gate splits a side into two stretches and adds a post; every corner between joined sides is one shared post, not two. Examples at 8 ft maximum spacing:
| Layout | Sections | Posts |
|---|---|---|
| One 100 ft side | 13 | 14 |
| One 40 ft side, 4 ft gate starting at 10 ft | 6 | 8 |
| Two 50 ft sides joined at a corner | 14 | 15 |
| Four 25 ft sides closed into a square | 16 | 16 |
Before you dig
Call 811 before digging post holes. Post depth, fence height and setbacks are often set by local code or HOA rules, and some places require a permit.