Fence Calculator

Enter the length of your fence, how tall it will be and whether you are using pickets or ready-made panels. You get the posts, rails, boards and concrete to buy.

Building in the UK? Use the UK (metric) version of this calculator.

Jump to your result ↓

Your project

Distance between fence posts. 8 ft is standard for panels and rails; 6 ft is sturdier for tall or windy fences.

gates

Pickets are individual boards you nail up one by one. Panels are ready-made sections, usually 6 or 8 ft wide.

The real width of the board: a 1×6 is 5.5 in, not 6.

Space between boards. None gives full privacy; a gap lets air through and costs fewer boards.

Results

Example job shown. Change the numbers to match yours.

Posts
14 posts
Includes line, end and gate posts. Each gate adds one post: it hangs between two posts, and one of them is already the end of a fence section
What to buy
  • Rails (one 2×4 per rail per section)36 boards
  • Pickets210 pickets
  • 80 lb bagsFor 4×4 posts in 10 in holes. Includes 10% waste, for the post embed depth below. A gravel layer is extra: dig 6 in deeper24 bags
Post length neededFence height plus the buried depth
8.0 ft
Sections between posts
12 sections

Concrete for post holes

Post embed depth usedConcrete depth. With a 6 in gravel base the hole is dug to 30 in
24 in
  • Assumptions used: pickets 5.5 in wide with a 0 in gap; 3 rails per section; 4×4 posts in 10 in holes, at least 24 in deep; 10% concrete waste; 0.6 ft³ per 80 lb bag.
  • Assumes one run of fence. A corner post is shared by the two sides, so it is counted once. If your fence has several sides, work each out separately, since each side rounds up to a whole number of sections. Gate hardware and fasteners are not counted.

Before you buy: round up to whole packs, check the size printed on the label, and add a little spare. Your supplier has the final say.

Blueprint

100 ft6 ft8 of 12 sections shown

100 ft · 14 posts · 12 sections

How this calculator works

First we subtract the gates from the run. The remainder is divided by your post spacing, rounded up, to get the number of sections. A straight fence needs one more post than sections, plus an extra post for each gate. Rails are counted per section (two for a 4 ft fence, three for taller ones), and boards are counted across the run using the width of each picket plus any gap.

sections = ⌈(length − gates × gate width) ÷ spacing⌉posts = sections + gates + 1

Worked example: 100 ft of 6 ft fence with one 4 ft gate and 8 ft spacing: the run is 96 ft, so 12 sections and 14 posts. With 1×6 pickets set tight (5.5 in), you need 96 × 12 ÷ 5.5 = 210 pickets, plus 36 rails. With the posts embedded 24 in (holes dug 30 in deep if you add a 6 in gravel base), the concrete takes about 24 bags of 80 lb.

Assumptions and sources

The assumptions behind your numbers (waste, sizes, rates) are listed in the notes directly under your results, and they update when you change an input.

The formula and a worked example are shown above, so you can check any result by hand. Read how we calculate and check our numbers. Results are estimates for planning: supplier products vary, so check the size printed on the label.

Tips before you buy

  • Use pressure-treated posts rated for ground contact. Pickets and rails can be cedar, redwood or treated pine.
  • Plan on burying about one third of the fence height, with a minimum of 2 ft: a 6 ft fence takes 8 ft posts set about 2 ft deep, and an 8 ft fence takes 11 to 12 ft posts set about 3 ft deep. Go deeper where soil freezes. Check local code, since many places require a permit or set maximum fence heights.
  • Check where your property line is before you dig, and call 811 (in the US) to have buried utilities marked.
  • Buy a few extra pickets: some will be bowed or split, and you will want spares for repairs.

Quick answers by size

Tools & materials for this project

Affiliate links As an Amazon Associate we earn from qualifying purchases. These links do not change what you pay.

Frequently asked questions

How far apart should fence posts be?

Eight feet on center is standard for wood fences, and six feet suits heavy privacy fences or windy sites. Prefab panels dictate the spacing (usually 6 or 8 ft).

How many pickets do I need per foot?

Divide 12 by the picket width plus gap. A 1×6 (5.5 in) picket with no gap needs 2.2 pickets per foot of fence.

How many rails does a fence need?

Two rails for fences up to about 4 ft, and three rails for 5 to 6 ft privacy fences. Eight-foot fences may need four.

Add this calculator to your website

Running a blog, a contractor site or a class page? You can put this calculator on it for free. Copy the code below, and please leave the link underneath the calculator in place. The small script just resizes the frame to fit the results; if your site strips scripts, the calculator still works inside a scrolling frame.

Get the embed code

Related calculators & guides

Estimates only. Results assume standard materials and simple shapes. Supplier products vary, and the final call on quantity, structure and safety is yours. Check your local code and your supplier's guidance before ordering.