What this calculator gives you
- A post layout — straight, L, U or closed fences, posts spaced evenly between ends, corners and gates.
- Holes and concrete — how deep and wide to dig, the gravel under each post and the bags of concrete for the whole fence.
- A materials list — posts, 2×4 rails, privacy, shadow-box or spaced pickets, gate frames, hinges, latches, brackets and fasteners, with your own prices.
- Checks — post depth for your height, frost depth, treated wood, fasteners, permits, 811, and the pool barrier rules.
Post depth and rails by fence height
Posts go a third of their whole length into the ground — half their height above it, at least 2' — over 6" of gravel. "Least" is the shallowest any maker allows: a third of the height above ground, never under 2'. Rails are per bay:
| Fence | Post in ground | Hole | Least | Rails |
|---|---|---|---|---|
| 3' | 24" | 30" | 24" | 2 |
| 4' | 24" | 30" | 24" | 2 |
| 5' | 30" | 36" | 24" | 3 |
| 6' | 36" | 42" | 24" | 3 |
| 7' | 42" | 48" | 28" | 4 |
| 8' | 48" | 54" | 32" | 4 |
How the numbers are worked out
Posts stand at the ends, at every corner and on both sides of each gate; between those fixed posts the bays are equal and no wider than your spacing. Each hole is three times the post's nominal width across (12" for a 4×4), with 6" of gravel under the post. Concrete fills the hole around the post — fast-setting mix to 3" below the ground, concrete mix to the top — for every hole, divided by your bag's yield and rounded up once. Pickets are laid out along each run — butted, spaced, or on both faces for a shadowbox — and stop 2" above the ground; the posts' tops are level with them. Rails are cut to fit between the posts and packed into the stock length that needs the fewest feet.
Frequently asked questions
How deep should fence posts be?
QUIKRETE's bag data sheets, UFP and Viance put a third of a post's whole length in the ground — half its height above ground, and never less than 2'. A 6' fence takes posts 36" in the ground, in holes 42" deep with 6" of gravel under each post, so you buy 10' posts. QUIKRETE's how-to pages allow as little as a third of the height above ground — 24" for a 6' fence, as Simpson Strong-Tie gives — but no maker goes below that. Where the ground freezes deeper, dig below your frost depth.
How many bags of concrete per fence post?
A 4×4 post in a 12" hole with 36" of concrete takes about 2.10 cu ft around it: 3.5 bags of 80 lb concrete mix (0.6 cu ft each). Fast-setting mix stops about 3" below the ground, so it takes about 1.93 cu ft — 5.1 bags of 50 lb (0.375 cu ft each). Buy for the whole fence and round up once: a 100' straight fence has 14 posts and needs 72 bags of 50 lb fast-setting mix.
How far apart should fence posts be?
No more than 8' center to center is the usual rule in fence guides (Simpson Strong-Tie and UFP lay posts out every 8'; Lowe's gives 6' to 8') — a convention, not a code rule. Between fixed posts (ends, corners and gate posts) the calculator spaces the posts evenly, so a 100' run at up to 8' gets 13 bays of 7' 8-5/16" and 14 posts.
How many pickets do I need for a fence?
For a privacy fence, divide the length the pickets cover by the picket width: 1×6 pickets are 5-1/2" wide, so about 2.2 per foot. The 100' fence above takes 219 pickets; with the 10% extra UFP recommends that is 241. For spaced pickets, divide by the picket width plus the gap; a shadowbox has pickets on both faces, each face's gaps about 2" narrower than a picket so they overlap 1" each side.
How many rails does a fence need?
UFP uses two 2×4 rails on shorter fences, three on a 6' fence and four on an 8' one; Viance asks for three once the pickets are 60" long, and Lowe's about one per 2' of height. So the calculator uses two up to 4', three up to 6' and four above, with the top and bottom rails 4" from the picket ends (UFP). The 100' fence above needs 39 rails cut from 39 8' boards.
How tall does a pool fence have to be?
At least 4' high, measured on the side away from the pool, with no more than 2" under it over soil or grass and no opening a 4" ball could pass. Where the rails are less than 45" apart, they go on the pool side and the gaps between pickets are at most 1-3/4". Gates open outward, self-close and self-latch (ISPSC 2021 Section 305, which IRC 2021 R327.1 points to). Many towns add their own rules.
Do I need a permit for a fence?
The 2021 IRC exempts fences no more than 7' high from a building permit (R105.2), but towns amend it — some to 6' — and zoning and HOA rules can limit a fence's height, style and place. Ask about a pool barrier: it is part of the pool's rules. Call 811 a few business days before you dig.
More calculators: Deck material calculator · Deck footing calculator · Roof pitch calculator · Deck stair calculator