Fence Calculator
A wood fence is really four errands in a trench coat: pickets, posts, rails, and concrete. Homeowners always count one of them right and whiff the other three — usually the posts, because everyone pictures the pretty pickets and forgets the skeleton holding them up. Get the picket count wrong and you're making a second trip while the crew (or your Saturday) sits idle. Get the post count wrong and the whole line goes up crooked. This fence calculator splits any straight run into standard 8-foot sections and prices out each material separately: pickets from your chosen board width and gap, posts at every section break plus the ends, rails per section, and two 80-pound bags of concrete per post. It adds extra posts for your gates, because gates are where fences fail first. If you only need the post count — say, for a quick quote — the fence post calculator further down the page does just that. Staining the finished fence? The fence stain calculator turns the same length and height — one side or both — into gallons of stain.
Fence post calculator
Just need the post count? Enter your fence length and post spacing — this fence post calculator tells you how many posts to buy, including extras for gates.
Formula
Worked example
A 100 ft fence with posts every 8 ft: 100 ÷ 8 = 12.5, rounded up to 13 intervals, plus the end post = 14 posts (add one more per gate).
Planning this project? Save to Pinterest to find this calculator again later.
How to use the Fence Calculator
- Walk the full fence line with a 100-foot tape and measure corner to corner, including anywhere a gate will go. Don't subtract the gate openings from the length — the calculator handles gates separately, and it needs the true run to space the sections.
- Enter the section length. Eight feet on center is the wood-fence standard because rails and pre-made panels come in 8-foot lengths. Shorter sections cost more posts; longer ones let the rails sag.
- Enter the actual picket width. A '1x6' cedar picket measures 5.5 inches wide, and dog-ear pickets are no exception. Enter 6 and you'll underbuy by roughly 9 percent — that's 20 missing pickets on a 100-foot run.
- Set the gap between pickets. Zero for a privacy fence. Two to four inches for a spaced or picket style. Measure the gap you want with a scrap block and live with it for a minute — gaps look wider once they're on the fence.
- Choose rails per section: two for fences up to 5 feet tall, three for 6-foot fences. The third rail keeps tall pickets from bowing, and bowing is what makes a five-year-old fence look fifteen.
- Count your gates and enter the number. Each gate adds one extra post for the hinge side, and gate posts should be bigger and deeper than line posts — the calculator adds the count; you supply the beefier lumber.
- Press Calculate. Sanity-check the post count against your mental picture of the run, then add 10 percent to the picket order. Pickets warp, split, and arrive with bark edges; the cull pile is real.
Fence Calculator formula
Worked example
Take a 150-foot backyard run: 8-foot sections, 5.5-inch cedar pickets with a 1.5-inch gap (a spaced style that still reads private from the street), three rails per section because it's a 6-foot fence, and two gates — one for the driveway side, one for the back. Sections: 150 / 8 = 18.75, rounds up to 19 sections. That last three-quarter section gets built like a full one, post and all — you don't get to skip it. Posts: 19 sections + 1 end post + 2 gate posts = 22 posts. Make the four gate posts 6x6s set 3 feet deep; the other eighteen can be 4x4s at 2 feet. Pickets: 150 feet is 1,800 inches. Each picket plus its gap takes 5.5 + 1.5 = 7 inches. 1,800 / 7 = 257.14, rounds up to 258 pickets. Order about 285 to cover culls — dog-ear cedar is a natural product and the pile always includes a few bananas. Rails: 19 sections x 3 rails = 57 rails, typically 2x4s in 8-foot lengths. Concrete: two 80-lb bags per post = 44 bags of 80-pound mix, plus a few extra for the deeper gate-post holes. Now that you have quantities, compare materials and installed cost per foot in our fence materials guide.
Measurement tips
- Call 811 before you dig — it's free, it's the law in most states, and the utility locate takes a couple of business days. A post-hole digger through a gas line turns a fence project into an emergency, and the fine lands on you.
- Set line posts 2 feet deep as a minimum — size each hole with the post hole calculator — and go below your local frost line if you get real winters — 3 to 4 feet in the northern states. Frost heave pushes shallow posts up a little every year until your fence looks like a piano keyboard.
- Drop 6 inches of gravel in the bottom of each hole before the post goes in. It drains water away from the end grain, which is where rot starts. Posts set straight into concrete with no drainage rot faster than posts in plain dirt.
- Keep pickets 2 inches off the ground. Pickets that touch soil wick moisture and rot from the bottom up; that two-inch shadow line at the base is the sign of a fence built by someone who's replaced one before.
- Run a mason's string line between your end posts and set every line post to it. Eyeballing post alignment over 150 feet produces a fence with a visible wave that you'll notice every single day.
- Build gates with a diagonal brace running from the bottom hinge corner to the top latch corner, and hang them on 6x6 posts. Gates sag — it's what they do — and the brace plus the beefier post buys you years before it happens.
- Face the finished side of the fence toward the neighbor (or the street) if your HOA or city requires it — many do. Nothing sours a fence project like a neighbor complaint filed the week after you finish.
Common mistakes
- Setting gate posts like line posts. A gate is a swinging, wind-catching lever bolted to one post. Skimp with a shallow 4x4 and no extra concrete, and within a year the gate drags on the ground. Gate posts want 6x6 lumber, 3 feet deep, and generous concrete — work out the bags with the concrete calculator.
- Digging post holes by eye instead of measuring equal sections. The eye is terrible at 8-foot intervals over distance; you end up with sections ranging from 7 to 9 feet, rails that don't land on posts, and a fence that looks drunk.
- Forgetting that the gate opening still needs its posts. People measure the run, subtract the gate width from the length, and then wonder why they're two posts short. Measure the full run; enter the gates; let the math add the posts.
- Butting pickets tight edge-to-edge in a wet climate with zero gap. Wood swells when it rains. Tight pickets buckle, pop nails, and bow outward in waves. Even a privacy fence benefits from a hairline gap or properly dried lumber.
- Mounding concrete above grade around the post like a little volcano. That dome holds water against the wood exactly where rot starts. Slope the concrete away from the post so water runs off, and keep it a couple inches below grade.
- Skipping the 811 call because 'I know where my lines are.' Nobody knows where their lines are. The locate is free, the repair bill for a severed cable or gas line is thousands, and in many states digging without a ticket is a citable offense.
Factors that affect accuracy
- Fence height. A 4-foot fence takes two rails per section; a 6-footer needs three to keep pickets from bowing. Taller fences also catch more wind, which means deeper posts and more concrete per hole.
- Terrain. Flat ground gives you clean 8-foot sections. Slopes force stepped sections — each step down needs its post set to full depth while the rails step — and rolling ground can add posts where a straight run would have had one.
- Soil type. Sandy or loose soil won't grip a post, so holes go wider and deeper with more concrete. Rocky soil fights the digger and slows you to one hole an hour. Clay holds posts well but traps water, so drainage gravel matters more.
- Fence style. A privacy fence with no gap eats roughly 30 percent more pickets than a spaced style on the same run. Board-on-board looks great from both sides but nearly doubles the picket count — budget accordingly; the fence cost per linear foot guide prices each style installed.
- Gate count and width. Every gate needs its own posts, hinges, and latch hardware, none of which is in the picket math. Wide double gates for trailers need 6x6 posts and sometimes a center drop rod — plan the hardware before you set the posts.
- Post material. Pressure-treated 4x4s are the default; 6x6s for corners and gates resist twist far better. Cedar posts look nice but rot faster in the ground than treated pine — many builders use treated posts with cedar pickets and never look back.
Sources & assumptions
- Pickets = fence length ÷ (picket width + gap), rounded up; posts = sections + 1 + gates; rails = sections × rails per section.
- Concrete: two 80-lb bags per post is the planning rule for a standard 10-inch-wide, 2-foot-deep hole.
- Section length is your input — rails are sold in 8-foot lengths, so keep sections at or under 8 feet.
- Call 811 before you dig. Post concrete: Quikrete fast-setting concrete mix.
Figures checked on 28 November 2026 as part of the site-wide test run (3239 automated checks, all passing). See how we calculate and test.
Safety note
What this calculator doesn't do
- Sloped ground needs stepped or racked panels, which use more material than flat-run math.
- Gate hardware, hinges and latches are separate purchases.
- It can't check your property line, HOA rules or local height limits — confirm before you dig.
Fence Calculator — frequently asked questions
How many pickets do I need for 150 feet of fence?
With 5.5-inch pickets and a 1.5-inch gap: 1,800 inches / 7 inches per picket = 258 pickets, plus about 10 percent extra for warped and split boards — order around 285. The worked example above shows every step.
How many bags of concrete do I need per fence post?
Plan on two 80-lb bags per post for a standard hole — about 10 inches wide and 2 feet deep around a 4x4. The hole holds about 1.09 cubic feet and one 80-lb bag yields 0.6, so two bags cover it with margin. One 50-lb bag yields only about 0.375 cubic feet, so it is not enough on its own. Corner posts, gate posts, deeper holes, and oversized holes in loose soil want more. When in doubt, buy the extra bags; unopened concrete returns easily and a wobbly post does not.
How deep should fence posts go?
Two feet minimum for line posts on a 6-foot fence. The real rule is one-third of the post underground, and below the frost line wherever the ground freezes — that's 3 to 4 feet deep in northern states. Gate posts go deeper than line posts, always.
Do my sections have to be exactly 8 feet?
Close enough is fine — within a few inches. It's better to nudge every section slightly short or long so the run divides evenly than to end up with one awkward 3-foot section at the end. Rails come in 8-foot lengths, so keep sections at or under 8 feet.
What gap should I leave between pickets?
Zero for a true privacy fence, 2 to 4 inches for a classic spaced picket look. Remember the gap counts in the math — wider gaps mean fewer pickets but also less privacy and less wind resistance, which matters on tall fences.
Do I need a permit to build a fence?
Usually not for a standard backyard fence, but many cities cap front-yard fences at 3 to 4 feet and require the finished side facing out. HOAs are stricter than cities. A five-minute call to your building department beats tearing down a finished fence.
Which side of the fence should face my neighbor?
The finished (picket) side traditionally faces out — toward the neighbor or street — with posts and rails on your side. Many cities and HOAs require it. If you want the pretty side facing you, build board-on-board so both sides look finished.
How much does a fence cost per linear foot installed?
For a 6-foot privacy fence in 2026: pressure-treated pine $28–50 per linear foot, cedar $45–70, vinyl $65–95. Chain-link runs $18–35 per foot for 4-foot galvanized. Those are installed prices including labor — materials alone run roughly half that. Gates add $300–800 each, and a slope adds 10–20% in labor. Prices vary widely by region, so get at least three local quotes and compare them against the full cost-per-foot table in our fence materials guide.
How many fence posts do I need?
Divide your fence length by your post spacing, round up, then add one post for the end and one extra post per gate. For example, 100 feet at 8-foot spacing needs 13 intervals + 1 end post = 14 posts, plus one per gate. Use the fence post calculator below for your exact numbers.
How many rails do I need for my fence?
Multiply your fence sections by the rails per section. For example, 100 feet of fence at 8-foot sections is 13 sections; with 2 rails per section that is 26 rails. The fence calculator above shows your rail count with the rest of the materials.
How many pickets do I need for 100 feet of fence?
With 5.5-inch pickets and a 1.5-inch gap, each picket covers 7 inches of run: 1,200 inches ÷ 7 = 171.4, so 172 pickets, plus about 10 percent extra for warped and split boards — order around 190. The calculator above runs the same math for your exact length and gap.
Next step
Walk the fence line with a tape and confirm the length and gate positions, then price posts, pickets, and concrete — and call 811 before you dig. The fence materials guide compares installed cost per foot.
Save this estimate: use the Copy link button in the results box above to share these exact inputs, or Print results for a paper copy to take to the store.