Fence Calculator
Enter your fence length, gates and corners and get the full material list for a wood privacy or picket fence: posts, rails, pickets, how deep to set each post, and how many bags of concrete to buy. Corners and gates change the count here, because each one splits the fence into a separate run. Add your local prices if you also want a cost.
The calculator splits the length into equal runs at each corner and gate. If your runs are very uneven, use Run by run for an exact count.
Wood fences usually have posts 6 to 8 ft apart on center, and wider than 8 ft tends to sag. Rails fill in from the height: 2 under 5 ft, 3 from 5 to 7 ft, 4 at 8 ft.
Use the actual width: a 1x4 measures 3½ in (8.9 cm) and a 1x6 measures 5½ in (14 cm). Some cedar boards are a full 6 in. Enter 0 for a privacy fence with tight boards.
Leave the hole blank to use 3 × the post width (10.5 in). Quikrete's method puts 6 in of gravel under the post and stops the concrete 3 to 4 in below grade.
Your fence material list will appear here
Enter the fence length, corners and gates, then click calculate for posts, rails, pickets and concrete bags.
Quick Answer
Posts per run = (run length ÷ post spacing, rounded up) + 1, minus one shared post per corner. Pickets = (length + gap) ÷ (picket width + gap). Bury posts at least 1/3 of the above-ground height (2 ft for a 6 ft fence), in a hole 3 times the post width with 6 in of gravel underneath. A 100 ft privacy fence with one 4 ft gate and 8 ft spacing needs 14 posts, 40 rails, 231 boards (with 10% extra) and 34 bags of 50 lb concrete.
How It Works: Formula & Variables
Posts = Σ (⌈run ÷ spacing⌉ + 1) − corners
- Runs
- Straight stretches between corners, ends and gates. With one total length, the calculator splits it into equal runs: corners + gates + 1 for an open line, corners + gates for a closed loop.
- Sections
- ⌈run ÷ spacing⌉ for each run, added up
- Rails
- sections × rails per section, plus waste %
- Pickets
- ⌈(run in inches + gap) ÷ (width + gap)⌉ for each run, plus waste %
- Buried depth
- height ÷ 3 (minimum) or height ÷ 2 (same as 1/3 of the post length)
- Post length
- height + buried depth
- Hole
- diameter = 3 × post width; depth = buried depth + gravel base
- Concrete per post
- (π × D² ÷ 4 − post width²) × (buried depth − gap left at top), in in³ ÷ 1,728 = ft³
- Bags
- ⌈concrete for all posts ÷ bag yield⌉
Concrete bag yields used
| Bag | Yield (ft³) | Yield (L) |
|---|---|---|
| 50 lb (22.6 kg) | 0.375 | 10.6 |
| 60 lb (27.2 kg) | 0.45 | 12.7 |
| 80 lb (36.2 kg) | 0.6 | 17 |
From Quikrete's Concrete Mix and Fast-Setting Concrete Mix data sheets. Fast-Setting comes in 50 and 60 lb bags; the 80 lb size is regular Concrete Mix. Quikrete notes that two 50 lb bags of Fast-Setting set a 3 in post in a 9 in hole 30 in deep, and this calculator's maths gives 2.02 bags for that hole.
Sources: Quikrete, setting posts without mixing, Quikrete setting posts project sheet, Quikrete Concrete Mix data sheet, Quikrete Fast-Setting Concrete Mix data sheet, Hoover Fence, wood fence spacing, rails and gates, and 811 Before You Dig.
Worked Examples
Example 1: 100 ft privacy fence with one gate
A straight 6 ft privacy fence, 100 ft long, with a 4 ft gate in the middle. Posts 8 ft apart, 4x4 posts, 1x6 boards (5½ in) tight together, 50 lb bags of concrete.
- Fence without the gate: 100 − 4 = 96 ft, in two runs of 48 ft
- Sections: 48 ÷ 8 = 6 per run, so 12 in total
- Posts: 6 + 1 = 7 per run, so 14 posts, 2 of them on either side of the gate
- Rails: 3 per section (the fence is 6 ft high) × 12 = 36, plus 10% = 40 rails
- Boards: 576 in ÷ 5.5 = 104.7, so 105 per run and 210 in total, plus 10% = 231 boards
- Post depth: 72 ÷ 3 = 24 in, so posts 8 ft long and holes 30 in deep with the gravel
- Concrete: 0.90 ft³ per post × 14 = 12.65 ft³ ÷ 0.375 = 34 bags of 50 lb (or 22 bags of 80 lb)
Example 2: why uneven runs need the run-by-run mode
A U-shaped backyard fence off the back of a house: 50 ft down one side, 100 ft across the back with a 4 ft gate in the middle, and 50 ft up the other side. Two corners, one gate, 200 ft in total.
- Total length mode splits 196 ft into four equal runs of 49 ft. Each needs 7 sections, so 28 sections and 30 posts.
- Run by run, the real runs are 50, 48, 48 and 50 ft. The 48 ft runs fit exactly 6 sections, so the total is 26 sections and 28 posts.
Equal runs are a fair estimate, but they can be off by a post or two in either direction. If you know each run's length, the run-by-run tab gives the exact count, in this case 2 posts fewer.
Example 3: 40 ft picket fence
A 4 ft front-yard picket fence, 40 ft in one straight run, posts 6 ft apart, 1x4 pickets (3½ in) with a 2 in gap.
- Sections: 40 ÷ 6 = 6.7, rounded up to 7; posts: 8
- Rails: 2 per section (under 5 ft high) × 7 = 14, plus 10% = 16
- Pickets: (480 + 2) ÷ (3.5 + 2) = 87.6, so 88, plus 10% = 97 pickets
- Posts 5 ft 4 in long, buried 16 in
Key Concepts
Fence post depth chart (4x4 post). Hole 10.5 in wide with 6 in of gravel, concrete stopped 3 in below grade, 50 lb bags at 0.375 ft³.
| Fence height | Buried (min.) | Post length | 50 lb bags / post | Buried (deeper) | Post length |
|---|---|---|---|---|---|
| 4 ft | 16 in | 5 ft 4 in | 1.5 | 24 in | 6 ft |
| 5 ft | 20 in | 6 ft 8 in | 2 | 30 in | 7 ft 6 in |
| 6 ft | 24 in | 8 ft | 2.4 | 36 in | 9 ft |
| 8 ft | 32 in | 10 ft 8 in | 3.3 | 48 in | 12 ft |
Gates are breaks in the line. A gate needs a post on each side, and the fence on either side of it is rounded to whole sections separately. Hoover Fence suggests keeping single swing gates to 8 ft at most (5 ft avoids most sag problems) and double gates to 16 ft at most. Wide gates also need heavier posts.
Nominal vs actual lumber. A 4x4 measures 3½ × 3½ in and a 6x6 measures 5½ × 5½ in. Boards work the same way: a 1x6 is 5½ in wide. Enter actual widths, or your picket count comes out about 8% low.
Concrete stops short of the top. Quikrete fills the hole to 3 or 4 in below the ground and finishes with soil or sod. The calculator leaves 3 in by default, so it orders a little more concrete, not less.
Panels work too. For a pre-made panel fence, set the spacing to the panel width. Sections then equal panels, and the post and concrete figures still apply. Ignore the picket line.
Common Mistakes
Dividing the whole length by the spacing. One straight-line division ignores corners and gates. Every gate adds a post, and every run gets rounded up separately.
Leaving the gate in the picket count. The gate opening has no fence boards. Subtract it first, then buy or build the gate separately.
Buying posts as long as the fence is tall. A 6 ft fence needs at least 8 ft posts, because 2 ft goes underground.
Counting concrete per hole. Rounding up the bags for each post buys a partial bag for every hole. Add up the volume for the whole fence first, then round once.
Digging before the utilities are marked. Contact 811 a few business days ahead. Some lines are only inches below the surface, and a post hole goes deeper than that.
Frequently Asked Questions
Divide each straight run by your post spacing, round up, and add one post. Do that for every run, then subtract one post for each corner, because two runs share it. A straight 100 ft fence with one 4 ft gate and 8 ft spacing is two 48 ft runs: 6 sections each, so 7 posts each and 14 in total, 2 of them gate posts.
Most wood fences use 6 to 8 ft between post centers. Hoover Fence recommends no more than 8 ft, partly because rails come in 8 and 16 ft lengths and partly because longer spans let the rails sag. Going down to 6 ft costs more posts but stiffens the fence, and 12 ft rails then cover two bays with no offcut.
Quikrete gives a range. Its post-setting video says the hole should be 1/3 to 1/2 of the post height above ground, so a 6 ft fence needs at least 2 ft. Its project sheet says 1/3 of the overall post length, which comes out to half the above-ground height (3 ft for a 6 ft fence). Add 6 in for gravel under the post. Posts that carry a structure, like a deck, have to go at least 6 in below the frost line, and your local code may say the same for fences.
Post length is the fence height plus the buried depth. With the 1/3-of-height rule, a 6 ft fence needs 8 ft posts. With the deeper 1/3-of-length rule, it needs 9 ft posts. Then buy the next length up that your lumberyard stocks.
It depends on the hole. For a 4x4 post in a 10.5 in hole on a 6 ft fence, buried 2 ft over 6 in of gravel, with the concrete stopped 3 in below grade, each post takes about 0.90 cubic feet. That is 2.4 bags of 50 lb mix (0.375 cu ft each) or 1.5 bags of 80 lb mix (0.60 cu ft each). Add up the concrete for all posts before rounding, so you don't buy a part-used bag for every hole.
Quikrete says three times the width of the post. For a 4 in post it suggests a hole about 12 in wide. A nominal 4x4 actually measures 3½ in, which gives 10.5 in; the calculator uses that as its default and lets you type your own size. In loose or sandy soil, Quikrete suggests digging a wider, dish-shaped hole.
Convert the fence length to inches, add one gap, and divide by the picket width plus the gap. Round up. For a privacy fence with no gap, it is just the length divided by the board width: 48 ft of fence with 5½ in boards is 576 ÷ 5.5 = 104.7, so 105 boards. Add about 10% for cuts and boards you reject.
Enter what you pay for one post, rail, picket, bag of concrete and gate at your local store. The calculator multiplies each by the quantity you need and shows the total and the cost per foot. That covers materials only. Hardware, stain, tools and labor are extra, and prices vary too much by region to bake in a number.
Yes. 811 is the free national call-before-you-dig service, and it lists fences and mailboxes as projects that need a request. Contact 811 or your state 811 center a few business days before you dig, then wait until every utility has marked its lines. Check your local building code, frost depth, property line and any HOA rules at the same time.
Related Calculators
Concrete / Mulch Volume Calculator
Calculate cubic yards, bag counts, and cost for concrete, mulch, soil, or gravel.
Gravel Calculator
Work out cubic yards and tons of gravel, with a compaction buffer and cost.
Paint Calculator
Work out how many gallons you need, with coats and texture accounted for.
Topsoil Calculator
Work out how much topsoil to order for beds and lawns.