This fence calculator turns one tape measurement into a shopping list: how many posts, rails, pickets and bags of concrete you need, plus how long to cut your posts. Measure the total run of the fence, decide your post spacing and height, and enter the actual width of the picket you plan to buy. The default inputs (100 ft, 8 ft spacing, 6 ft high, 5.5 in pickets, no gap, 2 bags per post) produce 14 posts, 39 rails, 219 pickets, 28 bags and 9 ft posts.
Quick steps: use the fence calculator
- Walk the fence line with a 100 ft tape and add up every straight leg, gates included.
- Enter the sum in Total fence length (ft).
- Set Post spacing (ft) to match your rail length, normally 8 ft.
- Enter Fence height (ft) so the tool picks 2 or 3 rails per section.
- Enter the actual Picket width (in) and your Gap between pickets (in).
- Leave Concrete bags per post at 2 unless your holes are wider than 10 in or deeper than 3 ft.

Tools and materials
- 100 ft open-reel tape or measuring wheel
- Mason’s string and stakes for the fence line
- Marking paint for post locations
- Pressure-treated 4×4 posts (8, 10 or 12 ft)
- Pressure-treated 2×4 rails (8 ft)
- Dog-ear pickets, 1×6 (5.5 in actual) or 1×4 (3.5 in actual)
- Fast-setting concrete, 50 lb bags
- Exterior screws or ring-shank galvanized nails
- Gate hardware kit (hinges, latch, anti-sag cable)
Safety first
Call 811 at least two working days before you dig so gas, electric and water lines get marked for free. Wear eye protection when driving fasteners and gloves when handling treated lumber.
How to use the fence calculator
The tool has six fields. Each one controls one line of the material list, so a wrong entry in one box throws off one count rather than the whole order. Here is what to measure and where people go wrong.
Total fence length (ft)
Measure every straight leg from corner to corner and add them up. Include the gate openings in the total. The calculator counts pickets by length, and you still need pickets to build the gate.
Measure along a taut string line, not along the ground. A sloped yard reads longer on the ground than it does post to post, and that extra length turns into pickets you never use. If your plan calls for the fence to butt against the house or garage, measure to the wall, not to the property pin.
Check your survey or plat before you measure. Most towns want the fence set a few inches inside the line, and an HOA may limit height or type. Fixing a fence that sits over the line is far more expensive than a half-hour with the survey.
Post spacing (ft)
This is the on-center distance between posts. Leave it at 8 ft if you plan to buy 8 ft rails, which is the standard length and the cheapest per foot. Drop it to 6 ft for a tall fence in a windy area, or anywhere you want a stiffer panel. Going above 8 ft with 2×4 rails invites sag.
The calculator divides your length by this number and rounds up, so a 100 ft run at 8 ft spacing becomes 13 sections, with the last one short. In the field you can either keep one short bay at the end or shrink every bay a few inches so they come out even. Either way the post count is the same.
Fence height (ft)
Enter the finished height above grade. The number does two things. It picks the rail count (2 rails at 5 ft or lower, 3 rails above 5 ft) and it sets post length at 1.5 times the height, with one third of the post in the ground.
Common entries are 4 ft for a front-yard picket fence, 6 ft for a backyard privacy fence and 8 ft where codes allow it. Check your local limit before you buy. Many municipalities cap front yards at 4 ft and backyards at 6 ft without a variance.
Picket width (in)
Enter the actual width of the board, not the nominal size. A “1×6” fence picket is 5.5 in wide. A “1×4” is 3.5 in. Product images and shelf tags show the nominal size, so read the fine print or measure one at the store. Entering 6 instead of 5.5 on a 100 ft fence drops the count by about 19 pickets, which is a second trip you did not want.
Gap between pickets (in)
Set this to 0 for a privacy fence with boards butted edge to edge. Use the real gap for a spaced picket fence. A 3.5 in picket with a 3.5 in gap is a classic look. Shadowbox and board-on-board styles overlap boards, so the calculator understates those; add 25 to 50 percent for board-on-board depending on your overlap.
Concrete bags per post
The default of 2 bags per post assumes a hole about 8 to 10 in across and 2 to 3 ft deep with a 4×4 post. A 12 in hole 3 ft deep needs 3 bags of 50 lb fast-setting mix, so bump the number if you are digging oversized holes for gate posts or in soft soil. If you want to check hole volume precisely, our concrete calculator works for footings and post holes as well as slabs.
The fence calculator formula, written out

