How to use the fence calculator
Enter the total length of fence you're building, its height and the post spacing, then the number of gates and corners. Corners need their own post, and each gate needs an extra post so it can swing between two solid ones. Pick a style to get pickets: tight for a privacy fence, or set a gap for a traditional picket fence. The calculator also sizes the post concrete, using the same maths as the post hole concrete calculator.
The formulas
sections = ⌈length ÷ post spacing⌉
posts = sections + 1 + gates + corners
pickets = ⌈length (in) ÷ (picket width + gap)⌉
rails = sections × rails per section
Worked example: 100 ft of 6 ft privacy fence
- Sections: 100 ÷ 8 = 12.5, so 13 sections.
- Posts: 13 + 1 + 1 gate + 2 corners = 17 posts. Each should be 6 ft + 30 in buried = 8.5 ft, so buy 10 ft posts (or 9 ft if your yard stocks them).
- Pickets: 1,200 in ÷ 5.5 in = 218.2, so 219 pickets butted tight.
- Rails: 13 × 3 = 39 rails, 8 ft long.
- Concrete: each 10 in hole, 30 in deep, minus a 4 × 4 post, holds about 1.15 ft³, so 17 posts need about 36 bags of 80 lb mix with 10% extra.
The calculator counts corners and gates as extra posts on top of the straight-run posts, which is slightly generous when a corner falls exactly where a line post would go. Spare posts are handy.
Fence planning guide
| Fence | Post spacing | Rails | Post depth |
|---|---|---|---|
| 3-4 ft picket | 8 ft | 2 | 24 in |
| 6 ft privacy | 6-8 ft | 3 | 24-36 in |
| 8 ft privacy | 6 ft | 3-4 | 36 in or more |
Always go below your local frost depth in cold climates, or posts heave. Check fence height limits with your city and HOA before you dig, and call 811 to have buried utilities marked.
Tips
- Set corner and end posts first, then run a string line between them for the line posts.
- Pickets shrink. Green pressure-treated pickets can shrink a little as they dry, opening small gaps. Butt them tight when wet.
- Use exterior fasteners: hot-dipped galvanized or stainless nails or screws, two per picket at each rail.
- Gates need support: a 4 ft gate wants 6 × 6 or well-braced 4 × 4 posts set deeper than line posts.
Questions people ask
How many fence posts do I need?
Divide the fence length by the post spacing and round up to get the number of sections, then add one post to close the last section, plus one extra for each gate and each corner where the run changes direction. 100 ft of fence at 8 ft spacing is 13 sections and 14 posts before gates.
How far apart should fence posts be?
6 to 8 feet on center for wood fences. 8 ft suits standard 8 ft rails; 6 ft is stiffer and better for tall privacy fences in windy places or heavy board-on-board styles.
How many pickets do I need for a fence?
Fence length in inches divided by the picket width plus the gap. 100 ft of 5½ in pickets butted tight is 219 pickets; with a 2 in gap for a picket fence it's 160.
How deep should fence posts be?
A common guideline is a third to a half of the post's height above ground, and below the frost line in cold climates: about 2 to 3 ft for a 6 ft fence. Check your local code and any HOA rules.
How many rails does a fence need?
Two rails for fences up to about 4 ft, three for a 6 ft privacy fence, sometimes four for 8 ft fences.
Sources and assumptions
- QUIKRETE Concrete Mix (No. 1101) data sheet: 80 lb bag 0.60 ft³; Fast-Setting (No. 1004): 50 lb bag 0.375 ft³
- Post spacing, rail counts and hole size are common fence-building practice, not code. Local codes and HOA rules may limit fence height and location.
Last reviewed 27 October 2026. Every formula on this page is checked against the worked example above in our automated tests. Found a problem? Tell us.