Saved

Press the star next to a tool's name to save it.

All my tools

Fence Calculator

Enter your fence length and post spacing, and this fence calculator works out the posts, rails and pickets or panels you'll need, plus an optional cost estimate.

Restored your last values ·

Use feet and inches for US, or meters and centimeters for metric.

Your numbers stay in your browser. Nothing is uploaded.

Posts needed

–

Enter your fence details and press Calculate.

See full result

A fence calculator turns a measurement into a shopping list. Before you buy lumber or panels, you need to know how many posts, rails and pickets a run will take, and ordering too few means another trip to the store. Enter your fence length and post spacing, and this fence calculator works out the materials for a picket fence or for ready-made panels. Add prices to see an estimated cost. You can work in feet and inches or in meters and centimeters, and the same simple formulas apply either way.

How the fence calculator works

  • Sections: fence length ÷ post spacing, rounded up
  • Posts: sections + 1
  • Rails: sections × rails per section
  • Pickets: fence length ÷ (picket width + gap), rounded up

A fence always needs one more post than it has sections, because each section sits between two posts. For ready-made panels, each panel is one section, so the tool counts panels and posts and leaves out rails and pickets. Wood-panel fencing is made of finished planks assembled into large panels that hang between posts. [1] The formulas above are our own working, since they are simple counting.

How to use the calculator

  1. Choose rails and pickets, or panels.
  2. Choose US or metric units.
  3. Enter the fence length and the post spacing.
  4. Add your rails, picket width and gap for a picket fence.
  5. Enter prices if you'd like a cost estimate, and press Calculate.

A worked example

Suppose that you're building a 100-foot privacy fence with posts every 8 feet, three rails per section and 5.5-inch pickets with no gap. Dividing 100 by 8 gives 12.5, which rounds up to 13 sections, so you need 14 posts. Three rails for each of the 13 sections makes 39 rails. The run is 1,200 inches long, and 1,200 ÷ 5.5 rounds up to 219 pickets. If you pay $18 for a post, $9 for a rail and $4 for a picket, the materials come to $252 + $351 + $876, or $1,479.

Choosing your post spacing

Spacing has a direct effect on how many posts you buy and how many holes you dig. Eight feet is a common choice for wood fences, as it matches the length of standard rails, though this is our own working and your supplier may advise otherwise. A shorter spacing makes a fence sturdier, but it adds posts and labor. If you're using panels, the spacing has to match the width of the panel, along with any allowance that the manufacturer asks for. Check the instructions before you dig, because a post in the wrong place is a nuisance to move once the concrete is set.

How many rails do you need?

The right number of rails depends on the height and style of the fence. Shorter fences often have two, while taller privacy fences commonly use three, so that the pickets stay straight. Wikipedia notes that post-and-rail fences have horizontal rails characteristically in two or three courses. [1] This tool treats the number of rails as a figure that you choose and multiplies it by the number of sections.

Pickets and gaps

For a privacy fence with no space between boards, enter 0 for the gap. For a traditional picket look, enter the distance between pickets, and the count drops. Wood can shrink and swell with the weather, so ask your supplier how much space to leave. Buy a few spare pickets too, since some boards will be split or badly warped.

Corners, gates and slopes

The calculator assumes one straight run. A corner adds a change of direction, and it's easiest to calculate each side separately and then subtract any posts that are shared. A gate usually needs a sturdy post on both sides, and you should subtract the width of the opening from the length of the fence. On a slope, measure along the ground and allow extra material, because stepped sections can need longer posts and additional cuts.

Before you start digging

  • Check your boundary. Make sure that the fence is on your own property.
  • Look up local rules. Heights and permits vary from place to place, and some neighborhoods have their own rules.
  • Locate underground lines. Ask your local utility locating service before you dig.
  • Plan your concrete. The amount depends on the size and depth of each hole, so enter a figure from the bag or your supplier.
  • Talk to your neighbors. It can avoid disagreements later on.

Estimating the cost

The cost shown only covers the items that you price. Fasteners, concrete, gates, stain and tools can add a noticeable amount, and hiring someone to install the fence is a separate expense. Compare prices at more than one supplier, since lumber costs vary by location and by season. Treated wood, cedar and redwood are all priced differently, so run the calculator once for each option that you're considering.

Measuring your fence line

Use a long tape or a measuring wheel, and mark the corners with stakes and string. Measure each side and add them up.

Common mistakes

  • Forgetting the last post. Posts always outnumber sections by one.
  • Ignoring waste. Allow a few extra boards.
  • Mixing units. Use feet with inches, or meters with centimeters.

Plan your yard with the room planner, work out quantities with the area and perimeter calculator, and measure a tank with the water tank capacity calculator.

What next

Use this often? Add Fence to your Home screen.

Frequently asked questions

How does the fence calculator work?

It divides your fence length by the post spacing to get sections, adds one post, and then counts rails and pickets.

How many fence posts do I need?

One more than the number of sections. A 100-foot fence at 8-foot spacing needs 14 posts.

Can it estimate fence panels?

Yes. Choose ready-made panels, and it counts panels and posts.

Does it include gates and corners?

No. It assumes one straight run, so add posts for corners and gates.

Can I use meters?

Yes. Choose metric, and enter meters and centimeters.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Everyday Life Tools