Every number on the page comes from five short calculations. Here is each one in plain language.
Sections = Total fence length divided by Post spacing, rounded up to a whole number. A partial section still needs a full set of rails and its own post.
Posts = Sections plus 1. A straight run always has one more post than it has bays. Add one post for every gate (two for a double gate) and keep one extra for any corner where two legs meet at an uneven spacing.
Rails = Sections multiplied by 2 if the fence is 5 ft or lower, or by 3 if it is taller than 5 ft. The third rail is what keeps a 6 ft privacy fence from cupping and keeps the pickets straight.
Pickets = Total fence length multiplied by 12, divided by (Picket width plus Gap), rounded up. Converting feet to inches first keeps the units honest. This is the one count that does not care about post spacing.
Concrete bags = Posts multiplied by Concrete bags per post.
Post length = Fence height multiplied by 1.5. One third of that length goes in the ground, so a 6 ft fence puts 3 ft of post below grade.
Worked example 1: the default inputs
- Sections: 100 ft divided by 8 ft is 12.5, rounded up to 13 sections.
- Posts: 13 plus 1 is 14 posts.
- Rails: the fence is 6 ft, so 3 per section. 13 times 3 is 39 rails.
- Pickets: 100 times 12 is 1,200 in. Picket width plus gap is 5.5 plus 0, or 5.5 in. 1,200 divided by 5.5 is 218.2, rounded up to 219 pickets.
- Concrete: 14 posts times 2 bags is 28 bags.
- Post length: 6 ft times 1.5 is 9 ft, with 3 ft buried.
That is exactly what the calculator above shows with the defaults loaded.
Worked example 2: a 150 ft spaced picket fence
Say you are building a 4 ft front-yard fence around a corner lot. The run totals 150 ft. You want posts 6 ft on center for a tighter look, 1×4 pickets (3.5 in) with a 0.5 in gap, and your holes are shallow enough for 1 bag each.
- Sections: 150 divided by 6 is exactly 25, so 25 sections with no short bay.
- Posts: 25 plus 1 is 26 posts.
- Rails: 4 ft is 5 ft or lower, so 2 per section. 25 times 2 is 50 rails.
- Pickets: 150 times 12 is 1,800 in. 3.5 plus 0.5 is 4 in. 1,800 divided by 4 is exactly 450 pickets.
- Concrete: 26 times 1 is 26 bags.
- Post length: 4 ft times 1.5 is 6 ft, with 2 ft buried.
Now add the parts the calculator cannot see. Two gates add 2 posts, and the lot has 3 corners, so order 31 posts. That pushes concrete to 31 bags.
Pro tip
Run each straight leg through the calculator separately, then add the results. A single 150 ft total hides the fact that a 37 ft leg and a 113 ft leg each round up on their own, and you will come up a post short at one corner.
Quick-reference material counts
All rows use the defaults: 8 ft spacing, 6 ft high, 5.5 in pickets, no gap, 2 bags per post. Posts do not include gate or corner extras.
| Fence length | Sections | Posts | Rails (3 per section) | Pickets | Concrete bags | Post length |
|---|---|---|---|---|---|---|
| 50 ft | 7 | 8 | 21 | 110 | 16 | 9 ft |
| 100 ft | 13 | 14 | 39 | 219 | 28 | 9 ft |
| 150 ft | 19 | 20 | 57 | 328 | 40 | 9 ft |
| 200 ft | 25 | 26 | 75 | 437 | 52 | 9 ft |
| 300 ft | 38 | 39 | 114 | 655 | 78 | 9 ft |
Pickets scale with length only. Posts, rails and concrete scale with sections, which is why tightening post spacing from 8 ft to 6 ft raises the lumber bill by roughly a third on everything except pickets.
Fence post depth by height
People search for a fence post depth calculator as a separate tool, but the rule inside this one is simple: bury one third of the post. The table shows the post length the formula returns and the standard lumber length you will actually buy.
| Fence height | Calculated post length | Buried depth | Lumber to buy |
|---|---|---|---|
| 4 ft | 6 ft | 2 ft | 8 ft (cut down or set deeper) |
| 5 ft | 7.5 ft | 2.5 ft | 8 ft |
| 6 ft | 9 ft | 3 ft | 10 ft |
| 8 ft | 12 ft | 4 ft | 12 ft |
Two cautions. First, the hole must reach below the frost line, which runs from a few inches in the Gulf states to 4 ft or more in the northern Plains and New England. Check with your building department. Second, many contractors in mild climates set 8 ft posts for a 6 ft fence with only 2 ft buried. That works in firm soil with a 6 ft privacy fence out of the wind, but it is the first thing to lean after a wet winter. Spend the extra on 10 ft posts.
Buying and ordering the materials
Suppliers sell fence lumber by the piece, not by the linear foot, which is why the calculator reports counts. Posts, rails and pickets each have their own SKU. Here is what to expect when you build the order.
Units and bundle sizes
Pickets normally come loose in the aisle and in strapped bundles in the yard. Bundle counts vary by supplier, so ask. Buying full bundles is cheaper per piece and the boards are usually straighter because they have not been picked over. Rails and posts are sold individually.
Concrete comes in 50 lb and 80 lb bags, and in 50 lb fast-setting mix that you pour dry into the hole and wet in place. The calculator’s bags-per-post figure assumes 50 lb bags. If you buy 80 lb bags, order about two thirds as many. Pallets are available for pickup or delivery and often carry a per-bag discount.
Hardware is the line everyone forgets. A 3-rail privacy fence takes 6 fasteners per picket, so the default 219 pickets need about 1,300 screws or nails. Buy 1-5/8 in exterior screws by the 5 lb box, or 6d ring-shank galvanized nails if you are using a nail gun. Rails need 3 in screws or 16d galvanized nails, or metal fence brackets if you hang rails between posts.
Delivery, pickup and returns
Big-box stores charge a flat delivery fee for a lumber order, and a 100 ft privacy fence will not fit in a pickup bed in one trip. Local lumber yards often waive the fee above a minimum order and will stack it where you point. Use the store locator to price both options; the yard is frequently cheaper once delivery is counted.
Order with a return in mind. Most stores take back unopened concrete bags and undamaged lumber with a receipt, so overbuying by a few pieces costs nothing but a second trip. Check the return window before you add everything to the cart, because some stores limit lumber returns to 30 days.
How much extra to order
- Pickets: add 5 to 10 percent. Every bundle has a few boards with splits, wane or twist, and you will cut some to length at corners and gates.
- Posts: add 1 per gate, 2 per double gate, 1 per corner and 1 spare. A split 4×4 is common and you do not want to stop at the last hole.
- Rails: add 2 to 3 for a 100 ft fence. Short end bays, gate frames and a bowed board eat these up.
- Concrete: add 10 percent. Holes that hit soft fill or a root get dug wider than planned.
Realistic material prices
Lumber prices swing with the market and your region, so treat these as the range you will typically see at a US home center and confirm at your local store before ordering.
| Item | Typical price range |
|---|---|
| Pressure-treated 4×4 x 8 ft post | $10-16 each |
| Pressure-treated 4×4 x 10 ft post | $14-22 each |
| Pressure-treated 2×4 x 8 ft rail | $5-8 each |
| Pressure-treated 1×6 x 6 ft dog-ear picket | $2.50-4.50 each |
| Cedar 1×6 x 6 ft dog-ear picket | $4-7 each |
| Fast-setting concrete, 50 lb bag | $6-8 each |
| Gate hardware kit | $25-60 |
Priced at the middle of those ranges, the default 100 ft fence comes to roughly $200 for posts, $250 for rails, $750 for treated pickets, $200 for concrete and $80 for fasteners and hardware. Call it about $1,500 in materials, or around $15 per linear foot. Cedar pickets push that closer to $20 per foot.
Installed, a 6 ft wood privacy fence from a contractor typically runs $25 to $50 per linear foot, and vinyl privacy fence runs $30 to $60 per foot depending on style and height. That makes labor roughly half the bill on wood, which is the main reason people build their own.
Pro tip
Fast-setting concrete does not need mixing. Set the post, pour the dry mix into the hole to within 3 in of grade, then add about a gallon of water per bag and let it soak in. The post is braced in 20 to 40 minutes and you can hang rails the same day.
Common mistakes that cause running short or over-buying
Entering nominal picket width. Typing 6 for a 5.5 in picket on a 200 ft fence costs you 37 boards. Measure the actual board.
Measuring along the ground on a slope. The fence follows a stepped or raked line that is shorter than the ground surface. Measure between stakes along a level string.
Forgetting gate and corner posts. The formula counts a single straight run. A typical backyard has 2 or 3 corners and at least one gate, so 14 posts becomes 18 very quickly.
Rounding spacing instead of sections. Dividing 100 ft by 8 and calling it 12 sections leaves you one bay short of the property line. The calculator rounds up for a reason.
Buying 8 ft posts for a 6 ft fence. You end up with 2 ft in the ground in a hole that may not reach frost depth. Buy 10 ft posts and cut the tops after the rails are on.
Ignoring the third rail. A 6 ft privacy fence on two rails looks fine on day one and cups within a year. The calculator adds the middle rail automatically above 5 ft; do not delete it from the order.
Skipping the hardware line. A box of screws and a gate kit are small items, but running out at 6 p.m. on a Saturday stops the job cold.
Using one total for an L-shaped or U-shaped yard. Each leg rounds up on its own in the field. Calculate per leg and sum.
Confusing 50 lb and 80 lb bags. The default 2 bags per post assumes 50 lb. Ordering 28 bags of 80 lb mix is about 40 percent more concrete than you need.
Troubleshooting the numbers
| Symptom | Likely cause | Fix |
|---|---|---|
| Picket count seems far too high | Gap entered as 0 on a spaced fence | Enter the real gap in inches |
| Picket count seems too low | Nominal width (6) entered instead of actual (5.5) | Measure a picket and re-enter |
| Post count does not match your layout | Corners and gates not included | Add 1 per corner, 1 per single gate, 2 per double |
| Only 2 rails shown on a 6 ft fence | Height entered as 5 or lower | Enter the true finished height |
| Post length longer than any lumber you can buy | Height of 8 ft gives 12 ft posts | Buy 12 ft posts or set 10 ft posts in 2.5 ft with gravel and concrete |
| Concrete count feels low | Oversized holes or 80 lb bags assumed | Raise bags per post to 3 for 12 in holes |
When to call a pro
Hire a licensed fence contractor if the line sits on a disputed boundary, the fence will retain soil or run along a pool (pool barrier codes are strict and inspected), the run is over 300 ft, or you hit rock or a high water table at post depth. A surveyor is the right call if you cannot find both property pins.
FAQ
How much does a fence cost?
For a 6 ft wood privacy fence, plan on roughly $15 per linear foot in materials if you build it yourself with treated pickets, and $25 to $50 per foot installed by a contractor. Vinyl costs more up front but needs no staining. Run your length through the calculator above, multiply each count by your local store’s prices, and add about 10 percent for extras and hardware to get your own project total.
What is the cost to install a wood fence per foot?
Contractors in most of the US quote $25 to $50 per linear foot for a 6 ft treated privacy fence, with cedar typically in the $27 to $43 range or higher. A 150 ft backyard therefore lands between $3,750 and $7,500 installed. Removing an old fence usually adds $3 to $10 per foot.
What does vinyl fence installation cost compared to wood?
Vinyl, which is the same thing as PVC fencing, typically runs $30 to $60 per linear foot installed for 6 ft privacy panels. Material alone is often double the cost of treated wood, but labor is similar because the posts still get dug and set in concrete. Over 20 years the vinyl fence costs less once you count staining or sealing wood every 2 to 3 years.
How much does it cost to replace a wood fence?
A wooden fence replacement cost is the new fence price plus demolition and haul-away. Figure $3 to $10 per foot for tear-out if you hire it as a standalone job, toward the low end when it is bundled with the new installation, or a rented dump trailer and a weekend if you do it yourself. If the old posts are solid and plumb, you can reuse them and replace only rails and pickets, which cuts the material list from the calculator by about a third.
How deep should fence posts be?
One third of the post length, which is what the calculator uses. A 6 ft fence gets 9 ft posts with 3 ft buried; a 4 ft fence gets 6 ft posts with 2 ft buried. Go deeper if your frost line is below that figure, and add 6 in of gravel under the post for drainage in heavy clay.
How many pickets do I need per 8 ft section?
With 5.5 in pickets and no gap, 96 in divided by 5.5 is 17.5, so 17 full pickets and a ripped partial per bay. The calculator works from total length rather than per section, which avoids stacking up a half picket of waste on every bay. For 3.5 in pickets with a 3.5 in gap it is 96 divided by 7, or about 14 per section.
Does the calculator handle gates?
Partly. Including the gate opening in your total length gives you the pickets and rails to build the gate frame. It does not add the gate posts, so add 1 post for a single swing gate and 2 for a double swing gate, plus a gate hardware kit. Set gate posts in 12 in holes with 3 bags of concrete each, because hinges put far more load on a post than a panel does.
Can I use this calculator for a chain-link or vinyl fence?
Use it for posts, sections and concrete, which follow the same spacing math. Ignore the picket and rail counts. Vinyl fences come in prefabricated panels, usually 6 or 8 ft wide, so set Post spacing to the panel width and read the post and concrete lines. Chain link uses 10 ft post spacing with top rail sold in 21 ft lengths, so the rail count does not apply.
What if my yard slopes?
Measure the fence line along a level string between stakes, not along the ground. On a slope you will either step each section down (post tops at different heights, panels level) or rake the rails to follow the grade. Stepping needs slightly longer posts on the downhill side, so add 2 ft to the post length for any bay that drops more than 8 in.

