# Fence Calculator

Page: https://pilemath.com/fence-calculator/

Choose a type of fence and enter its length. You get the posts, boards or panels or chain link, rails, fittings, gates, concrete and gravel to buy, a shopping list with a cost, and a drawing to scale.

By [Vijay Kumar Singh](https://pilemath.com/about/#owner) · Last reviewed November 24, 2026 · [15 sources](https://pilemath.com/fence-calculator/#sources)

## Example

The calculator opens with this example. To run it with other numbers, open the page, or change this link (the link format is in https://pilemath.com/llms.txt): https://pilemath.com/fence-calculator/?a=d100&sp=8&gt=1&pt=4x4&ht=6&dr=third&hd=10&gv=6&tp=3&cm=fast50&x=10&pc=12.99&pg=6&fs=privacy&gw=4&gp=0&f.post=10.68&f.rail=3.98&f.picket=2.08&f.fasteners=12&f.gate=75

### Your fence needs about

- **$1,372** estimated materials cost
- **14** posts

- **Fence to build (gates taken off):** 96 ft
- **Pickets:** 231
- **Rails:** 40
- **Bags of 50 lb fast-setting:** 34
- **Gravel, 0.5 cu ft bags:** 9 bags

96 ft: 12 sections of 8 ft

**Materials list**

- **Posts, 4 × 4 wood (3½ in):** 14 posts · $150. 8 ft long: 6 ft above ground and 24 in in the ground.
- **Rails, 2 × 4 × 8 ft:** 40 rails · $159. 3 rows of rail along 96 ft of fence, with 10% extra for cuts.
- **Pickets, 5/8 × 5½ in × 6 ft, dog-ear:** 231 boards · $480. Boards 5.5 in wide, edge to edge, 6 ft tall, with 10% extra.
- **Nails or screws:** 1 box · $12. About one box for every 100 ft of fence; a rough allowance.
- **Gates:** 1 gate · $75. Walk gate, 4 ft wide, with hinges and latch.
- **Fast-setting concrete, 50 lb:** 34 bags · $442. For 14 posts, about 2.4 bags a post, with 10% extra.
- **All-purpose gravel:** 9 bags · $54. 6 in in the bottom of each hole, so water drains away from the post.

- Total, fence, concrete and gravel: $1,372
- Per foot of fence: $14 a foot
- Per post: $98 a post

Using example prices. Open “Enter your prices” to use your own.

[Find fence and lumber suppliers near you](https://www.google.com/maps/search/fence%20supply%20near%20me) to compare prices.

## Cost by length and height: wood privacy fence

Materials for a straight fence with no gates, at the prices entered above, including posts, concrete and gravel.

| Length | 4 ft tall | 5 ft tall | 6 ft tall |
| --- | --- | --- | --- |
| 50 ft | $589 | $669 | $708 |
| 100 ft | $1,099 | $1,233 | $1,324 |
| 150 ft | $1,616 | $1,813 | $1,930 |
| 200 ft | $2,122 | $2,376 | $2,531 |

## Key numbers

- **Posts:** one for each section, one to end each run and one for each gate
- **Rails:** 2 a section for a 4 ft fence, 3 for a 6 ft fence
- **Boards:** the length in inches ÷ (board width + gap)
- **100 ft of 6 ft privacy fence:** 14 posts, 42 rails, 240 boards, 34 bags of concrete
- **Chain link:** posts up to 10 ft apart, fabric in 50 ft rolls
- **Post depth:** a third to a half of the height above ground

## How the calculator works

1. Length: add up each run, then take off every gate opening. Each gate adds one post, because the opening has a post on both sides and one of them ends a section.
2. Posts: each run ÷ the spacing, rounded up, gives the sections; add one post to finish each run (runs that join end to end share it) plus one for each gate.
3. Rails (wood fences): a row of rail for every 2 ft of height, at least 2, cut from 8 ft rails, with your extra for cuts.
4. Boards: the length of fence in inches ÷ (the board’s width + the gap), rounded up, plus your extra. A privacy fence has no gap.
5. Chain link: fabric in 50 ft rolls, top rail in 10½ ft lengths, larger posts at every end, corner and gate, and fittings: a tension bar for each of those posts (two at a corner) and one fewer tension bands than the height in feet for each bar.
6. Vinyl: one panel for every section, and a cap for every post.
7. Concrete and gravel: the same hole, depth and bag math as the fence post concrete calculator, for every post. Cost: every part at your prices.

## Rails and posts by fence height

| Fence height | Rails in a section | Post length (a third in the ground) | Boards for 100 ft (5½ in, no gap) |
| --- | --- | --- | --- |
| 4 ft | 2 | 8 ft | 240 |
| 5 ft | 3 | 8 ft | 240 |
| 6 ft | 3 | 8 ft | 240 |
| 8 ft | 4 | 12 ft | 240 |

Rails by one row for every 2 ft of height, which gives the 2 and 3 rails a section that Lowe’s uses for 4 and 6 ft fences. The boards column includes 10% extra and is the same at every height.

## Worked example: 100 ft of 6 ft wood privacy fence

A 6 ft privacy fence 100 ft long, boards 5½ in wide edge to edge, 4 × 4 posts every 8 ft, 2 × 4 rails, fast-setting concrete and 10% extra. This is the same math the calculator runs.

1. Posts: 100 ÷ 8 = 12.5, rounded up to 13 sections, plus one to finish the run = 14 posts.
2. Rails: a 6 ft fence has 3 rows. 100 ft × 3 × 1.1 ÷ 8 ft = 41.3, rounded up to 42 rails.
3. Boards: 100 ft × 12 = 1,200 in ÷ 5.5 in = 218.2, × 1.1 = 240.0, rounded up to 240 boards.
4. Concrete: 14 holes 10 in wide and 30 in deep, 34 bags of 50 lb fast-setting mix, and 9 bags of gravel.
5. One 4 ft gate: take 4 ft off the length (96 ft to build) and add one post. That gives 14 posts, 231 boards and 40 rails, and the gate itself.
6. Cost at this page’s example prices: $828 for the fence and $496 for concrete and gravel = $1,324, about $13 a foot.

**Answer:** Buy 14 posts, 42 rails, 240 boards, 34 bags of concrete and 9 of gravel: about $1,324 for 100 ft.

## How many fence posts do I need?

Divide the length of each run by the post spacing, round up, and add one post to finish the run. Lowe’s worksheet puts it as one post for each section, one to end a run and one for each gate. Most wood fences put posts 8 ft apart, according to Hunker, to suit 8 ft rails; chain link line posts go no more than 10 ft apart. So 100 ft of wood fence takes 14 posts and 100 ft of chain link at 10 ft takes 11.

Runs that turn a corner share the corner post, so a fence that wraps around a yard needs one post fewer for each corner than separate runs would. Choose “Join end to end” when you add a second run.

## How many pickets or boards do I need?

Lowe’s method: divide the length of the fence in inches by the picket’s actual width plus the gap between pickets. A “6 in” board is really 5½ in wide, so a privacy fence with no gaps takes about 2.18 boards for every foot; with the 10% extra for cuts and bad boards, 100 ft takes 240.

A picket fence leaves a gap, usually 2–3 in. With 3½ in pickets and a 2½ in gap, 100 ft of fence takes 220 pickets including 10% extra. Change the gap and the board count changes with it. Fences built board on board or with a shadowbox pattern overlap their boards, which means a negative gap; for those, enter a smaller board width.

## How many rails does a fence need?

Lowe’s uses 2 backer rails in each section of a 4 ft fence and 3 for a 6 ft fence. This calculator puts a row of rail for every 2 ft of height, at least 2, which gives the same answers at those heights, 3 rails at 5 ft and 4 rails at 8 ft. Rails are cut from 8 ft lengths, so one rail covers one 8 ft section when the posts are 8 ft apart, and the calculator counts the total length of rail and divides by the length sold.

## Chain link fence parts

A chain link fence is posts, a top rail and fabric. Hoover Fence recommends 2 in line posts (1⅞ in across) and 2½ in terminal posts (2⅜ in across) for a residential fence. Terminal posts go at every end, corner and gate; the line posts between them are up to 10 ft apart.

The fabric comes in 50 ft rolls, a 6 ft roll for a 6 ft fence. At each terminal post a tension bar threads through the end of the fabric and tension bands hold it to the post. Ace Hardware says to use one fewer tension band than the height of the fence in feet, so a 6 ft fence takes 5 bands for each bar. A corner post takes two bars, one for each run. For this 100 ft fence that is 2 bars and 10 bands.

Add a post cap on every post, a loop cap on every line post to hold the top rail, brace bands with rail ends on the large posts, and tie wires to fix the fabric to the rail and line posts. The calculator counts them all.

## Vinyl fence panels

Vinyl privacy fence comes as kits of panels that lock into routed 5 × 5 in posts, so you count one panel for each 8 ft section and one post for every panel plus one. For 100 ft that is 13 panels and 14 posts. Vinyl posts are usually 9 ft long for a 6 ft fence, so more of the post goes in the ground than the rule of a third gives. Follow the maker’s instructions for hole depth.

## Gates

A gate opening has a post on each side. This calculator takes the width of each opening off the fence, counts one extra post for each gate, and lists the gate, with hinges and a latch, as a separate part. A walk gate is usually 3–4 ft wide; a drive-through gate is 10 ft or more. For a heavier gate, set the gate posts to half the height above ground, as Quikrete suggests for gates.

## What does it cost to build a fence?

| What you pay for | Example price |
| --- | --- |
| 4 × 4 × 8 ft ground-contact post | $10.68 |
| Dog-ear picket, 5/8 × 5½ in × 6 ft | $2.08 |
| 2 × 4 × 8 ft ground-contact rail | $3.98 |
| Chain link fabric, 6 ft × 50 ft roll | $139.00 |
| Chain link line post, 1⅞ in × 8 ft | $34.97 |
| Chain link end or corner post, 2⅜ in × 8 ft | $39.97 |
| Vinyl privacy panel kit, 6 × 8 ft | $130.90 |
| 100 ft of 6 ft wood privacy fence (example above) | about $1,324 |

Sources: Home Depot product pages, November 2026. Fasteners, wood and vinyl gates, vinyl posts and caps, and the small chain link fittings are rounded estimates; enter your own prices above.

These are materials only, with no tax, delivery or labor. Prices vary a lot by region and by the grade and species of wood, so use the prices you are quoted.

## Mistakes to avoid

- Counting one post per section. Every run needs one more post than it has sections, and every gate needs its own.
- Forgetting to take the gates off the length. A 4 ft gate is 4 ft of fence you do not need boards for.
- Using the nominal width of a board. A “6 in” picket is 5½ in wide.
- Buying exactly what the count says. Boards split and rails get cut wrong; buy 10% extra.
- Going too shallow. Posts need a third to a half of the fence height in the ground, plus gravel underneath.
- Digging before calling 811, and building without checking the height limit, setback and permit rules where you live.

## Common questions

### How many posts do I need for 100 ft of fence?

14 posts at 8 ft spacing, or 11 at 10 ft for chain link. Add one for each gate.

### How many pickets do I need for a 100 ft fence?

240 boards 5½ in wide with no gaps, including 10% extra, or 220 pickets 3½ in wide with a 2½ in gap.

### How many rails does a 6 ft fence need?

Three in each section, according to Lowe’s. A 4 ft fence takes two. For 100 ft with 8 ft sections that is 42 rails of 8 ft with 10% extra.

### How far apart should fence posts be?

About 8 ft for wood and vinyl fences and up to 10 ft for chain link line posts, according to Hunker.

### How much concrete do I need for fence posts?

About 2.4 bags of 50 lb fast-setting concrete a 4 × 4 post, which is 34 bags for the 100 ft privacy fence above. For a single post, use the fence post concrete calculator.

### How many rolls of chain link fabric do I need?

One roll for every 50 ft of fence, rounded up. 100 ft takes 2 rolls.

### How many tension bands does a chain link fence need?

One fewer than the height of the fence in feet for every tension bar, according to Ace Hardware: 5 for a 6 ft fence.

### How do gates change the count?

Take the gate opening off the length of fence and add one post for each gate, as in the Lowe’s worksheet. The gate and its hardware are extra.

### How much does it cost to build a fence?

The materials for 100 ft of the 6 ft wood privacy fence above come to about $1,324 at this page’s example prices, or $13 a foot. A 100 ft chain link fence is about $1,076 and a vinyl fence about $3,419, materials only.

### Do I need a permit for a fence?

Often, yes, for fences over a certain height or in some neighborhoods. Check the height limit, setback rules and any homeowners’ association rules before you buy.

## Sources

We checked the figures on this page against these sources on November 24, 2026. Prices are national ranges from the dates shown; your local yard may charge more or less.

1. [Fence Calculator: Building with Pickets](https://pdf.lowes.com/productdocuments/d27b01be-ea65-4de6-aa9c-7a485c4bab31/43237730.pdf), Lowe's. Counting posts, pickets, backer rails and post caps.
2. [Fence Post Spacing Guide](https://www.hunker.com/12000185/fence-post-spacing-guide/), Hunker (Shawn McClain) (May 2010). Post spacing for wood and chain link fences.
3. [0.065 Wall Round Chain Link Posts and Pipes](https://hooverfence.com/065-wall-round-chain-link-posts-and-pipes-color-coated), Hoover Fence Co. Chain link line post and terminal post sizes.
4. [2-3/8 in Galvanized Steel Chain-Link Tension Band](https://www.acehardware.com/p/7020506), Ace Hardware. One fewer tension band than the height of the fence in feet.
5. [Setting Posts in Concrete](https://quikrete.com/athome/SettingPosts.asp), Quikrete. Hole width and depth, gravel and filling to below the ground.
6. [Quikrete Fast Setting Concrete Mix, 50 lb](https://www.acehardware.com/p/52376), Ace Hardware (October 2026). Price of a 50 lb bag of fast-setting concrete.
7. [4 in. x 4 in. x 8 ft. #2 Ground Contact Pressure-Treated Southern Yellow Pine Wood Post](https://www.homedepot.com/p/4-in-x-4-in-x-8-ft-2-Ground-Contact-Pressure-Treated-Southern-Yellow-Pine-Wood-Post-194354/205220341), The Home Depot (November 2026). Price of a 4 × 4 × 8 ft ground-contact post.
8. [Wood Fence Pickets](https://homedepot.com/b/Lumber-Composites-Fencing-Wood-Fencing-Wood-Fence-Pickets/N-5yc1vZc3mo), The Home Depot (November 2026). Prices of dog-ear pickets.
9. [2 in. x 4 in. x 8 ft. #2 Ground Contact Pressure-Treated Southern Yellow Pine Lumber](https://homedepot.com/b/Lumber-Composites-Decking-Deck-Boards-Wood-Decking-Boards/8-ft/N-5yc1vZc80mZ1z1rkql), The Home Depot (November 2026). Price of a 2 × 4 × 8 ft ground-contact rail.
10. [6 ft. x 50 ft. 11.5-Gauge Galvanized Steel Chain Link Fence Fabric](https://homedepot.com/p/Everbilt-6-ft-x-50-ft-11-5-Gauge-Galvanized-Steel-Chain-Link-Fence-Fabric-308706EB/313173575), The Home Depot (Everbilt) (November 2026). Price of a roll of chain link fabric.
11. [1-7/8 in. Dia. x 8 ft. 16-Gauge Galvanized Steel Chain Link Fence Line Post](https://www.homedepot.com/p/Everbilt-1-7-8-in-Dia-x-8-ft-16-Gauge-Galvanized-Steel-Chain-Link-Fence-Line-Post-328934DPTSEB/312373073), The Home Depot (Everbilt) (November 2026). Price of a chain link line post.
12. [2-3/8 in. Dia x 8 ft. 15-Gauge Galvanized Steel Chain Link Fence Corner Post](https://homedepot.com/p/Everbilt-2-3-8-in-Dia-x-8-ft-15-Gauge-Galvanized-Steel-Chain-Link-Fence-Corner-Post-328954DPTSEB/313173553), The Home Depot (Everbilt) (November 2026). Price of a chain link end or corner post.
13. [Chain Link Fence 2-3/8 in. Galvanized Steel Tension Band](https://www.homedepot.com/p/Everbilt-2-3-8-in-Galvanized-Steel-Chain-Link-Fence-Tension-Band-328524EB/312373167), The Home Depot (Everbilt) (November 2026). Price of a tension band.
14. [Chain Link Fence Gates](https://homedepot.com/b/Lumber-Composites-Fencing-Chain-Link-Fencing/Gate/N-5yc1vZc3lhZ1z0zw2p), The Home Depot (November 2026). Prices of chain link gates.
15. [Dover 6 ft. H x 8 ft. W Vinyl Privacy Fence Panel Kit](https://www.homedepot.com/p/203179275), The Home Depot (November 2026). Price of a vinyl privacy panel kit.

See a figure that does not match your supplier? [Tell us](https://pilemath.com/contact/) and we will check it. [How we check our numbers](https://pilemath.com/about/#how-we-check).

## More calculators

- [Fence Post Concrete Calculator](https://pilemath.com/fence-post-concrete-calculator/): Bags of concrete and gravel for every fence post, from the length of the fence.
- [Concrete Calculator](https://pilemath.com/concrete-calculator/): Bags and cubic yards for slabs, footings, steps and piers, plus rebar or mesh.
- [Deck Calculator](https://pilemath.com/deck-calculator/): Deck boards, joists, beam, posts, footings, concrete, screws, stairs, railing and cost for a whole deck, sized from the code tables.
- [Landscaping Pricing Calculator](https://pilemath.com/landscaping-pricing-calculator/): Price a landscaping job from materials, labor, equipment and overhead at the margin you want.
