Landscaping & Outdoor
Fence Calculator
Estimates fence panels, posts, rails and bottom boards from run length
Updated May 13, 2026 · Live
What this tool does
Estimates the panels, posts, rails and bottom (gravel) boards for a straight fence run from its length and post spacing, with a material cost from your prices.
People also use
Formula Used
Formula Used
How the fence calculator works
The calculator treats the fence as one straight run divided into bays between posts. The number of panels is the length divided by the post spacing, rounded up: N = ⌈L ÷ s⌉. Posts are N + 1, because a straight run has a post at each end. Rail length is 2 × L, one top and one bottom rail along the whole run, and there is one bottom (gravel) board per panel. The material cost is panels × panel price + posts × post price + rail length × rail price per unit length + boards × board price.
Worked example with the US defaults: 66 ft of fence with posts 8 ft apart gives 66 ÷ 8 = 8.25, so 9 panels (the last one is cut) and 10 posts. Rails are 2 × 66 = 132 ft. At $35 a panel, $14 a post, $1 per ft of rail and $10 a bottom board the cost is 9 × 35 + 10 × 14 + 132 × 1 + 9 × 10 = 315 + 140 + 132 + 90 = $677. The metric default is 20 m with posts 1.83 m (6 ft) apart: 20 ÷ 1.83 = 10.93, so 11 panels and 12 posts, with 40 m of rail. At £35, £14, £3.50 per m and £10 the cost is 385 + 168 + 140 + 110 = £803. When the run is an exact multiple of the spacing there is no cut panel: 64 ft ÷ 8 ft is exactly 8 panels and 9 posts, which costs 280 + 126 + 128 + 80 = $614.
Units: 1 ft is 0.3048 m, so 66 ft is 20.1 m and a post spacing of 8 ft is 2.44 m. A rail price of $1 per ft is $3.28 per m. The count of panels and posts does not depend on the unit system. Only the lengths and the rail price do.
Typical US landscaping and outdoor wastage
The tool adds no wastage percentage. It already rounds the panel count up to a whole panel, which covers the cut panel at the end of a run, and it counts one post more than the number of bays. Cutting panels or rails to fit, damaged boards and a spare post for a gate or corner all need extra on top. A common planning habit is to add one spare panel and one spare post, but that is a rule of thumb, not a standard. If your boards or pickets are cut on site, add more for offcuts.
What this tool does not do
It prices one straight run with equal bays. It does not add extra posts for corners, gates or changes of level, it does not size gate hardware, and it does not include post concrete, fixings, stain, labour or delivery. It also does not know your fence type. If you buy prefabricated panels, the rails are already part of the panel, so set the rail price to 0 to avoid paying twice. If you build from separate rails and boards, enter the rail price and set the panel price to match your boards. The result is a material cost, not a quote.
On-site considerations for fence
Measure along the line the fence will follow and walk the line before you order. Mark post positions at the chosen spacing, adjusting so the last bay is not very short. Ground that slopes steeply, rock, tree roots and buried pipes or cables change both the post spacing and the number of posts. Call your local utility-locating service before you dig; in the US and Canada that is 811. Posts must be long enough to include the buried part, and the depth depends on soil and frost depth, so ask your supplier or local guidance. Keep wood off the ground where you can, since timber in ground contact decays faster.
Codes and compliance
Fence height, setbacks, materials and pool-barrier rules differ by city and county in the US and by country elsewhere, so check with your local building or planning department before you build. As one regional example, in England a fence generally does not need planning permission if it is no more than 2 m (6 ft 7 in) high, or 1 m (3 ft 3 in) where it is next to a highway used by vehicles, unless the property is listed, in a conservation area or restricted by a local direction. Other countries and regions have different limits. Boundary ownership and neighbours' rights are a separate legal matter.
Before you order
Confirm the real panel width and post type with your supplier, because nominal widths differ from actual ones. Compare the tool's counts with a take-off drawing and ask for the number of rails per panel, the post length and what is included in the price. Order the whole run from the same batch where you can, since timber and stain colour vary between deliveries. For a gate, deduct its width from the run and add its posts and hardware separately.
Adjusting the defaults
Every input can be edited. Enter your own length, post spacing and the five prices. Post spacing must be above zero, and a blank or zero length, spacing or price returns a message instead of a result. A price of 0 is allowed for an item you do not need, such as rails or bottom boards. The currency symbol is only a label, and the tool does not convert money.
Using this fence calculator alongside other BuildMetricLab tools
Use the counts to order panels and posts, then work out the concrete for the post holes and the paving or planting along the line with the linked tools. All BuildMetricLab tools run in your browser with no sign-up, and every formula is shown on the page so you can check the arithmetic yourself.
Sources & methodology
For a straight run of length L with post spacing s, panels = ⌈L ÷ s⌉, posts = panels + 1, rails = 2L (one top and one bottom run) and bottom boards = panels. The cost is panels × panel price + posts × post price + rails × rail price per unit length + boards × board price. Lengths are held internally in metres (1 ft = 0.3048 m) and a rail price per ft is divided by 0.3048 to give a price per m. The tool assumes equal bays with no gates, corners or slopes, and it adds no wastage. Blank, zero or negative length or spacing, and blank or negative prices, return a message instead of a result.
Frequently asked questions
Are fence calculator results accurate enough to order materials?
They are a good starting count for one straight run with equal bays. They do not add posts for corners or gates, and they add no spares. Check the counts against a drawing of your fence line and confirm with your supplier before ordering.
What wastage percentage should I use?
There is no wastage field. The tool rounds the panel count up to whole panels, which covers the cut panel at the end of a run. For panels or boards you cut on site, or for spares, add extra by hand. One spare panel and one spare post is a common planning habit, not a standard.
Does this replace professional advice?
No. It is a planning-stage material estimate. Fence height, setbacks, boundary ownership and any permit depend on where you live, so check with your local building or planning department. For retaining fences or work near structures, use a licensed contractor or engineer.
Can I change the unit prices?
Yes. The panel, post, rail and bottom-board prices are all editable. Enter your supplier's quote, and enter 0 for anything you do not need, such as rails when your panels already include them.
Spotted something off?
Calculations or display — let us know.
Related tools
Calculators from other categories that planners often reach for next.













