Fencing & Decking

Fence Calculator

Estimate basic fence posts and panels from multiple runs, editable post spacing, panel width, gate openings, and panel waste.

Last reviewed:

Project measurements

Measurement system

Spacing and product dimensions are editable planning assumptions. This calculator does not provide structural or code guidance.

Fence run 1

Editable assumption; both endpoints are counted for each run.

How to use this calculator

  1. Add each separate fence run.
  2. Enter the maximum post spacing and selected panel width.
  3. Enter the combined width of gate openings.
  4. Choose panel waste and calculate the planning quantities.

How the calculation works

Run lengths are combined for the length total. Posts are counted separately for each run by rounding the number of spaces upward and including both endpoints. Gate width is deducted from panel infill length; panel waste does not change the post count.

Formula

Posts per run = ceil(run length ÷ post spacing) + 1
Net infill = total run length − gate openings
Purchase panels = ceil(ceil(net infill ÷ panel width) × (1 + waste %))

Worked example

Two 24 ft runs total 48 ft. At an entered 8 ft maximum spacing, each run uses 4 posts, or 8 total. With a 4 ft gate, 44 ft of infill and 8 ft panels require 6 panels before waste.

Second scenario: three runs and a gate

A back fence 60 ft long and two side fences 40 ft long each total 140 feet. Enter the three runs with 8 ft maximum spacing, 8 ft panels, a 4 ft gate, and 5% panel waste. The 60 ft run takes ceil(60 ÷ 8) + 1 = 9 posts, and each 40 ft run takes ceil(40 ÷ 8) + 1 = 6, so the tool counts 21 posts. Net infill is 140 − 4 = 136 feet, which needs 17 panels, and with 5% waste that becomes 18.

Those posts are counted per run, but if the three runs form a U and meet at two corners, those corners share a post. The true count is then 19, not 21. This is the clearest example of why the tool says to model shared corners yourself.

How spacing changes the post count

The table applies the post formula to three run lengths at two maximum spacings. Wooden fence posts are commonly set 6 to 8 feet apart, according to a decking and fencing guide, which is why those two values are shown.

Run lengthPosts at 6 ft spacingPosts at 8 ft spacing
24 ft54
50 ft108
100 ft1814

What to settle before you buy

  • Property lines. Fence on your side of a surveyed line, and check whether a shared fence needs a neighbor’s agreement.
  • Height and permit rules. They vary by city. As one example, Portland, Oregon generally does not require a permit for a wood fence up to 7 feet, though zoning setbacks still apply. Your city may be different.
  • Underground utilities. Call 811 a few days before you dig post holes so that buried lines are marked.
  • Post depth. The same fencing guide suggests setting posts at least one third to one half of their above-ground height into the ground; frost depth and soil can require more.

Gates, slopes, and corners

Gate posts carry the swing of the gate and are often heavier than line posts, so plan them as part of the post list rather than as part of the infill. On a slope, panels either rack or step, and a stepped fence uses more or longer posts than a flat one. Neither is modeled in this page. Corner and end posts are counted once per run, so adjust the total by hand where runs meet.

When to hire a fence contractor

Long runs, steep ground, tall privacy fences, and fences that serve as pool barriers are often better handled by a contractor who knows local code. The calculator is a planning aid for materials, and it does not consider wind loading, soil conditions, or required post size.

Project considerations

  • Spacing and panel dimensions are editable assumptions, not universal recommendations.
  • Each entered run receives its own two endpoints; shared corners should be modeled to match the actual layout.
  • Gate hardware, post depth, structure, code requirements, and cost are not calculated.

Frequently asked questions

Why are posts counted separately by run?

The calculator assumes each entered run has two endpoints. This keeps the endpoint assumption visible and avoids silently sharing posts between disconnected runs.

Do gate openings reduce the post count?

No. Gate width reduces panel infill only; plan gate and adjacent posts for the selected system separately.

References

Published sources for context. They are not used in the calculation.