Fence Calculator
Calculate fence materials — enter your fence length, post spacing and height to get the number of posts, rails, pickets and concrete bags, plus an estimated cost.
United States — national average · 2026 prices
Material only unless stated as installed. Excludes tax, permits and local labour. Verify with local suppliers — see how we calculate.
How this calculator works
Every figure above comes from the formula below, applied to the assumptions listed. Nothing is looked up from a hidden table — you can reproduce the result by hand.
Formula
posts = ⌈total length ÷ post spacing⌉ + 1 · sections = posts − 1
fence run = total length − (gates × gate width)
rails = ⌈fence run ÷ post spacing⌉ × rails per section
pickets = fence run × 12 ÷ (picket width + gap)
concrete bags = posts × bags per post
Assumptions & limits
- Rails per section scale with height: 2 up to 4 ft, 3 from 4 to 7 ft, 4 above that. Concrete scales the same way: 1 bag per post up to 4 ft, 2 up to 6 ft, 3 above.
- Concrete is counted in 50 lb bags at about 2 bags for a typical 6 ft fence post. That suits a 4×4 post in a 10 in hole roughly 2 ft deep — a deeper hole, a wider auger or a 6×6 post needs more.
- Gate openings are subtracted from the picket and rail run because gates are pre-built units. Gate width defaults to 4 ft.
- Default picket width is 5.5 in with a zero gap, which is a solid privacy fence. Enter a gap for a spaced picket or shadowbox fence.
- Costs assume $14 per post, $7 per rail, $3 per picket, $6 per bag of concrete and $90 per gate kit.
- Post depth is a frost-line and code question, not a materials question. The IRC and your local building department set embedment depth, and many jurisdictions also cap fence height and require a setback.
- Not included: post caps, hardware, stain or sealer, and any grading or stepping on sloped ground.
Worked example
150 ft of 6 ft privacy fence, posts 8 ft apart, one 4 ft gate, 5.5 in pickets butted tight
- Posts = ⌈150 ÷ 8⌉ + 1 = 19 + 1 = 20 posts, so 19 sections
- Fence run = 150 − 4 = 146 ft
- Rails = ⌈146 ÷ 8⌉ × 3 = 19 × 3 = 57 rails
- Pickets = 146 × 12 ÷ 5.5 = 318.5 → 319 pickets
- Concrete = 20 posts × 2 bags = 40 × 50 lb bags
Result:20 posts, 57 rails, 319 pickets, 40 bags of concrete and 1 gate kit — roughly $1,769 to $2,261 in materials.
How do I calculate fence materials?
A wood fence is a repeating kit of four parts: posts set in concrete, horizontal rails spanning between them, vertical pickets on the rails, and the concrete that holds the posts. Estimating a fence means counting each part from one measurement — the total linear feet — plus your post spacing, height and picket size. The calculator above returns all four, minus your gate openings, with an estimated cost.
Posts: spacing and count
Posts carry the whole fence, so start there. Divide the run by the on-center spacing and add one for the last post:
posts = ⌈ length ÷ spacing ⌉ + 1 · sections = posts − 1
Wood posts are usually set 6 to 8 feet apart. Eight feet is standard for typical rails and pickets; drop to 6 feet for tall privacy panels, heavy materials or windy sites. Corners, ends and gates each need their own post, so add for those. Set each post about one-third of its above-ground height into the ground — a 6 ft fence wants a hole roughly 2 to 3 feet deep.
Worked example: a 150 ft privacy fence
Say you are building 150 linear feet of 6 ft privacy fence at 8 ft spacing with one 4 ft gate and solid 5.5 in pickets:
- Posts = ⌈150 ÷ 8⌉ + 1 = 19 + 1 = 20 posts
- Sections = 20 − 1 = 19 sections
- Rails at 3 per section (6 ft fence) = 19 × 3 = 57 rails
- Picket run = 150 − 4 (gate) = 146 ft = 1,752 in; pickets = 1,752 ÷ 5.5 = ≈ 319 pickets
- Concrete at 2 bags/post = 20 × 2 = 40 × 50 lb bags
The calculator scales rails and concrete with height automatically — a 4 ft fence uses 2 rails and about 1 bag per post, an 8 ft fence 4 rails and about 3 bags.
Rails per section by height
| Fence height | Rails per section | Concrete / post |
|---|---|---|
| 3–4 ft | 2 rails | ≈ 1 bag |
| 5–6 ft | 3 rails | ≈ 2 bags |
| 7–8 ft | 4 rails | ≈ 3 bags |
Pickets: privacy vs spaced
Picket count depends on the picket width and the gap you leave between them:
pickets = fence length (in) ÷ (picket width + gap)
- Solid privacy fence: no gap — pickets butt together. A standard picket is 5.5 in (a nominal 1×6). Some builders overlap or add a 3/8 in gap to allow for wood swelling.
- Spaced picket fence: add the gap (often equal to a picket width for a classic look), which roughly halves the count.
Subtract gate openings from the run before counting pickets and rails — gates are pre-built units, not framed on site.
How much does a fence cost?
Fence cost splits into materials and labor. The figures below are typical 2026 US ranges and are estimates only.
| Item | Typical cost (2026 est.) |
|---|---|
| Wood privacy fence, installed | $15–$40 / linear ft |
| 150 ft wood fence, installed | ≈ $2,500–$6,000 |
| Materials only (share of the above) | ≈ one third |
| Chain-link, installed | $10–$25 / linear ft |
| Vinyl, installed | $20–$45 / linear ft |
Price moves with height, wood species (cedar and redwood cost more than pressure-treated pine), terrain, gates and how many corners the layout has. Get itemized bids and compare to the material estimate above.
Common mistakes
- Uneven post spacing. Odd spacing makes rails and pickets fall on awkward lengths. Lay out the whole run first and split it into even sections.
- Shallow post holes. Posts that are not deep enough (or below the frost line in cold climates) heave and lean. Depth is what keeps a fence straight.
- Forgetting gate posts. Gates hang on heavier, deeper-set posts — plan and buy them with the rest.
- No gap on solid fences. Wood swells; butting wet or green boards tight can buckle a run. A small gap or overlap avoids it.
- Skipping waste. Warped and split boards are normal — order about 10% extra pickets and a couple of spare posts.
When to hire a pro
A short, flat fence on clear ground is a solid DIY project if you can dig straight, deep holes and keep posts plumb. Bring in a fence contractor for long runs, sloped or rocky ground, tall privacy fences that catch wind, anything near a property line you need surveyed, or digging close to utilities — always call 811 to locate lines first. Use this calculator to size the materials and get accurate bids. For the post-setting concrete, see the concrete calculator and the concrete bags calculator; if you're also hardscaping the yard, the paver, gravel and retaining wall calculators cover the rest.
Figures here are estimates only and vary by region, materials, terrain and supplier as of 2026 — verify quantities and pricing with a local supplier or fence contractor, and call 811 before you dig.
Frequently asked questions
How do I calculate fence materials?
Start with the total linear feet of fence. Divide by your post spacing (usually 6 or 8 ft on-center) and add 1 for the number of posts. Multiply the number of sections by the rails per section for rails, and divide the fence length in inches by the picket width plus gap for pickets. The calculator above does all of this and adds concrete for the post holes.
How many fence posts do I need?
Divide the fence length by the post spacing and add one for the final post. At 8 ft spacing, a 150 ft fence needs 150 ÷ 8 = 19 sections, so about 20 posts. Closer 6 ft spacing gives a stiffer fence but more posts. Gates and corners need their own posts, so add for those.
How far apart should fence posts be?
Wood fence posts are typically set 6 to 8 feet apart on-center. Eight feet is the most common for standard pickets and rails; drop to 6 feet for tall privacy fences, heavy panels or windy sites where you want extra stiffness. Keep the spacing even so rail and picket lengths work out cleanly.
How much concrete do I need per fence post?
A typical 4×4 post in a 10-inch-wide hole about 2 feet deep takes roughly one to two 50 lb bags of fast-setting concrete. Taller fences and end or gate posts go deeper and take more. Set posts about one-third of their above-ground height into the ground. The calculator estimates bags per post from your fence height.
How many pickets do I need?
Divide the fence length in inches by the picket width plus any gap between pickets. For a solid privacy fence with 5.5-inch pickets and no gap, a 100 ft run (1,200 in) needs about 1,200 ÷ 5.5 = 218 pickets. Add a spacing gap for a picket-style fence, which lowers the count. Subtract any gate openings first.
How much does a fence cost?
A wood privacy fence typically runs about $15–$40 per linear foot installed in 2026, so a 150 ft fence often costs $2,500–$6,000 depending on height, wood species, terrain and gates. Materials alone are roughly a third of that. Chain-link and vinyl fall in different ranges. Get itemized bids and compare to the material estimate above.
How much extra material should I buy for a fence?
Add about 10% to pickets and rails for cuts, waste and the occasional warped board you set aside, and buy a couple of spare posts. Order it with the main load so the wood matches and weathers together. Concrete is cheap insurance — keep an extra bag or two on hand for a deep or loose hole.
How much does it cost to build a 100 ft fence?
For a 6 ft wood privacy fence with posts 8 ft apart and one gate, the calculator counts 14 posts, 36 rails, about 210 pickets and 28 bags of concrete - roughly $1,200-$1,500 in materials at typical 2026 prices. Installed by a contractor, a 100 ft wood privacy fence usually lands around $2,000-$3,500 depending on region and terrain. Enter your exact run above for a tailored list.
How much would a 200 ft privacy fence cost?
Doubling the run to 200 ft needs 26 posts, 75 rails, about 430 pickets and 52 bags of concrete - roughly $2,300-$3,000 in materials. Installed, plan on about $4,000-$7,000. The cost per foot drops slightly on longer runs because end posts and the gate are shared across more fence, which is why a 200 ft fence costs a bit less than twice a 100 ft one.
