Fence Calculator
Posts, rails, pickets, and concrete for one run of fence — with the two numbers that go wrong most often worked out properly: how many posts (sections plus one, plus two per gate) and how long they need to be.
One straight run of fence
One continuous run, measured along the ground. Each separate run needs its own post at each end, so run them through here one at a time and add the results.
A maximum, not a target — eight feet is usual because rails come in eight-foot lengths. The run is then divided evenly, so the last bay is never the odd one out. Six feet is the sturdier choice for a solid privacy panel, a high-wind site, or soft or sandy soil.
Finished height above grade, not the length of the post. The post length is worked out below. Many towns cap a front-yard fence at four feet and a back-yard fence at six.
Zero where the ground does not freeze. Elsewhere it is a published local figure — your building department has it, and it decides whether your fence is still straight in five years.
Each gate adds two posts — a hinge post and a latch post. A line post asked to carry a swinging leaf works loose within a season.
Two rails carry a fence up to about five feet. Three is standard at six feet — the middle rail is what stops long pickets cupping and twisting.
The measured width, not the nominal one: a 1×6 picket is 5.5 inches wide and a 1×4 is 3.5.
Zero butts them tight; a quarter inch leaves room for wet timber to swell. Spaced picket fences run two to three inches.
Roughly three times the post width — ten inches for a 4×4, twelve for a 6×6. Before you dig anything, call your utility locate service (811 in the United States). It is free, and it is the one call on this page that can save your life.
13 sections at 7.69 ft need 14 line posts — sections plus one — and the gate adds 2. Buy them 8 ft long.
- Sections between posts
- 13 at 7.69 ft
- Line posts (sections + 1)
- 14
- Gate posts (2 per gate)
- 2
- Post length needed
- 8.00 ft — buy 8 ft
- Depth in the ground
- 2.00 ft
- Rails
- 39 pieces (300.00 ft)
- Usual rails for this height
- 3
- Pickets
- 209
- Picket run (gates excluded)
- 100.00 ft
- Concrete for the holes
- 17.45 cu ft (0.65 cu yd)
- Concrete bags (80 lb)
- 2 per hole — 30 to order
| Item | Quantity | Detail |
|---|---|---|
| Posts | 16 | 8 ft long, 2.00 ft buried |
| Rails | 39 | 7.69 ft each, 300.00 ft in total |
| Pickets | 209 | 5.5 in wide, 0.25 in gap |
| Concrete | 17.45 cu ft | 30 bags (80 lb), 0.65 cu yd |
| Gates | 1 | width not entered |
- Call before you dig. In the United States, dial 811 and the utilities mark their buried lines for free, usually within a few working days. Then check your property line and your local setback rules — a fence built a foot over the line is a fence you take down again.
- One third of the height above grade puts these posts 2.00 ft down. If your local frost line is deeper than that, enter it above — a post that ends above the frost line heaves out over a few winters, and that is how most fences fail.
- The post count is sections + 1, plus two per gate. Forgetting the +1 is the classic fence mistake: you find out at the last hole, one post short, with the yard closed.
- Concrete here is the gross volume of the holes — the post itself displaces a little of it, so this errs high by a few percent. The concrete calculator turns 17.45 cu ft into bag counts, and flags whether it is under the ready-mix minimum.
- A gate’s width comes out of the picket count, not the post count or the rails — the run still wants the same sections and the same rails either side of the opening. Enter it above once you know it; zero leaves the whole run in pickets.
- Any cost above is materials only, at the prices you entered — posts, rails, and pickets by the piece, 30 bags of concrete at 0.6 cu ft each, and gate hardware by the opening. Waste, fasteners, delivery, and labor are not in it.
From a run length to a material list
Everything on this page comes out of two divisions and one addition. The run is divided by the post spacing to get sections, and by the picket pitch to get pickets; both divisions round up, because a part-section still needs a post at the end of it and a part-picket still needs a whole board. Then one post is added, because a line of sections has a post at each end and there is always one more boundary than there are gaps.
sections = ⌈L ÷ S⌉ • posts = sections + 1 + 2G • pickets = ⌈12(L − GW) ÷ (w + g)⌉ • post length = H + max(H ÷ 3, F)- L, S
- Run length and maximum post spacing, both in feet. Spacing is a ceiling: the run is then divided evenly between the posts
- G, W
- Gates, and the width of each one’s opening in feet. Every gate takes a hinge post and a latch post of its own, never a shared line post, and its opening comes out of the picket run — W is zero unless entered
- w, g
- Picket width and the gap after it, in inches. Their sum is the pitch — the distance from one picket to the next
- H, F
- Fence height above grade and local frost depth. The deeper of one-third-of-height and the frost line is what goes in the ground
Concrete is the volume of a cylinder — π × (diameter ÷ 24)² × depth, with the diameter in inches and the depth in feet — multiplied by every post, gate posts included. It is gross hole volume: the post displaces a little of it, so the figure errs high, which is the direction you want to err in when a hole is open and the mixer is running.
Bags are that total divided by one named yield — 0.6 cu ft for an 80 lb bag of packaged concrete mix — rounded up once, on the total volume. Rounding each hole’s bag count up first and multiplying by the post count orders more than the job needs; the worked example below shows the difference. The recommended rail count is one rail for every two feet of fence height, floored at two, and any cost you enter is each count times its price, added together — no waste, tax, or labor.
A 100 foot back-yard fence, 6 feet tall
Posts no more than 8 ft apart: 100 ÷ 8 = 12.5, so 13 sections, each one 100 ÷ 13 = 7.69 ft wide. That gives 14 line posts. One gate adds a hinge post and a latch post, so the order is 16 posts — not 13, which is the number you get if you order sections and forget the geometry.
Three rails per section is standard at 6 ft, so 13 × 3 = 39 rails, each about 7.7 ft, cut from 8 ft stock: 300 linear feet. Pickets at 5½ in wide with a ¼ in gap repeat every 5.75 in, and 100 ft is 1,200 in, so 1,200 ÷ 5.75 = 208.7 → 209 pickets.
Now the part that decides whether the fence is still straight in five years. Six feet above ground means 6 ÷ 3 = 2 ft below it, so the posts are 8 ft long — 2 ft in the hole, 6 ft in the air. A 10 in hole 2 ft deep holds π × (10 ÷ 24)² × 2 = 1.09 cu ft of concrete, and 16 of them come to 17.45 cu ft, or 0.65 cubic yards. That is under the usual ready-mix minimum, so this is a bagged-concrete job: at the named 0.6 cu ft yield of an 80 lb bag, one hole takes two bags, but the order is 30 bags, not the 32 you would get by rounding two bags up sixteen separate times and adding them.
Change one input and watch the order change. Enter a 36 in frost line — ordinary across the northern United States and most of Canada — and the burial depth goes to 3 ft, the posts become 9 ft (bought as 10 ft), and the concrete rises to 26.18 cu ft, close to a cubic yard. That is roughly 50% more concrete and a longer post, and it is the difference between a fence and a fence that heaves.
One more advanced option worth trying on this same job: enter the gate’s width. A standard 4 ft walk gate takes 4 ft out of the picket run, so pickets drop from 209 to 201 — the run is still 100 ft and still needs the same 13 sections and 39 rails, only the boards across the opening disappear from the order. Add a price for a post, a rail, a picket, a bag, and the gate itself, and the same answer grows a material cost estimate alongside it.
Bury a third of the height — or beat the frost line
A post should be buried one third of its above-ground height, or below the local frost line, whichever is deeper. A 6 ft fence needs an 8 to 9 ft post with 2 to 3 ft of it in the ground. Those two clauses come from two different problems, and skipping either one produces a different failure.
The one-third clause is about leverage. A solid fence is a sail, and wind pushes on the whole panel while the post pivots about the ground line. Depth is the only lever arm resisting it, and depth proportional to height is what keeps the two in balance as the fence gets taller.
The frost clause is about ice, and it is the one that actually takes fences down. Frost heave will lift a shallow post out of the ground over a few winters, and it is the single most common way a fence fails. Water in the soil freezes, expands, grips the sides of the post and its concrete collar, and jacks the whole assembly upward. Soil fills the space underneath during the thaw, so nothing goes back down. Each winter takes another bite. Eventually the line is visibly wavy, the gate no longer latches, and rails have pulled free — and the only repair is to dig the posts out and set them again, deeper, which costs more than the entire fence would have cost to build correctly.
Frost depth is local and published: your building department has the figure, and it ranges from zero in the south to five feet or more in the far north. Enter it and this calculator takes the deeper of the two rules automatically. One more detail worth the money: any post going in the ground must be lumber rated for ground contact, not the cheaper above-ground grade. The two look identical on the rack and are told apart only by the tag.
Sections + 1, every time
Count the gaps between fingers on one hand: four. Count the fingers: five. A fence is the same shape. Thirteen sections have fourteen boundaries, so a 13-section run takes 14 posts, and forgetting the +1 is the classic off-by-one that leaves you one post short on delivery day. It is a cheap mistake to make and an expensive one to discover, because it surfaces at the last hole, with the concrete mixed, the string line up, and the yard about to close.
Two related traps. First, the +1 belongs to each run, not to the job: an L-shaped yard with three straight runs needs three separate +1s, minus any post the runs genuinely share at a corner. Run each length through this calculator on its own rather than adding the lengths together, or you will be one or two posts short again. Second, gates never hang on line posts. A gate leaf is a lever with a heavy end, and a post carrying one works loose within a season, so every gate gets its own pair — which is why the count here adds two per gate rather than borrowing from the run.
Check the line, check the rules, call 811
A fence is the structure most likely to be built on a property line, and therefore the structure most often built on the wrong side of one. Take the boundary from a survey, not from a hedge, a driveway edge, or an assurance from the last owner. Then read the local rules before you buy anything: many jurisdictions require a fence to sit some distance inside the line, cap front-yard height at 4 ft while allowing 6 ft at the back, treat corner lots differently for sight lines, and impose specific, strictly enforced requirements on anything enclosing a pool. A fence in the wrong place is not a fine — it is a fence you take down and build again.
And before any hole is dug, call the utility locate service. In the United States that is 811, it is free, and the utilities come out and mark their buried lines within a few working days. This is not box-ticking: gas, electric, communications, and water are commonly buried at about the depth of a post hole, an auger goes through all of them, and people are killed doing exactly this every year. It is the only advice on this page that has nothing to do with arithmetic and matters more than all of it.
What this calculator assumes
- One continuous straight run, on level ground. The length is horizontal distance; a fence stepped or racked down a slope needs longer posts than this, and the picket count rises with the slope.
- Post spacing is a maximum, not a target. The run is divided evenly between the posts, so the actual spacing shown is at or below what you asked for and there is no short bay at the end.
- Every gate adds exactly two posts. Its opening is subtracted from the picket count only once you enter a width; left at zero, the run is still costed as if pickets crossed the gate, matching how this calculator always worked before a width could be entered. Gate hardware, bracing, and the diagonal that stops a leaf sagging are not modelled beyond the single price you can enter for the whole gate.
- Pickets are counted straight across the run at picket width plus gap, without deducting the width the posts themselves occupy — which is how face-mounted pickets are actually laid out, and which errs slightly high on a fence with the pickets set between posts.
- Concrete is the gross volume of a cylindrical hole at the burial depth, for every post including gate posts. The post displaces some of it, so the figure is a few percent high. The concrete calculator converts it into bag counts.
- The one-third rule and the frost-line rule are widely used practice, not a code citation. Fence construction, height limits, setbacks, and pool-enclosure requirements are all local, and the frost depth used here is a number only your jurisdiction can give you.
- Every gate is assumed the same width, entered once and applied to each one. Even with a width entered, the section count, the post count, and the rails are still sized off the full run — only the picket count changes.
- Concrete bag counts assume one named yield, 0.6 cu ft for an 80 lb bag of packaged mix. Other bag weights and other brands move this figure by up to a few percent; if your bag says something else, use its printed yield instead and scale the total volume by hand.
- The recommended rail count — one rail per two feet of height — is a widely used trade guideline, not a code minimum, and is shown for comparison only. It never overrides the rail count you enter.
- Nothing here prices anything unless you enter a price, and even then it accounts for materials only — the count of each item times the figure you gave it. Waste, breakage, fasteners, post caps, gate hardware beyond the single price you enter, delivery, tax, and labor are not in it.
Fence calculator FAQ
How many posts do I need for a 100 foot fence?
Fourteen line posts, plus two more for every gate. A 100 ft run with posts no more than 8 ft apart takes 13 sections — 100 ÷ 8 is 12.5, and you cannot have half a bay — and a run of 13 sections is bounded by 14 posts. The +1 is the far end of the fence. It is the single most common ordering mistake in fencing, because the section count is the number people compute and the post count is the number they need, and the difference is invisible until the last hole is dug and there is nothing left to put in it. One gate adds a hinge post and a latch post, so the default job here comes to 16.
How deep should fence posts be set?
One third of the height above ground, or below your local frost line, whichever is deeper. A 6 ft fence therefore wants 2 ft in the ground, which means buying 8 ft posts. If your frost line is 36 inches, the frost line wins: 3 ft in the ground, a 9 ft post, and since posts are milled in even lengths you buy a 10 ft one and cut it. The one-third rule is about leverage — a fence is a sail, and wind load tries to rotate the post about the ground line. The frost rule is about water in the soil freezing, expanding, and lifting anything whose base sits inside the freezing zone.
Why do fence posts heave out of the ground?
Because the water in the soil around them freezes and expands. When the frozen layer grips the sides of a post or its concrete collar, that expansion lifts the whole assembly a little — and when the ground thaws, soil slumps into the void underneath so the post never settles all the way back. Repeat over three or four winters and the line goes visibly wavy, gates stop latching, and rails pull free of the posts. The fix is entirely preventative: put the bottom of the post below the depth at which the ground freezes, so the frozen layer has nothing to grab that is not already anchored in unfrozen soil. There is no repair short of digging it out and doing it again.
How far apart should fence posts be?
Eight feet is the usual maximum, and the reason is mundane: rails are sold in 8 ft lengths, so an 8 ft bay uses one rail with no cut and no waste. Drop to 6 ft where the fence is tall and solid, on an exposed site, or where the soil is soft — a 6 ft privacy fence catches a great deal of wind, and the load on each post rises as the span does. Whatever maximum you choose, divide the run evenly rather than leaving a short bay at the end: 13 bays of 7.69 ft looks deliberate; 12 bays of 8 ft and a 4 ft stub looks like arithmetic that ran out.
How much concrete does one fence post take?
For the common case — a 10 inch hole 2 feet deep — about 1.09 cubic feet, which is two 80 lb bags of premix or three 60 lb bags. The hole is a cylinder, so the volume is π × (diameter ÷ 24)² × depth with the diameter in inches and the depth in feet. A wider hole costs more than a deeper one: going from 10 to 12 inches across adds 44% to the volume, while going from 2 to 3 feet deep adds 50% and actually buys you frost protection. The figure here is gross hole volume; the post itself displaces a little of it, so it errs slightly high.
How many pickets do I need for 100 feet of fence?
209, for a standard 5½ inch picket with a ¼ inch gap. Count by pitch, not by width: each picket occupies its own face plus the gap that follows it, so the repeat is 5.75 inches and 1,200 inches of fence divided by 5.75 is 208.7, rounded up. Butt them tight with no gap and the same run takes 219. Leave the ¼ inch and you get somewhere for wet timber to swell, which is the argument for the gap on a board that arrives from the yard soaking and shrinks for a year afterwards.
Do I need to check the property line before building a fence?
Yes, and it is worth more than the calculator. Fences are built on property lines more often than any other structure, which makes them the thing most often built on the wrong side of one. Get the line from a survey rather than from a hedge, a driveway edge, or the previous owner's opinion, and check your local setback rules — many jurisdictions require a fence to sit some distance inside the line, cap front-yard height at 4 ft, and have separate rules for corner lots and pool enclosures. Separately, and non-negotiably: call your utility locate service before you dig. In the United States that is 811, it is free, and it takes a few working days. A post hole is about the depth at which gas, electric, and fibre are buried.
Should fence posts be 6 feet or 8 feet apart?
Eight feet is standard for most wood fences, because rail stock is sold in 8 ft lengths and a bay that size uses one rail with no cut. Drop to 6 ft for a solid privacy panel, a high-wind or exposed site, or soft or sandy soil — a 6 ft bay carries 25% less wind load than an 8 ft one at the same height, which is the actual reason the tighter spacing is sturdier, not a rule about the wood itself. Either figure is a maximum: enter it above, or use the quick 6 ft / 8 ft toggle, and the calculator still divides your run evenly rather than leaving a short bay at the end.
How many rails does a fence need?
One for every two feet of height, with two as the practical minimum even on a short run: two rails up to about 4 ft, three at 5 to 6 ft, four at 7 to 8 ft, and so on up to six rails at 12 ft. A 6 ft privacy fence is the common case that gives the standard advice of three rails — the middle one is what stops a tall picket from cupping and twisting between the top and bottom rails. The calculator shows this figure beside whatever you enter and flags it when the two disagree; going lighter than the guide is sometimes still fine on a short or sheltered run, but it is worth knowing when you are doing it on purpose.
Does a gate change how many pickets I need?
Yes — a gate is an opening, not a panel, so its width comes out of the picket count once you enter it. A 100 ft run with one 4 ft gate needs pickets for only 96 ft of actual fence, which is 201 pickets at a standard 5.75 in pitch instead of 209. The gate does not change the section count, the post count, or the rails: those are still sized off the full 100 ft run, because the posts either side of the gate and the line posts through the rest of the run do not care what fills the gap between them. Leave the gate width at zero if you have not measured it yet — the calculator still counts the gate's two posts, it just leaves the whole run in pickets until you do.
How many bags of concrete does one fence post take?
Two 80 lb bags for the common case in this calculator's own example — a 10 in hole, 2 ft deep. That comes from one named figure, the 0.6 cubic foot nominal yield an 80 lb bag of packaged concrete mix is sold against, divided into the hole's volume and rounded up. For the whole job, order against the total volume divided by that same yield, rounded up once — not the per-hole bag count multiplied by the post count, which orders more than the job needs. Sixteen holes at two bags apiece is thirty-two bags by that shortcut, but the true total for the same job is thirty.
Sources and review notes
- Call 811 — the national one-call service operated through the Common Ground Alliance, which notifies utility operators to mark buried lines before you dig, free of charge
- ICC Digital Codes — the International Residential Code, whose Table R301.2 is where each jurisdiction records its frost line depth for footing design
- American Wood Protection Association — the use-category standards behind the tag on treated lumber, and the reason a post going in the ground must be a ground-contact grade rather than an above-ground one
- Inch Calculator’s fence calculator guide — the trade guidance behind 8 ft post spacing for wood fences and one rail for every 24 inches of height, both used above
- QUIKRETE Concrete Mix technical data sheet — the manufacturer figure behind the 0.6 cubic foot nominal yield of an 80 lb bag used to size the bag counts above
The geometry here is exact and cannot go stale. Three inputs cannot come from any calculator and must come from you: your local frost depth, your property line, and your local rules on fence height and setbacks. The one-third burial rule is long-standing trade practice rather than a code requirement — where a published frost depth is deeper, that figure governs. The rail-count recommendation and the concrete bag yield are both trade and manufacturer figures rather than code minimums, and either can shift a little by brand or by jurisdiction.