Fence length = 2 × (length + width)Fence Calculator
Estimate fence panels, posts, spacing and material cost from a known fence length or a rectangular enclosure perimeter. Use pre-made panels or a maximum post-spacing method.
How the fence estimate is calculated
In known-length mode, BuildAmounts uses the total fence length you enter. You then choose whether that length is an open run or a closed loop because the end-post count differs. Switching between open run and closed loop does not change the entered fence length; it changes how the section endpoints are counted. In rectangular-enclosure mode, the calculator assumes all four sides are fenced and uses a closed loop.
Posts = fence sections + 1Posts = fence sectionsBase panels = fence length ÷ panel width, rounded upBase panels = 2 × ceil(length ÷ panel width) + 2 × ceil(width ÷ panel width)Panels to buy = base panels × (1 + allowance ÷ 100), rounded upSections = fence length ÷ maximum spacing, rounded upSections = 2 × ceil(length ÷ max spacing) + 2 × ceil(width ÷ max spacing)Length to price = fence length × (1 + material allowance ÷ 100)Cost = panels to buy × price per panel + posts × price per postCost = priced infill length × price per length + posts × price per postWhy rectangular enclosures are calculated side by side
For a rectangular enclosure, BuildAmounts rounds the required number of panels or post sections on each side separately rather than dividing the entire perimeter as one uninterrupted line. This respects the four corners and prevents a section from mathematically passing through a corner. Corner posts are shared by the two adjoining sides, so a closed rectangular loop has the same number of unique posts as fence sections. In panel mode, this is a conservative planning count: it does not assume that an offcut from one side can always be reused on another side, so a carefully optimized real layout may sometimes use fewer full panels.
Pre-made panels
Base panels are the whole panels required to cover the physical fence length. The calculator starts with an editable 8 ft panel width only as a convenient example; it is not a universal fence-panel size. Enter the actual width of the product you plan to buy. The optional extra-panel allowance is applied after the base count and rounded up again, so it represents spare panels rather than installed fence length. Posts are calculated from the base installed sections, not from spare panels.
Maximum post spacing
The spacing entered is treated as a maximum, not a target that may be exceeded. The calculator starts with 8 ft only as an editable example, not as a structural recommendation. Use the maximum spacing permitted for the actual fence system, posts, rails or manufacturer instructions. BuildAmounts creates enough sections that the calculated spacing is at or below the selected maximum. For rectangular enclosures, each side is divided separately. The results show both the selected maximum and the largest actual section spacing produced by the calculation.
How unit changes work
Changing a fence-length, enclosure-dimension, panel-width or maximum-spacing unit converts the entered number so the physical measurement stays the same. For example, 8 ft becomes 2.4384 m. Because the physical fence and spacing have not changed, panel counts, post counts and section counts should stay the same apart from harmless display rounding. In post-spacing pricing, changing the pricing unit between per meter, per foot and per yard also converts the entered price to the equivalent rate so the estimated cost stays essentially unchanged.
How the two pricing options work
In panel mode, cost is based on whole panels to buy × price per panel, plus required posts × price per post. Those prices are per physical item, so changing only the panel-width display unit does not change the price per panel or price per post. If you enter only one of the two prices, the results panel labels the total as either Estimated panel cost or Estimated post cost so it is clear that the number is only a partial material estimate.
In post-spacing mode, continuous infill/material is priced by length and posts are priced per item. If you switch the infill pricing unit between meters, feet and yards, BuildAmounts converts the entered price to the equivalent rate so the estimated total cost stays essentially unchanged. If only one price is entered, the result is labeled Estimated infill/material cost or Estimated post cost; when both are entered, it is labeled Estimated material cost.
What the results mean
The first length row adapts to the selected input method: it shows Entered fence length for known-length mode and Calculated enclosure perimeter for rectangular mode. The rest of the side panel also changes with the construction method. Panel mode reports base panels, installed posts, nominal panel coverage and panels to buy after the optional allowance. Post-spacing mode reports sections, posts, the selected maximum spacing, the largest calculated section spacing and the continuous infill/material length used for pricing.
Gates, corners and real installation
Gates and gate openings are not included automatically because their placement changes section lengths and post requirements. Gate posts, gate hardware, rails, pickets, concrete, fasteners, caps, delivery and labor are not automatically included in the displayed quantities or cost. If a gate removes part of the fence run, you can use a known total fence length that excludes the opening to estimate the non-gate fence material, but the calculator still does not add the special gate posts or hardware. For layouts with several separate runs or gates, calculate the individual runs carefully rather than treating every opening as if it had no effect on post placement.
Before purchasing fence materials
Confirm actual panel dimensions, manufacturer post-spacing limits, corner/end-post requirements, gate layout, ground slope, property boundaries and local code or permit requirements before purchasing. A quantity calculator cannot determine structural suitability or legal placement.