What is a fence calculator?

A fence calculator is a fence material calculator: you enter the total fence length, the post spacing, the picket width and gap, and the gates, and it works out how many sections, posts, rails, pickets and bags of concrete the fence needs. It answers the questions every fence project starts with, usually asked one at a time in a store aisle: how many fence posts do I need, how many pickets, how much concrete? Each answer depends on the others, which is why estimating them separately goes wrong. Post spacing decides the section count, the section count decides the posts and rails, and the picket count depends on a different length altogether, the run left after gate openings are taken out.

This page makes each of those dependencies visible instead of hiding them inside a single total. Sections are counted from the full fence length. Posts are counted from the sections, with a stated extra for gates. Pickets are counted from the picket run, which is the full length minus the gate widths. Concrete is counted from the final post total, not the first guess. Every convention is printed beside the result, so a supplier quote, a neighbour estimate or a second calculator can be checked line by line against exactly the same assumptions, and any difference can be traced to a specific choice rather than a mystery.

One worked example runs through the whole guide, and the calculator above opens with it pre-filled: a 100 ft fence, posts at 8 ft spacing, a 6 ft height, 2 rails per section, pickets 5.5 in wide with a 0.5 in gap, one 4 ft gate, and 2 bags of concrete per post. Its answers are 13 sections, 16 posts, 26 rails, 192 pickets and 32 bags of concrete. If those figures check out by hand, and the worked example section below shows every step, the method is sound for any fence length you enter after it. Like the neighbouring Deck Calculator, this is an outdoor-build materials estimate: exact arithmetic on stated assumptions, and nothing more claimed than that.

How this fence calculator works

Quick answer: Sections = ceil(length / spacing). Posts = sections + 1 + 2 per gate. Rails = sections x rails per section, bought at spacing length. Picket run = length - total gate widths. Pickets = ceil(run in inches / (picket width + gap)). Concrete bags = posts x bags per post.

The inputs fall into three groups, and keeping the groups apart is what makes the estimate auditable. The fence itself comes first: total length, in feet or metres, and height. Length drives almost everything; height, honestly, drives almost nothing except the picket length you buy, and this page says so rather than pretending a taller fence magically needs more pickets across the same run. What a taller fence usually does need is a third rail and deeper posts, and those enter through the second and third groups, where you can see them.

The structure comes second: post spacing, rails per section and concrete bags per post. Spacing is offered as the two standard presets, 6 ft and 8 ft, with a custom field that overrides them for panel widths or an existing post layout you are matching. The third group is the face of the fence: actual picket width, the gap, and the gates. Gates are handled in two directions at once, because a real gate both removes fencing and adds structure: its width leaves the picket run, and it adds two dedicated posts to the post count. A calculator that only deducts the gate flatters the order; a calculator that only adds posts overstates the pickets. Doing both, openly, is the whole point.

All of the rounding in this calculator is epsilon-safe ceiling rounding: a count that lands exactly on a whole number, like the 192 pickets in the worked example, is not pushed up to the next number by a floating-point error, and a count that lands a fraction above a whole number always rounds up, because a fraction of a post, rail or picket is still a whole one you have to buy. That detail sounds fussy until an exact division, 1,152 divided by 6, comes back as 192.0000001 in a browser and a careless calculator orders you a 193rd picket.

The worked example: a 100 ft fence, step by step

Start with sections. The fence is 100 ft long and the posts are spaced 8 ft apart, so sections = 100 / 8 = 12.5, rounded up to 13 sections. Twelve sections are a full 8 ft each, covering 96 ft, and the thirteenth is a short 4 ft section. That short last section is normal, not a mistake: very few garden lengths divide exactly by the spacing, and the standard practice is to spread or place the short section where it shows least, often at the far end or beside a gate.

Posts come next, in two parts. A straight run always has one more post than it has sections, because both ends need a post: 13 + 1 = 14 base posts, made up of the line posts between sections plus the two end posts. The one gate then adds its two dedicated gate posts: 14 + 2 = 16 posts. Rails follow the sections: 13 sections x 2 rails per section = 26 rails, each bought at the 8 ft spacing length, so 208 linear ft of rail stock. The two rails in the short section are cut down from 8 ft stock, and the rails across the gate opening become the frame of the gate leaf itself, which is why the gate does not reduce this count.

