A straight 150 ft wood fence with posts every 8 ft needs 20 posts, or 21 if it has one gate. The rule: divide the fence length by the post spacing, round up to get the number of sections, add one post to close the last section, then add one more post for each gate. Wood fence posts are typically set 6 to 8 ft apart, so the spacing you pick changes the count a lot on a long run.
This calculator needs JavaScript. The formula and a worked example are explained in the article below.
Quick chart: fence posts for straight runs
Straight fences with no gates. Add one post per gate.
| Fence length | Posts at 8 ft spacing | Posts at 6 ft spacing |
|---|---|---|
| 50 ft | 8 | 10 |
| 100 ft | 14 | 18 |
| 150 ft | 20 | 26 |
| 200 ft | 26 | 35 |
When the length doesn’t divide evenly, the calculator rounds the section count up, so every section ends up a little shorter than the maximum spacing rather than longer. A 100 ft run at 8 ft becomes 13 sections of about 7 ft 8 in.
How to measure the fence line

Measure along the actual fence line, not the lot line on a map, and write down each straight side separately.
- Straight runs: one tape measurement from end post to end post.
- Corners: measure each side to the corner. Each straight side is laid out on its own.
- Gates: note where they go and how wide each opening is.
- Slopes: post spacing is measured level. Decks.com points out that on a 20 degree slope, rails between posts 8 ft apart end up close to 8 ft 6 in long, so buy rails to match.
Before you stake anything, call 811 so buried utility lines are marked. Decks.com also advises getting the fence location approved by your local building or zoning department, and if you have a homeowners association, check its rules on height, style and placement before you buy materials.
The formula
sections = fence length ÷ spacing, rounded up
posts = sections + 1 + one per gate + one per corner
A straight 150 ft fence with posts 8 ft apart and one gate.
150 ÷ 8 = 18.75, rounded up to 19 sections.
19 + 1 = 20 posts.
Plus one for the gate: 21 posts.
Fences with corners
Each straight side of an L- or U-shaped fence is laid out from its own corner, so the most accurate method is to work out every side separately, add them up, then subtract one post for each corner, because neighboring sides share it.
Take an L-shaped fence with two 50 ft sides at 8 ft spacing. Each side is 50 ÷ 8 = 6.25, so 7 sections and 8 posts. Two sides make 16 posts, minus the shared corner = 15 posts. In the calculator, enter 100 ft, 0 gates and 1 corner and you get the same 15. That corner field is a shortcut: when a side divides exactly by the spacing (two 48 ft sides at 8 ft, for example) it can count one post more than you need, so for an exact list work each side out on its own.
Corner and end posts have rails pulling on them from one side or two directions at once, rather than balanced on both sides. Ask your fence supplier whether they recommend a heavier post there.
Gates
A gate needs a post on each side of the opening. The calculator adds one post per gate, which assumes the gate sits inside a run and one side of it lands on a post you already counted.
Decks.com notes you can sometimes save a post by placing the gate between two full-length panels. Gate posts also carry the weight of a swinging gate, so ask your supplier or the gate hardware maker what post size they call for.
How deep to set fence posts
Hole depth sets how much concrete or gravel you buy, so plan it with the post count.
- Depth: Decks.com recommends holes at least one third to one half the height of the post above ground. For a 6 ft fence that is 2 to 3 ft.
- Frost line: Long Fence advises going at least 6 in below the frost line, the depth the ground freezes to in winter. Frost depth varies by region; your local building department can tell you yours.
- Width: Long Fence suggests a hole at least three times the post’s width, so about 10.5 in across for a 4×4 (3.5 in actual); 10 to 12 in is typical.
- Drainage: Long Fence tamps 3 to 4 in of gravel into the bottom of the hole before setting the post.
Use whichever depth rule gives the deeper hole, and remember the post has to be long enough for the depth plus the fence height. Your posts will need concrete too: the concrete per fence post calculator works out the bags for your hole size.
Choosing the spacing
For wood and composite fences, Decks.com gives 6 to 8 ft between posts. Vinyl panels and chain-link systems have their own post spacing, so follow the panel or system maker’s instructions for those.
- 8 ft matches common rail and panel lengths and uses the fewest posts.
- 6 ft makes a stiffer fence. Decks.com suggests closer spacing in windy areas, especially for tall privacy fences.
- Local rules may set minimum or maximum post spacing, so check them before you lay out.
Once the posts are planned, count the boards for each section with the fence picket calculator.
Frequently asked questions
How many posts do I need for a 100 ft fence?
At 8 ft spacing a straight 100 ft fence needs 14 posts. At 6 ft spacing it needs 18. Add one post for each gate and work out each side separately if the fence turns a corner.
How far apart should fence posts be?
For wood fences, typically 6 to 8 ft on center. For vinyl and chain-link, follow the manufacturer’s spacing.
How deep should a fence post hole be?
At least one third to one half of the post’s height above ground, and at least 6 in below your local frost line, whichever is deeper. A 6 ft fence typically needs holes 2 to 3 ft deep before frost depth is considered.
Do I need a permit for a fence?
It depends on where you live. Many towns regulate fence height and placement, and HOAs often have their own rules. Check with your building or zoning department before you dig.
