Fence calculator
This fence calculator counts the posts, rails, pickets or panels and bags of post concrete for a fence from its length, post spacing, height and gates, then adds up a material cost from prices you enter.
- Line, end and gate posts, rails, and pickets or panels
- Concrete bags per post from the hole size
- Optional cost from your own unit prices
Last updated
How to use the fence calculator
- Measure the fence line in feet, including the gate openings. Decide the post spacing: it is usually set by the panel width or the rail length you buy.
- Pick the style. Privacy pickets sit edge to edge, pickets with a gap need the gap width, and panels are counted one per section.
- Enter the number of gates and the width of each opening, and choose 2 or 3 rails per section.
- Choose the post size, buried depth and concrete bag size to get the hole and the bags of concrete per post.
- Type in your own prices to see a material total. Round up and add a few spare pickets for cuts and mistakes.
How the fence materials are counted
sections = (fence length − gate widths) ÷ post spacing, rounded up
posts = sections + gates + 1
rails = sections × rails per section
pickets = (fence length − gate widths) × 12 ÷ (picket width + gap), rounded up
A straight fence has one more post than it has runs between posts. Each gate opening is a run, so it adds one. Corners are posts you have already counted.
The post hole follows QUIKRETE’s setting-posts instructions: the hole is 3 times the post width across, and deep enough to bury 1/3 to 1/2 of the post’s height above ground, plus 6 inches of gravel at the bottom. Concrete fills the hole from the gravel up to 4 inches below ground level, less the space the post takes up.
hole diameter = 3 × post width
hole depth = (1/3 to 1/2) × height above ground + 6 in gravel
concrete per post = (π × (diameter ÷ 2)² − post area) × (buried depth − 4 in) ÷ 1,728
bags = concrete ÷ bag yield (80 lb 0.60 cu ft, 60 lb 0.45, 50 lb 0.375)
Worked example
A 100 ft privacy fence, 6 ft high, with one 4 ft gate, posts 8 ft apart, three rails per section, 5.5 inch pickets with no gap and 4x4 posts buried 1/3 of the height, set in 80 lb bags.
- Sections: (100 − 4) ÷ 8 = 12. Posts: 12 + 1 gate + 1 = 14. That is 2 end posts, 2 gate posts and 10 line posts.
- Rails: 12 sections × 3 = 36.
- Pickets: 96 ft × 12 = 1,152 in ÷ 5.5 = 209.5, so 210. Each 8 ft section takes 18.
- Hole: 3 × 4 = 12 inches across. Buried depth is 72 ÷ 3 = 24 inches, so the hole is 24 + 6 = 30 inches deep. The post is 72 + 24 = 96 inches, so buy 8 ft posts.
- Concrete per post: the gravel takes the bottom 6 inches and the concrete stops 4 inches below grade, so it is 24 − 4 = 20 inches tall. π × 6² = 113.1 sq in, minus 3.5 × 3.5 = 12.25 sq in for the post, leaves 100.8 sq in. 100.8 × 20 = 2,016 cu in = 1.17 cu ft, or 1.9 bags of 80 lb mix.
- All 14 posts: 16.34 cu ft ÷ 0.60 = 27.2, so 28 bags. Gravel: 0.39 cu ft per post, 5.5 cu ft in all.
How deep should fence post holes be?
Bury 1/3 to 1/2 of the post’s height above ground, then add 6 inches for gravel. A 6 ft fence needs a hole 30 to 42 inches deep. The hole should be 3 times the post width across, so 12 inches for a 4x4. This follows QUIKRETE’s instructions for setting posts in concrete (last checked 18 November 2026). Frost depth, soil and wind can call for deeper holes, so check your local rules.
| Height above ground | Buried, 1/3 (in) | Hole depth with gravel (in) | Buried, 1/2 (in) | Hole depth with gravel (in) | 80 lb bags per 4x4 post, 1/3 |
|---|---|---|---|---|---|
| 3 ft | 12 | 18 | 18 | 24 | 0.78 |
| 4 ft | 16 | 22 | 24 | 30 | 1.17 |
| 5 ft | 20 | 26 | 30 | 36 | 1.56 |
| 6 ft | 24 | 30 | 36 | 42 | 1.95 |
| 7 ft | 28 | 34 | 42 | 48 | 2.33 |
| 8 ft | 32 | 38 | 48 | 54 | 2.72 |
The last column is the unrounded bag count for one 4x4 post in a 12 inch hole at the 1/3 depth. Bags are bought whole, so for a row of posts divide the total concrete by 0.60 and round up once. The concrete bags guide has the same counts for 6x6 posts, slabs and tube forms.
How many fence posts do I need per length?
Divide the length by the post spacing, round up, and add one. A 100 ft fence with posts 8 ft apart needs 14 posts: 100 ÷ 8 = 12.5, round up to 13, plus 1. Each gate opening adds one run but removes its width from the sections, so one 4 ft gate in the same fence still gives 14 posts. At 6 ft spacing the same fence takes 18.
| Fence length | Posts at 6 ft | Posts at 8 ft | At 8 ft with one 4 ft gate |
|---|---|---|---|
| 25 ft | 6 | 5 | 5 |
| 50 ft | 10 | 8 | 8 |
| 100 ft | 18 | 14 | 14 |
| 150 ft | 26 | 20 | 21 |
| 200 ft | 35 | 26 | 27 |
| 300 ft | 51 | 39 | 39 |
Pick the spacing from the panel or rail you are using. Closer posts make a stiffer fence and cost more in posts and concrete.
What this fence calculator leaves out
- Corners and slopes. A corner is a post already in your count. On a slope, stepped or racked sections can change the post and picket count, so add a few extra.
- Gate hardware and frames. The gate is one item; hinges, latches and the gate frame are not counted.
- Rules and permits. Height limits, setbacks and permits are set by your town or HOA. Call before you dig, and have buried utilities marked.
- Hole size for special posts. The hole rule is for wood posts set in concrete. Metal posts, vinyl sleeves and pre-set brackets follow the maker’s instructions.
Setting more than a few posts? Use the concrete calculator to compare bags with a ready-mix order, and the gravel calculator for the 6 inch gravel base.
Common questions
How many posts do I need for 100 feet of fence?
With posts 8 ft apart you need 14 posts: 100 ÷ 8 = 12.5, round up to 13 sections, plus 1. At 6 ft spacing it is 18 posts, and at 10 ft spacing it is 11. A 4 ft gate in the same 100 ft run still gives 14 posts.
How many bags of concrete per fence post?
About 2 bags of 80 lb mix for a 4x4 post in a 12 inch hole. For a 6 ft fence buried 24 inches, the concrete is 20 inches tall and holds about 1.17 cu ft, which is 1.9 bags at 0.60 cu ft per bag. With 50 lb bags (0.375 cu ft each) it is 3.1 bags, so plan on 4.
How far apart should fence posts be?
Posts are most often set 6 to 8 feet apart, matched to the panel or rail length. This calculator starts at 8 ft. Wider spacing needs fewer posts but more sag in the rails, so follow the product guide for your rails and your local rules.
How many pickets do I need per 8 foot section?
With 5.5 inch pickets and no gap, you need 18 per 8 ft section: 96 inches ÷ 5.5 = 17.45, round up. With a 1.5 inch gap each picket takes 7 inches, so 14 per section (96 ÷ 7 = 13.7).
How deep should a fence post hole be?
Bury 1/3 to 1/2 of the height above ground, plus 6 inches of gravel. For a 6 ft fence that is 24 to 36 inches buried and a hole 30 to 42 inches deep, 12 inches wide for a 4x4 (QUIKRETE’s instructions).
How do I estimate the cost of a fence?
Multiply each count by your local unit price and add them. Enter prices for posts, rails, pickets or panels, concrete bags and gates above and the calculator totals them. It leaves out labor, gate hardware, stain and delivery.
Guides that use this calculator
Related calculators
- Concrete calculatorSlabs, footings, columns, curbs and steps, in yards or bags
- Gravel calculatorYards and tons for driveways, paths and patios
- Board foot calculatorBoard feet and lumber cost from thickness, width and length
- Deck calculatorBoards, joists and screws for a deck
- Cylinder volume calculatorCubic feet, gallons and concrete bags for tanks, tubes and post holes
Sources
- QUIKRETE, Setting Posts in Concrete. Hole 3 times the post width; depth 1/3 to 1/2 of the post length above ground plus 6 in; 6 in of gravel; concrete to 3 to 4 in below ground level. Last checked 18 November 2026
- QUIKRETE Concrete Mix (No. 1101) data sheet. Bag yields: 50 lb 0.375 cu ft, 60 lb 0.45, 80 lb 0.60. Last checked 18 November 2026
See the methodology page for how YardageHQ builds and checks its calculators.