StepWorkingResult
Sections100 ft / 8 ft = 12.5, rounded up13 sections
Base posts13 sections + 114 posts
Posts with one gate14 + 2 gate posts16 posts
Rails13 sections x 2 rails26 rails
Rail stock26 rails x 8 ft208 linear ft
Picket run100 ft - 4 ft gate96 ft
Pickets1,152 in / (5.5 + 0.5) in192 pickets
Concrete bags16 posts x 2 bags32 bags

Pickets and concrete finish the example. The gate leaves the picket run at 100 - 4 = 96 ft, which is 1,152 in. Each picket covers 5.5 in of width plus a 0.5 in gap, 6 in in total, so pickets = 1,152 / 6 = 192 pickets, an exact division with no rounding needed. Concrete is the simplest line of all once the post count is honest: 16 posts x 2 bags per post = 32 bags. Five multiplications and two round-ups produce every headline figure on this page, and each one can be checked with a pencil against the table above.

Posts: spacing, line posts, corners and gate posts

Quick answer: Posts = sections + 1 for one straight run, plus 2 dedicated posts per gate. At 8 ft spacing a 100 ft fence needs 13 sections and 14 base posts; at 6 ft spacing it needs 17 sections and 18 base posts. Corner posts are shared between the runs that meet at them.

The plus one in the post formula is the same shape as the plus one in a joist or stud count, and forgetting it is the classic fence undercount. Spacing divides a run into sections, and there is always one more post than there are sections, because the run needs a post at its starting end as well as at the end of every section. On a short fence that single post is a large percentage of the order; on the worked example it is the difference between a fence that finishes and a fence that stops one post short on the last afternoon.

Post spacingSections, 100 ftBase postsPosts with one gateRails at 2 per section
6 ft17182034
8 ft13141626

Choosing between the two spacings is a strength and budget decision, not an estimating one. Eight feet is the common residential spacing for wood fences and keeps the post, rail and concrete counts down. Six feet makes a noticeably stiffer fence and is the safer choice for tall privacy fences, heavy pickets, exposed windy sites and stepped fences on slopes, where each section is shorter in effect. This calculator counts posts at whichever spacing you choose; it does not certify that the spacing is strong enough for your fence, because that depends on height, wind, soil and local rules.

Corners follow the shared-post convention stated beside the result. This page counts one straight run at a time. A corner post belongs to both runs that meet at it, so for an L-shaped or U-shaped fence, estimate each straight side separately, add the results, then subtract one post for each shared corner. Sections, rails, pickets and concrete bags can be added across runs without adjustment; only the post total double-counts, once per corner, and the subtraction fixes exactly that.

Rails: two or three per section, and rail lengths

Rails are the horizontal members that carry the pickets, and their count is the simplest on the page: sections multiplied by rails per section. The choice that matters is the multiplier. Two rails, one near the top and one near the bottom, suit fences up to roughly 5 ft and lighter pickets. Three rails add a middle member that stops long pickets bowing, and they are the common choice for a 6 ft privacy fence. Switching the worked example from 2 to 3 rails moves the rail count from 26 to 39 and the rail stock from 208 to 312 linear ft, while posts and pickets do not change at all, which is why the rail decision is worth making before you price the job rather than in the lumber aisle.

Rail length is quoted here as stock length, deliberately. Each rail is bought at the post spacing length, 8 ft in the example, because that is the length on the shelf and the length you pay for. Installed length is shorter wherever a section is shorter than the spacing, above all in the final section, and the offcut from that last section is genuine waste unless it fits a gate frame or a short return. Some builders run rails continuously across two sections where stock lengths allow, staggering the joints so no two rails end on the same post; that practice changes how you cut, not how much stock the fence consumes, so the stock total here still stands as the ordering figure.

The gate convention belongs in this section too, because it is a rail decision. This calculator does not deduct rails for a gate opening. A wooden gate leaf is a frame of horizontal rails with pickets or boards fixed to it, so the material that would have been the rails of that part of the fence becomes the gate frame instead. If your gate is a ready-made metal or vinyl leaf that uses no rail stock, subtract the rails per section once for each gate from the rail total, and the rest of the estimate is unchanged.

Pickets: actual width, gap and coverage

The picket count turns on one idea: coverage. A picket does not cover its own width alone; it covers its width plus the gap that follows it, and the run fills up one coverage unit at a time. That is why the formula divides the run in inches by width plus gap, and why the two inputs must be honest. The width must be the actual width, 5.5 in for a picket sold as a 1x6 and 3.5 in for one sold as a 1x4, because the missing half inch was planed away before the picket reached the shelf. Entering the nominal width makes every picket look wider than it is and understates the count across the whole fence, not just by one board.

