sodcalculator

07 Home and DIY

Fence Post Layout Calculator: Spacing & Count

Tag 07-2961 · Updated · Standard formula, shown below

Number of posts 14 posts
Actual spacing
7.69 ft
Result
Post holes
14 holes
Result
Fence length
100 ft
You entered
You enter
Fence length, Max spacing
You get
Number of posts, Actual spacing, Post holes
Rounding
0 dp · 2 dp

This fence post layout calculator works out the number of posts you need and the exact spacing between them, based on the total fence length and your preferred maximum spacing. Enter your fence length and maximum post spacing, and you get the recommended number of posts, the actual spacing, and the number of post holes to dig. It handles both feet and meters, and it automatically rounds up to whole posts so you never come up short.

Formula

The calculator uses two simple formulas:

  • Number of posts = ceil(Fence length ÷ Max spacing) + 1
  • Actual spacing = Fence length ÷ (Number of posts − 1)

Where:

  • Fence length is the total run of the fence in feet (or meters).
  • Max spacing is the maximum allowed distance between posts, in the same unit.
  • ceil() rounds up to the next whole number.

The “+1� accounts for the end post: a 100-foot fence with posts every 8 feet needs 13 posts, not 12, because you need a post at both ends. The actual spacing is then the fence length divided by the number of gaps (which is posts − 1).

Worked Example

Using the default values: fence length = 100 ft, max spacing = 8 ft.

  1. Divide 100 by 8 = 12.5.
  2. Round up to 13 (ceil).
  3. Add 1 for the end post: 13 + 1 = 14 posts.
  4. Actual spacing = 100 ÷ (14 − 1) = 100 ÷ 13 = 7.69 ft.

So you need 14 posts and the spacing between each post will be 7.69 feet (about 7 ft 8 in). This matches the calculator output exactly.

Why Post Spacing Matters

Post spacing isn’t just about looks—it directly affects the strength and longevity of your fence. If posts are too far apart, the rails sag, the fence can blow over in high winds, and gates may pull out of alignment. If they’re too close, you waste money on extra posts and digging. The right spacing depends on the fence type:

  • Chain link: typically 8–10 ft apart, with line posts and terminal posts at corners and gates.
  • Wood privacy: usually 6–8 ft apart, depending on rail strength and local wind loads.
  • Vinyl/PVC: often 6–8 ft, but check the manufacturer’s spec—some systems require 5 ft.
  • Farm/field fence: can be 10–12 ft or more, but wire tension and terrain matter.

Always check your local building code or HOA rules—many have maximum spacing requirements that override the “typical� values.

How to Use the Calculator

Enter your total fence length (measure along the line where the posts will go, not the ground distance if there’s a slope) and the maximum spacing you want. The calculator gives you:

  • Number of posts – the total including both end posts.
  • Actual spacing – the even distance between posts, which will be equal to or less than your max.
  • Post holes – same as the number of posts, since each post needs a hole.

If you have corners, gates, or changes in direction, treat each straight run separately. A corner post counts as the end of one run and the start of another, so you don’t double-count it—just calculate each run and add the total, then subtract the number of shared corners.

Common Mistakes

People often forget the end post, leading to a fence that’s one post short. Another frequent error is mixing units—if you measure the fence in feet but enter the spacing in meters, you’ll get a wildly wrong count. Always use the same unit for both. Also, don’t forget to account for gates: a gate opening needs posts on both sides, and the gate itself is not part of the fenced run. If you’re using concrete for setting posts, the hole depth and width depend on frost depth and soil type—check local guidance. Finally, this calculator gives the minimum number of posts for your max spacing; if you want a sturdier fence, you can always add more posts and the calculator will show the resulting spacing.

Cost and Material Considerations

The number of posts directly affects your material cost. Each post costs a certain amount, plus concrete, gravel, and labor for digging. If you’re buying posts, they come in whole lengths—you can’t buy 13.4 posts. The calculator rounds up, so you’ll know exactly how many to purchase. For a 100-ft fence, going from 8-ft spacing to 6-ft spacing increases the post count from 14 to 18—that’s 4 extra posts, which could add 20–30% to your post cost. It’s worth deciding on spacing based on both structural needs and budget.

Alternatives and Variations

If you prefer a simpler rule of thumb, many fence builders use “divide the length by the spacing and add one,� but that forgets the rounding up, which can leave you short. Another method is to set the spacing exactly (e.g., 8 ft) and then cut the last section shorter, but that looks uneven and is harder to build. This calculator gives even spacing, which is the most common and professional approach. For very long runs, you might also consider using a post layout tool or string line to mark positions, but the math is the same.

Frequently Asked Questions

How many posts do I need for a 100-foot fence with 8-foot spacing?

You need 14 posts. The calculation is 100 ÷ 8 = 12.5, round up to 13, then add 1 for the end post, giving 14. The actual spacing will be 7.69 feet.

Do I need a post at every corner?

Yes, every corner and every gate opening needs a post. For a rectangular yard, you have 4 corners, but each corner post is shared by two runs. Calculate each run separately, then subtract the shared corners to avoid double-counting.

What if my fence is on a slope?

Measure the horizontal distance, not the ground distance along the slope. The calculator uses horizontal length, so if you measure along the ground, you’ll overestimate the number of posts. For steep slopes, you may need to step the posts or use a racked fence design, which can affect spacing.

Can I use this calculator for a garden fence or temporary fence?

Yes, the math works for any fence. Just adjust the max spacing based on the fence type. For a light garden fence, you might use 6–8 ft; for a temporary snow fence, 10–12 ft is often fine.

How deep should fence posts be set?

General guidance is to set posts at least one-third of the post length into the ground, and the hole should be below the frost line. For a 6-ft fence, that usually means a 2-ft hole. Check local building codes for frost depth and recommended concrete footings.

What if my fence length isn’t a whole number?

That’s fine—the calculator handles decimals. For example, a 75.5-ft fence with 8-ft spacing gives 75.5 ÷ 8 = 9.44, round up to 10, plus 1 = 11 posts, with actual spacing of 7.55 ft.

Related

Formula used
in fl | Fence length | ft | 100 | 1 | 10000
in ms | Max spacing | ft | 8 | 1 | 100
out posts | Number of posts | posts | ceil(fl / ms) + 1 | 0
out sp | Actual spacing | ft | fl / (posts - 1) | 2
out holes | Post holes | holes | posts | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More in this bed

The whole Home and DIY bed →