Fence Calculator – Posts, Pickets & Materials Estimate

Last Updated: October 19, 2026

Calculate how many posts, rails, pickets, or prefab panels you need to build a fence, plus a subtotal of supplied material prices, from your fence layout and product-approved post spacing.

Planning estimate for one connected fence line or loop. Enter separate infill runs at gates and corners. Verify product spacing, gate hardware, slopes and structural requirements before buying.

Use the product-approved centre-to-centre spacing.

Use 0 for touching edges or a negative value for overlap.

Gates, separate runs, waste and prices

One positive length per line or separated by semicolons; totals must equal fence length minus gate openings. Required with gates or a closed loop. Count a double gate as one opening.

Blank means 0%. Posts and gates receive no waste allowance.

Fence Formula

The calculator works in three modes. Each mode starts by dividing the fence into sections and counting posts, then adds the materials specific to that mode.

S = sum(ceil(each infill run / effective span))
Posts = S + gate openings + 1 (open line); omit +1 for a closed loop
Rails = ceil(S * r * (1 + w/100))
Base pickets = sum(max(1, ceil((12 * run + g) / (p + g))))
Pickets = ceil(base pickets * (1 + w/100))
Panels = ceil(S * (1 + w/100))
Panel effective span = min(s, W)
  • S = number of fence sections (always rounded up)
  • L = total fence length
  • G = combined width of gate openings
  • s = maximum post spacing (center to center)
  • r = rails per section
  • p = picket or board width (inches)
  • g = gap between pickets (inches)
  • W = product-approved panel span between post centres
  • w = waste allowance percentage

Round each straight infill run separately, ending runs at every corner and gate opening. Their sum must equal L – G. Use one connected, unbranched line or loop; disconnected fences require separate calculations. Each opening adds a post-to-post span, even when a double-leaf gate fills it. Panels use the smaller of product panel span and maximum post spacing, with one new panel per infill section and no assumed offcut reuse. Short spans require a product that permits trimming. Pickets cover nominal post-centre run lengths without deducting post widths; the stock allowance assumes fitting cuts or adjusted end gaps. Negative gaps represent overlap and must leave positive coverage. Round base materials to whole pieces before applying waste. Gate hardware, concrete, labour and tax are excluded.

Typical Post Spacing and Picket Coverage

These are illustrative product ranges, not structural or code recommendations. Use the selected product’s instructions and local requirements; nominal panel width can differ from post-centre spacing.

Fence typeTypical max post spacing
Wood privacy or picket6 to 8 ft
Prefab vinyl or wood panels6 to 8 ft (verify effective span)
Chain linkup to 10 ft
Split rail8 to 11 ft (rail length)
BoardActual widthPitch (width + gap)
1×4 picket3.5 in3.5 in
1×6 picket5.5 in5.5 in
1×6 with 0.5 in gap5.5 in6.0 in

Example Problems

Example 1: Wood fence, open run. You are building a 100 ft straight wood fence with a maximum post spacing of 8 ft, 3 rails per section, 5.5 in pickets, no gap, no gate, and a 10 percent waste allowance. Sections = ceil(100 / 8) = 13. Posts = 13 + 1 = 14. Rails = ceil(13 * 3 * 1.10) = ceil(42.9) = 43. Base pickets = ceil(100 * 12 / 5.5) = 219. Pickets = ceil(219 * 1.10) = 241.

Example 2: Prefab panels, closed perimeter. You are enclosing a square 120 ft perimeter, with four 30 ft runs, an effective panel span and maximum post spacing of 8 ft, no gate and no waste. Sections = 4 * ceil(30 / 8) = 16. Posts = 16 and Panels = 16, assuming the panels can be shortened to fit. Rounding the combined perimeter would miss required corner posts.

Frequently Asked Questions

Why does an open run need one more post than a closed perimeter? A straight line of fence has two ends, and each end needs its own post, so the post count is the infill section count plus gate openings plus one. A closed perimeter loops back on itself and shares the corner and end posts, so the post count equals infill sections plus gate openings, after counting every corner as a run boundary.

How much waste should I add? Choose an allowance for the product, layout and likely losses; 10 percent is only an example, not a guarantee. It is applied after rounding base rails, pickets and panels to whole pieces. Posts and gate openings are not increased. Verify the complete site layout and any special supports separately.

How are gates handled? Subtract the combined opening width, including required hinge and latch clearances, from infill length. Enter the remaining straight runs individually. Each gate opening then adds one span to the post count; a double-leaf gate counts as one opening. A gate unit price is for the complete opening. The calculator does not include gate framing or hardware, since those depend on the gate style you choose.

Fence Calculator – Posts, Pickets & Materials Estimate screenshot