Fence Calculator

Enter your fence line, corners and gates to count posts, rails, pickets or panels, concrete bags for every post hole and fasteners, then price the whole fence.

Measure along the fence line, gates included.

Layout

A straight fence has 0 corners and 2 ends. A U-shaped fence off the back of a house has 2 corners and 2 ends. A fence that closes on itself has no ends.

8 ft is common for wood fences because rails come in 8 ft lengths. Some builders use 6 ft for a stiffer fence.

A "6 inch" dog-ear picket is really about 5.5 in wide. Measure yours. Use a 0 gap for privacy.

Common practice is 2 rails under 6 ft and 3 rails at 6 ft and up. The middle rail keeps tall pickets from bowing and twisting as they dry. Picking a height fills this in.

Gate openings come off the fenced length, and every gate gets a post on each side.

A common rule of thumb is about a third of the height above ground (24 in for a 6 ft fence). Go below your frost line where the ground freezes, and check your local code.

Extra for split, warped and badly cupped boards and cuts. 10% is a common starting point.

Fasteners: two screws or nails per picket at each rail is the usual way. Box counts vary a lot by brand and size (about 150 is typical for a 1 lb box of #8 × 1-5/8 in exterior screws), so use the count on your box. Rail-to-post fasteners aren't included.

Your results

Posts to set

—

Enter the fence length and layout.

Fenced length (gates out)
—
Straight runs
—
Sections
—
Posts
—
Line posts
—
Corner and end posts
—
Gate posts
—
Post length
—

Posts and sections are counted the safe way: each straight run gets its own short section at the end. If your runs come out even, you'll have a post or two to spare.

What it will cost

Type the prices you see at your store or lumberyard. Lines left blank are left out of the total. Prices change often and vary by area, so nothing is filled in for you.

Posts —

Check today's price:Home DepotLowe's

—
Rails —

Check today's price:Home DepotLowe's

—
Pickets —

Check today's price:Home DepotLowe's

—
Fasteners —

Check today's price:Home DepotLowe's

—
Materials
—
Sales tax
—
Labor or delivery
—
Estimated total
—

Add a price above to see the total.

How to use it

  1. Walk the fence line with a long tape or measuring wheel and add up every run, gates included. Enter that total.
  2. Pick the height and style. The height fills in a typical rail count and post depth, and you can change both.
  3. Count the corners and the ends. An end is anywhere the fence stops: at the house, a neighbor's fence or out in the open.
  4. Enter your gates and their width. Turn on the concrete section if you're setting posts in concrete.
  5. Type the prices from your store or lumberyard in the cost section to get a total.

The formula

Fenced length = Total length − (Gates × Gate width)

Straight runs = Corners + Ends − 1 + Gates (a closed fence: Corners + Gates)

Sections = Fenced length ÷ Spacing, rounded up, + Straight runs − 1

Posts = (Fenced length ÷ Spacing, rounded up, − 1) + Corners + Ends + 2 × Gates

Pickets = Fenced length × 12 ÷ (Picket width + Gap), rounded up, then add waste

Concrete per hole = (Hole area − Post area) × Post depth ÷ 1,728

Every corner, end and gate side needs its own post, and each straight run usually ends with a short section, so the run count shows up in the sections. Rails are sections times rails per section, plus waste. Bags are figured hole by hole and rounded up, since most people pour one hole at a time.

Worked example: 150 ft of 6 ft privacy fence with one gate

  • The fence runs off the back of a house in a U: 2 corners, 2 ends, one 4 ft gate, posts 8 ft apart
  • Fenced length: 150 − 4 = 146 ft. 146 ÷ 8 = 18.25, rounded up to 19
  • Straight runs: 2 + 2 − 1 + 1 gate = 4. Sections: 19 + 4 − 1 = 22
  • Posts: 18 line + 4 corner and end + 2 gate = 24 posts, at least 8 ft long for 24 in in the ground
  • Rails: 22 × 3 = 66, plus 10% = 73 boards
  • Pickets at 5.5 in: 146 × 12 ÷ 5.5 = 318.55, so 319, plus 10% = 351 pickets
  • Fasteners: 319 × 3 rails × 2 = 1,914, or 13 boxes of 150
  • Concrete for a 10.5 in hole around a 4x4: 1.03 cu ft per hole, so 3 bags of 50 lb fast-setting per hole (72 total) or 2 of 80 lb mix (48 total)
  • With 6 in of gravel under each post: holes dug 30 in deep and 7.22 cu ft of gravel, or 15 bags

Before you dig

Call 811 a few business days before you dig. It's the free national "call before you dig" number that gets utilities to mark their buried lines, and your state sets how much notice they need. Lines you own, like sprinkler pipe, landscape lighting or a line out to a shed, usually aren't marked, so find those yourself.

Know where your property line is before you set the first post. A survey or the pins at your corners settle it, and many people keep the fence a little inside the line. Check with your city or county about permits and height limits, and with your HOA if you have one. Some set the style, the height and which way the good side faces.

Why gate posts are different

A gate hangs its whole weight off one post and gets slammed for years. That's why gate posts are often a size bigger (6x6 instead of 4x4), set deeper, or both, and get a wider hole with more concrete. If you upsize them, run the concrete section again for just those posts. Hinges, a latch and an anti-sag brace usually come in a gate kit.

Common mistakes

  • Forgetting the gate posts. Each gate needs two posts that are set dead plumb at exactly the right opening, including room for the hinges and latch.
  • Buying posts that are too short. Height above ground plus depth in the ground is the length you need, so a 6 ft fence with 2 ft buried takes 8 ft posts.
  • Using nominal picket sizes. A "6 inch" picket covers about 5.5 in, which adds up to dozens of pickets on a long fence.
  • Skipping the extra. Some boards come warped, split or badly cupped. Running out halfway through costs more than a few spare pickets.

Questions people ask

How many bags of concrete per fence post?

It depends on the hole. A 10.5 in hole 24 in deep around a 4x4 holds about 1 cu ft of concrete, which is 3 bags of 50 lb fast-setting or 2 bags of 80 lb mix. A wider or deeper hole takes more. Turn on the concrete section and enter your own hole size.

How far apart should fence posts be?

Wood fences are usually built with posts 6 to 8 ft apart on center. Eight feet matches standard rail lengths. Panels and most vinyl and metal systems set the spacing for you.

Do I need two or three rails?

Short fences usually get two. At 6 ft and up, most builders add a middle rail so the pickets stay flat as the wood dries and moves.

How deep should fence posts go?

A common rule of thumb is about a third of the height above ground, so about 2 ft for a 6 ft fence. Where the ground freezes, local code often requires going below the frost line, and gate posts are often set deeper. Your local building department has the final say.

Can I figure a board-on-board or shadowbox fence?

Not directly. Those pickets overlap, so you need more than the same length of side-by-side pickets. A quick way is to run it once for each side, with the gap set to the open space between that side's pickets, and add the two picket counts. Keep the posts, rails and concrete from just one run.