Blog · October 28, 2026

How many fence posts do you need? Count the gaps, then add one

Home › Blog › How many fence posts do you need? Count the gaps, then add one

A fence earns its cost in everyday ways. It gives you privacy, keeps children and pets safely in, keeps animals out of the vegetable bed, marks where your property ends and puts a visible barrier between your home and the street. All of that depends on one early decision, the post count, because posts set the spacing, the cost and whether the rails will hold. Get that number right and the rest of the job goes smoothly.

You have measured the fence line, you know how far your rails or panels can span, and you are standing in the shop with a trolley. The question is simple: how many posts? The usual answer is “length divided by spacing”, and it is wrong in two different ways. It counts gaps instead of posts, and it forgets that a real fence has ends, corners and usually a gate.

Here is the sum done properly, first for one straight run, then for a whole yard.

Step 1: divide, then round up

Say the fence run is 30 ft and your rails can span at most 8 ft between posts.

30 ÷ 8 = 3.75 gaps.

You cannot build three-quarters of a gap, so round up to 4 gaps. Rounding down to 3 would make each gap 10 ft, which is wider than your rails can span. Always round this number up, never to the nearest whole number, because the spacing is a limit, not a target.

Step 2: add one post

Picture a line of posts with the gaps between them. Each gap needs a post at both ends, but neighbouring gaps share a post. An open run (two ends) therefore has gaps + 1 posts: 4 + 1 = 5 posts.

A 30 ft fence with 4 posts has 3 gaps of 10 ft, too wide for an 8 ft maximum. With 5 posts there are 4 gaps of 7.5 ft. Wrong: 30 ÷ 8 = 3.75, so 4 posts 10 ft: too wide10 ft: too wide10 ft: too wide Right: 30 ÷ 8 = 3.75, round up to 4 gaps, so 5 posts 7.5 ft7.5 ft7.5 ft7.5 ft
Four posts for a 30 ft run leave three 10 ft gaps, over the 8 ft limit. Five posts give four 7.5 ft gaps.

Step 3: find the real spacing

Spread the gaps evenly: 30 ÷ 4 = 7.5 ft between posts. That is under your 8 ft limit, and every gap is identical, so the panels or rails are all the same length. Measure and mark 7.5 ft, not 8 ft. If you set posts at 8 ft from one end you finish with a short odd gap of 6 ft, and a fence looks neater when every bay matches.

Step 4: go all the way round

A closed loop, such as a yard fenced on every side, has no end posts. The last gap runs back into the first post, so the number of posts equals the number of gaps.

Take a yard that is 30 ft × 20 ft. The perimeter is 2 × (30 + 20) = 100 ft. The shortcut is to divide 100 by 8, get 12.5, and round up to 13 posts. Look at what happens when you do it side by side instead:

The shortcut came out one post short, because each side has to be rounded up on its own. A corner post is a real post that sits between two sides, and you cannot put a post at “half a corner” to make the total work out.

Plan of a 30 by 20 foot yard fenced all round with a 4 foot gate in one long side: 4 gaps of 7.5 feet on the other long side, 3 gaps of 6.67 feet on each short side, and 2 gaps of 6.5 feet on each side of the gate, so 15 posts in all. A 30 ft × 20 ft yard, fenced all the way round 30 ft: 4 gaps × 7.5 ft 20 ft: 3 gaps × 6.67 ft 20 ft: 3 gaps × 6.67 ft 13 ft: 2 × 6.5 gate 4 ft 13 ft: 2 × 6.5 15 posts Closed loop: posts = gaps 4 + 3 + 4 + 3 = 14, plus 1 for the gate Amber: corner posts. Green: gate posts. A gate in a 30 ft side adds one post.
A 30 by 20 foot yard fenced all round with a 4 foot gate in one long side: 15 posts in all, with corners and gate posts marked.

Step 5: add the gate

Now say you want a 4 ft gate in the middle of one 30 ft side. The gate takes up 4 ft of the run, which leaves 30 − 4 = 26 ft of fence, or 13 ft on each side of the gate.

One post more than before. The two posts either side of the gate have to carry a swinging door, so you will normally choose a sturdier post for those. Your shopping list is then 13 ordinary posts plus 2 gate posts, 14 fence bays and one gate.

Bar comparison for a 30 by 20 foot yard: dividing the 100 foot perimeter by 8 gives 13 posts, which is too few; rounding each side up gives 14; adding a 4 foot gate in a long side gives 15. Posts for the 30 ft × 20 ft yard, three ways Divide the perimeter: 100 ÷ 8 = 12.5, round up 13: too few Round each side up on its own (4 + 3 + 4 + 3) 14 posts Same yard with a 4 ft gate in a long side 15 posts Each side is rounded up on its own, so one 100 ft total is not enough.
Posts for the 30 by 20 foot yard: 13 by dividing the perimeter, 14 by rounding each side up, 15 with a gate.

Step 6: check the spacing you ended up with

Before you buy, read the spacing off your sketch, side by side.

The bays are not all the same length around the yard, and that is normal. They only need to be the same along each straight side, so that the panels on one side match each other.

Common slips

Rule of thumb

Gaps = length ÷ maximum spacing, rounded up. Open run: posts = gaps + 1. Closed loop: posts = gaps. Do each side separately and sketch the gate before you buy.

Count your own run

The free Fence Post Counter does open and closed runs with corners and gates, and gives the real spacing. It comes from Fences That Stand Straight, Book 2 of Built by Numbers.

fences-that-stand-straight cover
Fences That Stand StraightSee the chapters, free calculators and printable sheets.

This is arithmetic for planning, not an engineering design. Follow your local building department and the product instructions.

Follow on Bluesky or by RSS.