Fence Cost Calculator

By Shivam · Last updated October 18, 2026

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
Choose how you enter measurements. Switching resets the fields to example values in that system.
i
Only the symbol changes. Prices are not converted, so type every price in your own currency.

2. Fence layout

i
Choose a run if you know the total length of fence, or a closed rectangle if you are fencing all four sides of a yard. A closed loop needs one fewer post than an open run.
i
The total length of fence along the ground, including any gate openings. This is the linear footage.
i
How many gate openings are in the fence. Each opening takes the gate width out of the fence run and adds a post on each side.
i
The width of one gate opening. A single walk gate is often about 3 to 4 ft (1 to 1.2 m), and a drive gate is wider.
i
The height of the fence above the ground. It sets the post depth, the length of post to buy and the area to stain.

3. Fence style

i
Boards and pickets are counted one by one along the run. Panels are counted by section. Chain link is counted in rolls of fabric.
i
The distance between posts, centre to centre. For panels it is the panel width plus the post. Many wood fences use 6 to 8 ft (1.8 to 2.4 m), and chain link makers publish their own limits.
i
The real width of one board. A board sold as 1 × 6 is about 5.5 in (14 cm) wide. For pickets, enter the picket width.
i
The space left between boards. Enter 0 for a tight privacy fence. A picket fence has a visible gap.
i
The horizontal rails that boards nail to. Two is common on a short fence and three on a 6 ft fence.
i
The price of one board. The example is not a quote.
i
The price of one rail. One rail is assumed to span one section.

4. Posts and concrete

i
The post takes up room in the hole, so the calculator subtracts it from the concrete. Wood sizes use real dimensions, for example 3.5 × 3.5 in for a 4 × 4. Changing the fence style picks a typical post.
i
QUIKRETE gives a hole depth of one-third to one-half of the above-ground post length, plus 6 in of gravel. Pick the rule, or enter your own depth. Local frost depth may require deeper holes.
i
QUIKRETE suggests a hole three times the width of the post. Pick that rule, or enter your own diameter.
i
Depth of gravel at the bottom of each hole for drainage. QUIKRETE suggests 6 in (15 cm). The post sits on it, and it takes the place of concrete at the bottom.
i
The size of bag you will use. Yields are the typical 0.30, 0.375, 0.45 and 0.60 cubic feet per bag. Check your bag label.
i
Extra boards for cuts and concrete for uneven holes. About 10 percent is a common choice. Panels and fabric rolls are not increased.
i
The price of one post, at the length you will buy.
i
The shelf price of one bag of concrete in the size selected.

5. Gate and labour prices

i
The price of one gate with its hardware. The example is not a quote.
i
What an installer charges for each foot (or metre) of fence. Enter 0 if you will build it yourself. The example is not a quote.

6. Stain or sealer (optional)

i
Choose both sides if you will stain the front and the back of the fence.
i
How many coats you will apply. Check the can for what it recommends.
i
The area one gallon (or litre) covers per coat, from the label. Rough or dry wood soaks up more, so real coverage can be lower.
i
The price of one gallon (or litre). The example is not a quote.
i
Choose Yes to include the cost of stain in the total. By default only the quantity is shown.
Estimated total cost
Fence length
Posts
Post hole depth
Post length to buy
Concrete bags
Stain or sealer

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:

    1. Measure the linear feet. Add up the length of every side that will carry fence. A closed rectangle is 2 × (length + width).
    2. Subtract the gates. A gate is an opening, not fence, so take its width out of the run.
    3. Divide by the post spacing and round up. That gives the number of sections.
    4. Add the posts. An open run needs one more post than it has sections. A closed loop needs the same number.
    5. 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 spacing8 ft spacing10 ft spacing
    50 ft1086
    100 ft181411
    150 ft262016
    200 ft352621

    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 run5.5 in boards, 0.25 in gap5.5 in boards, no gap3.5 in pickets, 1.5 in gap
    50 ft105110120
    100 ft209219240
    150 ft314328360
    200 ft418437480

    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 groundHole depth, one-third ruleHole depth, one-half rulePost length needed (one-third rule)Stock post to buy
    3 ft18 in24 in4.5 ft6 ft
    4 ft22 in30 in5.8 ft6 ft
    5 ft26 in36 in7.2 ft8 ft
    6 ft30 in42 in8.5 ft10 ft
    7 ft34 in48 in9.8 ft10 ft
    8 ft38 in54 in11.2 ft12 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.

    PostHole diameter (3 × width)Concrete per hole (cu ft)50 lb bags per hole80 lb bags per hole
    4 × 4 wood post (3.5 in)10.5 in1.032.751.72
    4 × 6 wood post (3.5 × 5.5 in)16.5 in2.707.214.50
    6 × 6 wood post (5.5 in)16.5 in2.556.804.25
    5 × 5 vinyl post (5 in)15.0 in2.115.623.51
    Round chain link post (2.375 in)7.1 in0.491.310.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.

    ItemQuantityExample priceCost
    Posts14$15 each$210
    Boards221$4 each$884
    Rails36$6 each$216
    Gate1$120 each$120
    Concrete (50 lb bags)43$6 each$258
    Materials$1,688
    Labour96 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 areaGallons, 2 coats at 250 sq ft per gallonGallons to buy
    50 ft600 sq ft4.805
    100 ft1,200 sq ft9.6010
    150 ft1,800 sq ft14.4015
    200 ft2,400 sq ft19.2020

    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:

    Local conditions and rules differ, so confirm the details with your building department.

    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.

    About the author

    Shivam · Software engineer and founder of Calctoolz

    I build the calculators on Calctoolz. For each tool I read the original formula or published guidance, write the logic to match it, and check the results against hand calculations before publishing. If you spot a number that looks wrong, please tell me.

    How this page was checked: counts use standard geometry, the post depth and hole size follow the QUIKRETE setting-posts guidance named in the sources, and prices are editable examples. The results were verified against hand calculations. Last reviewed October 18, 2026. This page is for planning and is not construction or legal advice.

    5/5 - (5 votes)