Fences · Live 3D

Fence Calculator

Enter your fence line, height and picket style to get the posts, concrete, rails, pickets and gate hardware to buy — how deep to dig every hole, and the pool fence rules when it guards a pool — with the fence built in 3D. Free, no sign-up.

3D view of the fence

Drag to orbit · Ctrl + scroll or pinch to zoom · the arrow button shows what goes below ground

No problems in these checks — confirm with your town before you dig

Fence
140'
U-shaped · 6' high
Posts
21
4×4 · 36" in the ground
Concrete
108 bags
50 lb · 40.4 cu ft
Rails
57
2×4 boards · 3 per bay
Pickets
340
1×6 · incl. 10% spare
Estimated cost
$696
3 of 11 items priced

Your fence

Fence line

Post center to post center. Each side turns 90° from the last; gates go on side 1.

Fence
ft
Posts
Holes and concrete

Your fence

ItemQtyYour pricePriced onCost
Posts & footings
4×4 posts, 10'2 end, 2 corner, 2 gate, 15 line · 36" in the ground, tops level with the pickets · treated for ground contact (UC4A)21 posts210 lin ft10' board ≈ $13.48$283
Fast-setting concrete mix, 50 lb bags21 holes 12" across: 40.4 cu ft around the posts, up to 3" below the ground · 0.375 cu ft per bagPour it dry and add water as the bag says, in lifts of 30" or less; fill the top 3" with soil.108 bags—
All-purpose gravel, 50 lb bags6" under each post: 8.2 cu ft · 0.5 cu ft per bag17 bags—
Rails & pickets
2×4 rails, 8'57 rails: 3 per bay, cut 1/2" shorter than the space between the posts · treated for above ground (UC3B)57 boards456 lin ft8' board ≈ $6.88$392
1×6 fence pickets, 6'300 on the fence + 9 on the gate + 10% spare · cut to 5' 10", 2" off the ground · if treated, rated for ground contact (UC4A)Butted edge to edge; the last picket of each run is ripped to fit. The treated pickets we found in stock were rated for above ground only: ask for ground-contact ones.340 pickets—
Gates
2×4 gate frame, 12'1 leaf 3' 10" wide (1" off the hinge post, 1" off the latch post): 3 rails and 2 diagonal braces each, from the bottom on the hinge side up to the latch side2 boards24 lin ft12' board ≈ $10.32$21
Heavy-duty gate hinges2 per gate, near the top and bottom2 hinges—
Gate latchone per gate, on the side away from the hinges1 latch—
Hardware & fasteners
2×4 fence rail brackets (Simpson FB24Z or equal)one at each end of every rail · galvanized (ZMAX)114 brackets—
Bracket nails or screws5 per bracket (3 into the rail, 2 into the post) · 0.131" × 1-1/2" nails or #9 × 1-1/2" connector screws570 fasteners—
Picket nails or screws2 into each rail for every picket · 8d hot-dip galvanized nails or 1-3/4" deck screws1,854 fasteners—
Estimated total (3 of 11 items priced)$696

Not included in this estimate

  • Post caps, stain or sealer, and trim boards
  • Gate hardware beyond hinges and a latch (drop rod, stop, handle)
  • Stepping or racking the fence on sloped ground
  • Removing an old fence, digging tools or auger rental
  • Permit fees, survey, labor, delivery and sales tax
140' · 21 posts · 340 pickets
$696
List

Updated November 2026 · Post setting from QUIKRETE · Pool barriers from ISPSC 2021 · How we calculate

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:

FencePost in groundHoleLeastRails
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.

This is a planning tool. It does not design a fence for wind or soil, and local zoning, HOA and pool rules have the final say — check them, and call 811, before you dig.

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