Tools · Home & Construction

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.

Post length from the frost line, not a guessHow it worksInputs stay on this device
Your inputs

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.

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.

Your inputs are calculated locally and are not stored.
Posts to order16 posts

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)
Pickets
209
Concrete for the holes
17.45 cu ft (0.65 cu yd)
Material list for a 100 ft run at 6 ft tall
ItemQuantityDetail
Posts168 ft long, 2.00 ft buried
Rails397.69 ft each, 300.00 ft in total
Pickets2095.5 in wide, 0.25 in gap
Concrete17.45 cu ft1.09 cu ft per hole, 0.65 cu yd in total
  • 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.
Formula & methodology

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 = ⌈12L ÷ (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
Gates. Each one takes a hinge post and a latch post of its own, never a shared line post
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.

Worked example

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: about two 80 lb bags per hole.

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.

The rule that matters

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.

The off-by-one

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.

Before the first hole

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.

Assumptions

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 and is assumed to be filled with the same pickets as the run. Gate hardware, bracing, and the diagonal that stops a leaf sagging are not modelled.
  • 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.
  • Nothing here prices anything, or accounts for waste, breakage, fasteners, post caps, or the two extra pickets you will want when one splits.
Common questions

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.

Primary sources

Sources and review notes

  1. 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
  2. ICC Digital Codes — the International Residential Code, whose Table R301.2 is where each jurisdiction records its frost line depth for footing design
  3. 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

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.