Fence Cost Calculator
This fence cost calculator works out the price of your fence and how many posts, boards, rails, panels or rolls of chain link you need, how deep to set the posts, how much concrete to buy, how much stain to buy and what the whole fence may cost. It handles wood, vinyl and chain link, gates, and a straight run or a closed yard. Tap the i button beside any field for an explanation.
Quick answer: posts = fence length ÷ post spacing, rounded up, plus 1 for an open run. A 100 ft run with a 4 ft gate and 8 ft spacing needs 14 posts, and with 5.5 inch boards it needs about 221 boards. Fence cost = materials + labour, divided by the length for the cost per foot.
Fence cost calculator: enter your fence details
Example values are loaded so you can see a result straight away. Change any field and the numbers update.
1. Choose your units
i
i
2. Fence layout
i
i
i
i
i
i
i
3. Fence style
i
i
i
i
i
i
i
i
i
i
4. Posts and concrete
i
i
i
i
i
i
i
i
i
i
5. Gate and labour prices
i
i
6. Stain or sealer (optional)
i
i
i
i
i
Where the money goes
Each bar is one part of the total. Labour is orange. Prices are the examples you can edit.
Posts at different spacings
Post hole depth by fence height
Estimates for planning only. Prices shown are examples you can edit, not quotes. Confirm measurements on site, check local fence rules and call 811 before you dig. See our Disclaimer.
How the fence cost calculator works
Planning a fence comes down to a handful of counts: how many posts, how many boards or panels, how much concrete, and what it all costs. Each one depends on the last, so a small mistake in the length of the fence line carries all the way into the shopping list.
This fence cost calculator starts with the length of your fence line, takes out the gates, and spaces the posts along what is left. From the sections between posts it counts the boards and rails, the panels or the rolls of chain link. It then sizes the post holes, works out the concrete, and prices the job from your own numbers. If you are also staining the fence, it gives the gallons for that too.
How to calculate how much fence you need
The method works the same way for any material, and you can check it by hand:
- Measure the linear feet. Add up the length of every side that will carry fence. A closed rectangle is 2 × (length + width).
- Subtract the gates. A gate is an opening, not fence, so take its width out of the run.
- Divide by the post spacing and round up. That gives the number of sections.
- Add the posts. An open run needs one more post than it has sections. A closed loop needs the same number.
- Count the infill. Boards, panels or rolls follow from the sections and the length.
Worked example: a 100 ft run with one 4 ft gate
Taking the gate out leaves 96 feet of fence. At 8 ft spacing that is 12 sections. The run is open, and the gate adds a break in the line, so the fence is made of two stretches and needs 14 posts. With 5.5 inch boards and a quarter inch gap, 96 feet needs 201 boards, or 221 with 10% extra for cuts. Three rails in each of the 12 sections come to 36 rails.
Worked example: a closed 40 × 30 ft yard
The perimeter is 2 × (40 + 30) = 140 feet. With one 4 ft gate, 136 feet is fenced. At 8 ft spacing that is 17 sections, and because the loop is closed and cut once by the gate, it needs 18 posts.
How many fence posts do you need?
Posts are easy to miscount, because the first and last post make the number one higher than the number of sections. The table shows an open run with no gates. Each gate adds a post on both sides of the opening, which the calculator handles for you.
| Fence run (no gates) | 6 ft spacing | 8 ft spacing | 10 ft spacing |
|---|---|---|---|
| 50 ft | 10 | 8 | 6 |
| 100 ft | 18 | 14 | 11 |
| 150 ft | 26 | 20 | 16 |
| 200 ft | 35 | 26 | 21 |
Closer spacing means more posts and more concrete, and wider spacing means fewer of both. For panels, use the panel width plus the post. For chain link, follow the maker’s limit. The first chart in the results shows how the post count changes with spacing on your own run.
How many fence boards do you need?
Divide the fence length in inches by the width of one board plus the gap, then round up. A tight privacy fence has no gap, while a picket fence leaves a deliberate space between narrow pickets. A board sold as 1 × 6 is only about 5.5 inches wide, so use the real width and not the name.
| Fence run | 5.5 in boards, 0.25 in gap | 5.5 in boards, no gap | 3.5 in pickets, 1.5 in gap |
|---|---|---|---|
| 50 ft | 105 | 110 | 120 |
| 100 ft | 209 | 219 | 240 |
| 150 ft | 314 | 328 | 360 |
| 200 ft | 418 | 437 | 480 |
These counts have no extra added. Add about 10% for cuts and the odd split board, which is the default in the calculator. For a picket fence, enter the picket width and the gap you want. Board-on-board designs overlap the boards, so they use more than the figures here.
How deep should fence posts be?
QUIKRETE, a maker of post-setting concrete, gives a hole depth of one-third to one-half of the above-ground post length, plus 6 inches for a gravel base. The calculator uses that rule, so the depth follows the fence height. Pick the one-third rule for the minimum, or the one-half rule for a deeper hole in softer ground.
| Fence height above ground | Hole depth, one-third rule | Hole depth, one-half rule | Post length needed (one-third rule) | Stock post to buy |
|---|---|---|---|---|
| 3 ft | 18 in | 24 in | 4.5 ft | 6 ft |
| 4 ft | 22 in | 30 in | 5.8 ft | 6 ft |
| 5 ft | 26 in | 36 in | 7.2 ft | 8 ft |
| 6 ft | 30 in | 42 in | 8.5 ft | 10 ft |
| 7 ft | 34 in | 48 in | 9.8 ft | 10 ft |
| 8 ft | 38 in | 54 in | 11.2 ft | 12 ft |
The post has to be long enough to reach the bottom of the hole and the top of the fence, so the table also shows the length to buy. For the 6 ft fence in our example, the hole is 30 inches deep, and the post needs to be 8.5 feet overall, which means buying a 10 ft post. Frost depth is a separate limit. In cold climates the hole may need to go below the frost line, so check local rules before you dig.
How much concrete do fence posts need?
QUIKRETE suggests a hole three times the width of the post. A 4 × 4 post is really 3.5 inches wide, so the hole is 10.5 inches across. The concrete fills the hole around the post, down to the top of the gravel, so the volume is the area of the hole minus the area of the post, times the concrete depth.
The table shows the concrete for one post in a hole set to the one-third rule for a 6 ft fence, which leaves 24 inches of concrete above the 6 inch gravel base.
| Post | Hole diameter (3 × width) | Concrete per hole (cu ft) | 50 lb bags per hole | 80 lb bags per hole |
|---|---|---|---|---|
| 4 × 4 wood post (3.5 in) | 10.5 in | 1.03 | 2.75 | 1.72 |
| 4 × 6 wood post (3.5 × 5.5 in) | 16.5 in | 2.70 | 7.21 | 4.50 |
| 6 × 6 wood post (5.5 in) | 16.5 in | 2.55 | 6.80 | 4.25 |
| 5 × 5 vinyl post (5 in) | 15.0 in | 2.11 | 5.62 | 3.51 |
| Round chain link post (2.375 in) | 7.1 in | 0.49 | 1.31 | 0.82 |
For the example run, each hole takes 1.03 cubic feet. Across all 14 posts, that is 14.5 cubic feet, and with 10% extra it comes to 43 bags of 50 lb mix. Round up once for the whole job, not post by post. If you need more detail on bag sizes, the concrete bag calculator has a mode for post holes, and the gravel calculator will size the base.
How much does a fence cost?
The cost depends on your materials, your ground and your local labour rates, so the best figure is your own. The calculator builds the cost from the counts above and the prices you type in. To get a cost per foot, it divides the total by the length of the fence, which is the same number you would compare between quotes.
The table shows the example run priced with the default example prices. They are placeholders, not quotes, so replace them with prices from your local store and installers.
| Item | Quantity | Example price | Cost |
|---|---|---|---|
| Posts | 14 | $15 each | $210 |
| Boards | 221 | $4 each | $884 |
| Rails | 36 | $6 each | $216 |
| Gate | 1 | $120 each | $120 |
| Concrete (50 lb bags) | 43 | $6 each | $258 |
| Materials | $1,688 | ||
| Labour | 96 ft | $12 per ft | $1,152 |
| Total | $2,840 |
On these example prices the total is $2,840, which works out to $28.40 per foot, with $1,688 in materials and $1,152 in labour. Set the labour price to zero to see a build-it-yourself cost, and compare it with installer quotes.
Wood, vinyl or chain link: what changes in the count
The three styles share the same posts and concrete, and differ in what goes between the posts.
- Wood boards or pickets. Counted one by one, with rails across each section. This gives the most control over the look, and the most pieces to count.
- Panels. Vinyl and wood panels arrive in sections, so the count is the number of sections. Check the real panel width, because it sets your post spacing.
- Chain link. Fabric is sold in rolls, and fabric rolls are often 50 feet long, so the calculator divides the fence length by the roll length and rounds up. Round chain link posts are narrower, so they need less concrete.
Switching the fence style in the calculator also changes the typical post and spacing, which you can edit.
How much fence stain or sealer do you need?
Multiply the fence length by the height to get the area of one side, then by the number of sides you will coat. Multiply by the number of coats and divide by the coverage on the can. Our 96 ft example, 6 ft tall, coated on both sides is 1,152 square feet. Two coats at 250 square feet per gallon need 9.2 gallons, so you would buy 10.
| Fence length (6 ft tall, both sides) | Surface area | Gallons, 2 coats at 250 sq ft per gallon | Gallons to buy |
|---|---|---|---|
| 50 ft | 600 sq ft | 4.80 | 5 |
| 100 ft | 1,200 sq ft | 9.60 | 10 |
| 150 ft | 1,800 sq ft | 14.40 | 15 |
| 200 ft | 2,400 sq ft | 19.20 | 20 |
Coverage on the label is for a smooth surface. Rough or dry wood soaks up more, so buy a little extra, and read the can for the coats it recommends. The calculator counts the fence sections only and does not include the gates.
Gates and slopes
Take the width of each gate out of the run before you count the sections, since there is no fence in the opening. Each gate needs a post on both sides, and the calculator adds them.
On sloping ground, measure the fence line along the ground and not across a flat plan, because the real run is longer than the map. A steep slope may be better built as a series of steps, and each step is its own section.
Before you build
- Know your boundary. A survey or plat shows where your property line is, and many places require the fence to sit inside it.
- Check local rules. Cities and homeowners associations often set maximum heights and may require a permit.
- Call 811. The free 811 service has buried utility lines marked. Contact it a few business days before you dig post holes.
Common mistakes when planning a fence
- Forgetting the end post. Counting only the sections leaves an open run one post short.
- Using the name, not the size. A 1 × 6 board is 5.5 inches wide, and a 4 × 4 post is 3.5 inches.
- Treating a gate as fence. Subtract the opening, and count the two posts beside it.
- Digging too shallow. The hole depth should follow the fence height, not a single number.
- Rounding every post. Total the concrete for all the holes first, then round the bags up once.
This page is a planning tool and does not replace local codes or professional advice. For retaining walls, pool fences or anything that must meet a safety code, speak to a qualified contractor.
Fence cost calculator FAQ
How do I calculate how much fence I need?
Measure the total length of the fence line and subtract the width of any gates. Divide what is left by your post spacing, round up to get the number of sections, then add the posts. Boards, rails or panels follow from the sections. The calculator does all of this and adds the concrete and the cost.
How do I calculate linear feet for a fence?
Add up the length of every side that will have fence. For a closed rectangle, that is 2 × (length + width), so a 40 × 30 ft yard has 140 linear feet. Subtract the gate openings to get the length of fence itself.
How many fence posts do I need?
Divide the fence length by the post spacing and round up for the sections. In an open run the end posts add one more, while a closed loop uses the same number of posts as sections. A 100 ft run with a 4 ft gate and 8 ft spacing needs 14 posts.
How many fence boards do I need?
Divide the fence length in inches by the board width plus the gap, then round up and add a little extra for cuts. A 96 ft run with 5.5 inch boards and a quarter inch gap needs 201 boards with no extra and 221 with 10% extra.
How deep should a fence post hole be?
QUIKRETE gives a rule of one-third to one-half of the above-ground post length, plus 6 inches of gravel at the bottom. For a 6 ft fence that is 30 to 42 inches. Your local frost depth and fence rules can require more.
How much concrete do I need for a fence post?
A 4 × 4 post in a 10.5 inch hole, set 24 inches deep in concrete over a 6 inch gravel base, takes about 1.03 cubic feet, or roughly 2.75 bags of 50 lb mix per post. The calculator totals every post and rounds the bags up once.
How much does fencing cost?
It depends on the style, height, materials, ground and local labour rates, so it is best to price your own job. At the example prices in the calculator, a 100 ft wood privacy fence with one gate comes to about $2,840, or $28.40 per foot. Replace the prices with your quotes to get your own figure.
How much does a 6-foot privacy fence cost per foot?
Divide the total cost by the length of the fence, which the calculator shows for you. With the example prices it is $28.40 per foot, split between $16.88 for materials and the rest for labour. Local prices will move this up or down.
How much does a 100 foot vinyl fence cost?
Choose the panel style, enter your supplier’s panel and post prices, and the calculator does the rest. At the example prices, a 100 ft run with no gate comes to about $2,647, or $26.47 per foot, with 13 panels and 14 posts.
How much stain do I need for a fence?
Multiply the fence length by the height and by the number of sides you will coat, then by the number of coats, and divide by the coverage on the can. Our 96 ft, 6 ft tall example coated on both sides twice needs 9.22 gallons at 250 sq ft per gallon, so buy 10.
Do I need a permit to build a fence?
Rules differ by city, county and homeowners association. Many places limit fence height and require a setback from the property line, and some require a permit. Check with your local building department before you buy materials.
Sources and further reading
The counts are plain geometry. The post depth, hole width and gravel base follow the QUIKRETE guidance below, and the prices in the calculator are editable examples. For the full instructions, go to the source:
- QUIKRETE, Setting Posts in Concrete (hole depth, hole width and gravel base)
- QUIKRETE, Setting Posts project sheet (frost line guidance for structural posts)
- 811 Before You Dig (the free national service for marking buried utilities)
Local conditions and rules differ, so confirm the details with your building department.
Plan the rest of the project
Building a deck or a patio next to the fence? The deck board calculator counts the boards, the concrete slab cost calculator prices a slab, and the square footage calculator measures an odd-shaped yard. The concrete calculators hub lists the rest of our pouring tools.