Actual picket width (in)Gap (in)Coverage per picket (in)Pickets per 10 ft of run
3.503.535
3.50.54.030
5.505.522
5.50.255.7521
5.50.56.020

The gap is a style decision with rules attached in some places. Zero gap gives a butted privacy fence, remembering that boards shrink as they dry and small gaps often appear on their own. A quarter or half inch gives the classic spaced picket look and lets wind pass, which tall fences in exposed places benefit from. Pool enclosures, pet runs and some municipal fences limit the maximum gap so that a small child or animal cannot pass, and those limits override style. Set the gap you are actually allowed and actually building, because on a long fence a half inch of gap is worth dozens of pickets: over the 96 ft run of the example, moving from a 0.5 in gap to no gap raises the count from 192 to 210.

That last figure is worth checking by hand, because it shows the formula working at a non-exact division: 1,152 / 5.5 = 209.45, rounded up to 210 pickets. The round-up is not padding. The 210th picket is ripped narrower or the last gap is shared out across the run, which is what experienced installers do, adjusting a few gaps by a fraction so the fence ends cleanly instead of with one wide slot. For related outdoor quantities, the Board Foot Calculator prices lumber by volume, and the Gravel Calculator sizes the gravel bed many installers pour under each post.

Gates: widths, posts and hardware not counted

A gate is the only moving part of a fence and the part most likely to sag, stick or be left open, so this calculator treats it more carefully than a simple gap in the run. Its width is deducted from the picket run, because no fence pickets cross the opening. Two dedicated gate posts are added, one for the hinges and one for the latch, because gate posts carry a swinging, leveraged load that a line post never sees, and in a real build they are often larger, set deeper, or both. Counting them separately also keeps the shopping list honest: if your design genuinely hangs the gate between two section posts that are already counted, subtract the two per gate and note that those posts are doing double duty.

People also ask: how wide should a fence gate be?
Wide enough for what must pass through it. A 3 to 4 ft gate suits people on foot, 4 ft is the common default used in the worked example, and mower and equipment access usually wants 5 ft or more, often as a double gate. Wider single leaves sag more and need stronger posts and bracing. Whatever width you choose, enter that same width here so the picket deduction and the opening in the real fence agree.

Just as important is what this page does not count for a gate. Hinges, latches, drop rods, diagonal bracing, gate wheels and any concrete or hardware upgrade around the gate posts are gate hardware, not fence materials in the sense of this estimate, and no line here pretends to include them. A ready-made gate kit, where one is used, replaces the rail-stock gate frame described in the rails section. Price the gate as its own small project on top of this list, and the total will be closer to the real build than any single blended number.

Concrete: bags per post, holes and frost

Concrete is where this estimate meets the ground, and the page keeps its claim modest in exactly the way the Concrete Calculator does for slabs and footings: if you know the post count and how many bags each hole takes, it multiplies them accurately. Sixteen posts at 2 bags per post is 32 bags. That multiplication matters at the store, because bags are heavy, a car boot has limits, and a post-setting day is the worst moment to discover you are four bags short with half the holes open.

Bags per post itself is an input, not an answer this page invents, because it depends on things only your build knows: the hole diameter, the hole depth, the post size and the yield of the bag in your hand. A narrow, shallow hole for a line post and a wide, deep hole for a gate post can differ by a factor of two or three in concrete volume, and bag sizes differ too. The honest workflow is to size one typical hole, read the bags it needs from the bag maker guidance or a concrete calculator, enter that figure here, and, if your gate posts use bigger holes, add the extra bags for those few posts by hand on top of the total.

Depth follows frost and soil, not a universal number. The common rule is to bury roughly a third of the post, with the bottom of the hole below the local frost line where frost applies, on a base that drains. In cold parts of Canada and the northern United States that can mean deep holes and long posts; in frost-free ground it can mean much less. Your local code and soil decide, and no bag count on this page should be read as setting a hole depth. What the count does guarantee is that once the depth is decided, every post in the fence, gate posts included, is in the concrete order.

Height, sloping ground and stepped fences

Height enters this calculator in exactly one place: the picket length to buy. A 6 ft fence takes 6 ft pickets, a 4 ft fence takes 4 ft pickets, and the counts across the run do not move. Height does influence two choices around the calculator rather than inside it. Taller fences usually step up from 2 rails to 3, as the rails section explains, and taller posts need more of their length in the ground, so the post length to order is the fence height plus the burial depth, never the fence height alone. A 6 ft fence on 8 ft posts leaves only 2 ft buried, which many soils and codes would call too little; the post order is where that check belongs.

Sloping ground changes real builds in ways a length-based estimate can only flag, and this page flags it rather than faking it. There are two standard responses. A stepped fence keeps every section level and steps the top line down or up at the posts, like stairs; it uses standard pickets, but it usually wants shorter sections on the slope, sometimes an extra post, and longer posts and pickets where the ground falls away under a level section. A racked fence lets the rails follow the slope, which keeps the top line smooth but needs pickets cut at an angle or ordered longer and trimmed, and it only works within a modest slope before the picket tops and bottoms open up unevenly.

Practically: measure the length along the ground itself, not the horizontal distance on a map, because the fence follows the ground. Expect a sloped build to use a little more material than the level estimate for the same length, and more again where a stepped layout adds a post. If your ground slopes, run this calculator with the true ground length for a starting list, then walk the line and adjust the post and picket counts for the steps you can actually see. Local codes also commonly limit fence height, and sometimes limit it differently at the front of a property, on a corner lot, or measured from the lower side of a slope, which is one more reason the height decision belongs to your local rules first.

Waste, spares and ordering with confidence

Unlike a deck surface, where waste is a percentage of the whole order, fence waste is concentrated in a few predictable places, so this calculator reports exact net counts and leaves the spares decision visible to you. The rounding already built into the counts is real allowance, not waste: the section round-up buys a whole short section of rails, and the picket round-up buys the last partial picket. Beyond that, the honest extras are a handful of spare pickets for the warped, split or badly knotted boards that appear in almost every bundle, one spare post if the fence is long, and the rail offcuts from the short final section, which are usually consumed by the gate frame and bracing.

A practical ordering rule that matches how fences actually go: order the counts on this page, add about 5 percent extra pickets, rounded up, when the fence is long or the pickets are a rustic grade, and keep the receipt. Unopened bundles and undamaged boards are returnable at most suppliers, while a second delivery for six pickets costs more than the pickets. Posts and rails, by contrast, are counted in small numbers with the round-ups already working in your favour, so most builders order them exactly as counted and only add a spare post on long runs.

Checking a quote against this page is the other half of ordering with confidence. Ask any installer or supplier which spacing, which picket coverage and which gate convention their number uses. A quote with fewer posts than sections plus one has missed an end post or is spacing wider than stated. A picket count well below the run divided by width plus gap has either used the nominal width or forgotten that the run is measured after, not before, the gates in only one of the two directions. The numbers do not have to match this page, but the conventions do have to be stated, and a supplier who cannot state them has not estimated your fence yet.

What this calculator cannot do: codes, lines and permits

This is a materials estimate for planning only. It is not a quote, not a design and not an approval, and the distinction is not legal decoration. The calculator does not check whether a post of a given size at a given spacing is strong enough for your fence height and wind exposure, does not set hole depth or diameter, does not design gate bracing, and does not know your soil, your frost line or your property line. A fence that is short of pickets is an inconvenience that a return trip fixes. A fence built on a guessed structure, or a foot inside a neighbour yard, is a dispute, and no material count on this page should be read as settling either question.

Three checks belong to every real fence, in this order. First, the line: build on your own land, confirm the boundary from a survey or your municipal records where there is any doubt, and talk to the neighbour the fence will face, because shared-cost and good-side conventions vary by place. Second, the ground: have underground utilities located before any digging, through your local utility locate service, because post holes are exactly the depth where services run. Third, the rules: many municipalities limit fence height, set front-yard and corner-lot rules, require permits for some fences and almost all pool fences, and homeowner associations can add their own. Sloping ground and local codes change real builds, as the result note says, and both are checked locally, not on a calculator page.

Used in the right order, though, the estimate earns its place: settle the line, the height and the structure locally, then use this page to turn that settled fence into an accurate, checkable materials order, and use the Deck Calculator and the other outdoor calculators on this site the same way for the projects that usually follow a fence. Exact arithmetic on stated assumptions is a genuinely useful thing. It is just not the only thing a fence needs.

Sources and References

Every source above returned HTTP 200 to this page automated link check on the day the page was built. Every figure in this guide was calculated with this page own formula and rounding, so you can reproduce each one exactly by entering the same numbers above. Post spacing strength, hole depth, fence height limits and permit requirements must still be confirmed against your local building code and, where they apply, your fence manufacturer instructions.