Fence Calculator Explained
A fence run is just a chain of equal bays between posts, but the post count, rail length and cost all turn on a rounding step most people get wrong. Here is the math the fence calculator runs, why the standard bay sizes are the sizes they are, and where it pays to ignore the "wider bays save money" rule.
What a fence calculator is actually doing
A fence run looks complicated when you stare at a roll of chain-link or a stack of featheredge boards, but the underlying math is one of the simplest in residential construction. Every fence is a straight chain of equal-width bays sat between two posts. The length of the run, the spacing you pick, and the number of rails per section together fix the post count, the rail length and the material cost — and once those three numbers are right, everything else is just multiplication. The fence calculator on Calc Dragon takes the four inputs that actually matter (run length, post spacing, rails per section, prices) and returns the materials list you take to the timber merchant.
The reason an article like this exists at all is that one particular step — the rounding of bays and the off-by-one on posts — is where almost every DIY fence quote goes wrong. Under-order by one post and you finish the job with a 1 m gap at the gate end. Order using a width that does not match stock rail lengths and you spend the weekend on the mitre saw. The rest of this piece walks through the formula, the standard spacings and why they exist, a worked example for a 30 m garden fence, the four cost levers worth pulling, and where the calculator stops and the building inspector takes over.
The formula in one paragraph
Sections (also called bays) equal the run length divided by the post spacing, rounded up to the next whole bay. Posts equal sections plus one — every bay needs a post at each end, but interior posts are shared between adjacent bays, so a run of n bays needs n + 1 posts. Linear rail metres equal sections × spacing × rails per section. Material cost equals (posts × price per post) + (rail metres × price per rail metre). The fence calculator applies those four lines and shows the subtotals alongside the grand total so you can see where the money is going.
The post-count rule that catches everyone
The most common mistake on a homemade quote is dividing run length by post spacing and taking that as the post count. Posts equal bays plus one, not bays. A 24 m run at 2.4 m spacing has 10 bays — but it has 11 posts: one at each end, plus 9 in between. On a small garden fence the difference is one timber post and £15. On a 100 m run that one missing post is the difference between a finished job and a Sunday afternoon trip back to the merchant. The fence calculator applies the +1 silently in the background so the number it gives you is the number to order.
The second mistake is rounding down on bays. A run that does not divide evenly still has to terminate at the end post. Take a 25 m fence at 2.4 m spacing: 25 ÷ 2.4 = 10.42 sections. Rounding down to 10 bays gives a fence 24 m long, with the last metre unsupported. Rounding up to 11 bays gives a fence 25 m long with the last bay narrower than the others (0.6 m). Installers almost always go the second way — a narrow final bay looks fine and avoids leaving a gap. The calculator does the same.
Choosing the right post spacing
Standard residential post spacings fall into a small set of values that reflect two things: the bending stiffness of common rail timber, and the lengths in which stock rails and panels are sold. There is no good reason to invent a custom spacing — match the merchant's stock and the job goes up in half the time.
2.4 m (8 ft) — the North American default
8 ft is the default bay spacing across the United States and Canada because almost every stock fence panel, every batch of pressure-treated 2×4 rail timber, and every roll of chain-link fabric is sold in 8 ft increments. 2.4384 m converts to a clean 8 ft, and the fence calculator's default of 2.4 m is close enough that the rail off-cuts are trivial. If you are buying panels, do not stray from this number.
1.83 m (6 ft) — BS 1722-5 closeboard, narrow option
In the UK, BS 1722-5 — the British Standard for wood fences — permits 1.83 m (6 ft) bays for closeboard fencing on stronger rails or where wind loading is high. Closeboard featheredge boards are nailed vertically across three horizontal rails, so the bay spacing is the rail span between posts. 1.83 m is the stiffer choice and the default for coastal sites or anywhere the run sits exposed.
3.0 m — BS 1722-5, the standard inland bay
Most inland UK fences use 3.0 m bays per BS 1722-5, with arris rails of 75 × 38 mm pressure-treated softwood. Wider than 3.0 m and you have to step up to heavier rails to avoid sag, and the cost of the upgraded timber usually overruns the saving in post count. The 3.0 m bay is also the upper bound the standard permits without engineered design, which is why you rarely see wider spacings on a domestic fence.
3.0 to 3.6 m — chain-link
Chain-link fencing is the exception. The mesh fabric carries the load horizontally between line posts, so the posts can space wider — typically 3.0 to 3.6 m apart for residential chain-link, and up to 4 m for industrial sites with heavier gauge wire. If you are running a chain-link fence at 2.4 m spacing the post count is essentially doubled with no benefit.
Rails per section
Rails are the horizontal members the cladding (featheredge, pickets, mesh, panels) attaches to. The number of rails depends almost entirely on fence height. Two rails for fences under 1.2 m, three for the standard 1.2 to 1.8 m residential fence, and four for tall paddock or livestock fencing where animals lean on the lower rails or kick the structure. BS 1722-5 §6 fixes a minimum of three rails for closeboard fencing 1.5 m and above, and the American Fence Association recommends the same for 6 ft privacy fencing.
Extra rails buy stiffness, security and the ability to attach narrower cladding. They cost in proportion — the rail subtotal in the fence calculator scales linearly with rail count so a quick A/B between 2-rail and 3-rail prices takes about five seconds. On a long run the difference is meaningful: a 50 m fence at 2.4 m spacing has 21 bays, so going from two rails to three adds 50.4 linear metres of rail timber and around 30% of the rail cost.
Worked example: a 30 m garden fence
Take a standard 30 m straight garden fence, 1.8 m high, closeboard cladding, built on 2.4 m bays with three rails per section. Posts cost £15 each, rails cost £4 per linear metre. Plug those into the fence calculator and the math runs through like this.
Sections = ⌈30 ÷ 2.4⌉ = ⌈12.5⌉ = 13 bays. The last bay is 1.2 m wide instead of the full 2.4 m, because the run does not divide evenly.
Posts = 13 + 1 = 14. End post, then twelve intermediate posts, then end post.
Rail length = 13 × 2.4 × 3 = 93.6 m, which converts to 307.09 ft using the NIST conversion 1 ft = 0.3048 m exactly. A US merchant selling in 8 ft lengths needs ⌈307.09 ÷ 8⌉ = 39 boards; a UK merchant selling 3.0 m rails needs ⌈93.6 ÷ 3⌉ = 32 lengths.
Posts subtotal = 14 × £15 = £210. Rails subtotal = 93.6 × £4 = £374.40. Total material cost = £584.40 for posts and rails, equivalent to £19.48 per linear metre of finished fence.
That figure is the structural skeleton — posts and horizontal rails. The cladding (closeboard featheredge), concrete for the post holes, capping rails, gate hardware, and labour are extras you add on top. A reasonable rule of thumb is that the skeleton cost the calculator returns is around 35 to 50% of the all-in DIY cost for a closeboard fence, and 20 to 30% for a contractor-installed one. The point of the calculator is to get the skeleton right so the rest of the quote is built on a correct foundation.
The four cost levers worth pulling
Post spacing
Wider bays mean fewer posts. Going from 1.83 m to 2.4 m on a 30 m run drops the post count from 18 to 14 — four fewer posts, four fewer concrete bags, four fewer holes to dig. Going from 2.4 m to 3.0 m drops it from 14 to 11. The catch is rail stiffness: at 3.0 m bays the rail timber needs to step up from 75 × 38 mm to 100 × 50 mm or you get noticeable sag within a year. Run the rail price for both timber sizes through the fence calculator before committing.
Rail count
Dropping from three rails to two on a low fence saves a third of the rail timber outright. The trade-off is fence height — two rails will not support cladding above about 1.2 m without the cladding bowing between rails. For a 0.9 m boundary fence across a front garden, two rails are plenty and the saving is real.
Material grade
Pressure-treated softwood is the baseline. Stepping up to hardwood (oak, sweet chestnut) doubles the timber cost but triples the service life. Composite (recycled plastic / wood fibre) rails are around 2.5× the cost of softwood and need roughly half the post spacing because the rails sag more. Plug the material's price per metre into the rail-price input and the calculator gives you the comparable total.
Run geometry
Every corner shares a post between two runs, so an L-shape with two 15 m straights saves one post compared with a single 30 m run treated as two independent calculations. Calculate each straight independently in the fence calculator, add the results, then subtract one post per corner.
Common mistakes
Counting posts as length ÷ spacing
Already covered above, and worth restating. Posts = bays + 1. The off-by-one is the single most common error on amateur fence quotes. Use the calculator output and the +1 is applied for you.
Spacing that does not match stock rail length
Stock fence rails ship in 1.8 m, 2.4 m, 3.0 m or 8 ft (2.44 m) lengths depending on the merchant. Picking a 2.5 m bay sounds elegant until you realise every rail needs cutting down from a 3.0 m stock length, with a 0.5 m off-cut wasted on each. Pin the spacing to a stock length and the cuts vanish.
Forgetting concrete and gate hardware
The skeleton cost is not the installed cost. A 14-post fence needs around 14 bags of post-mix concrete (one per hole) and a gate adds £80 to £200 of hinges, latch and heavier gate timber. The concrete calculator turns the post count into the right number of bags.
Ignoring boundary lines and planning rules
In England and Wales, a fence at the rear boundary up to 2 m high is generally permitted development under Class A; a front-garden fence is capped at 1 m next to a highway. In the US the equivalents are local zoning rules, typically capping front-yard fences at 3 to 4 ft and rear-yard fences at 6 to 8 ft. The calculator does not check planning rules — you do.
When to skip the calculator and call someone
A 30 m garden fence on level ground is the canonical DIY job and the calculator covers it cleanly. Three situations are worth getting professional help on before ordering materials. First, steeply sloping ground — stepped fences need either racked panels or stepped panels, and the post height varies bay by bay. Second, shared boundary fences in built-up areas, where ownership and the right to alter the fence are recorded on the title deed and getting it wrong is a neighbour dispute. Third, any fence over 2 m or any fence facing a highway, both of which usually need planning permission in the UK and a zoning variance in the US. The calculator gets the materials right; it does not get the legalities right.
How the calculator relates to the rest of the site
Once you have the post count, the concrete calculator turns it into the right number of post-mix bags. The square footage calculator helps work out the garden area inside the new fence line, and the area converter shifts the result between m², ft², acres and hectares for any deed-based boundary numbers. For an adjacent project — a poured concrete driveway up to the new gate, say — the concrete driveway cost calculator runs the same kind of skeleton-cost estimate the fence calculator does, but for the slab.
Bottom line
A fence is a chain of bays. The bay count rounds up; the post count is bay count plus one; the rail metres are bay count times spacing times rails per section. Everything else — cladding, concrete, gate hardware, labour — is layered on top of those three numbers. Get the skeleton right and the rest of the quote falls out cleanly. The fence calculator exists to make sure the skeleton is right before the order goes in.
Frequently asked questions
Why is the post count one more than length divided by spacing?
Because a fence is a sequence of bays, and every bay sits between two posts. A 24 m run at 2.4 m spacing has 10 bays, but it has 11 posts: one at each end, plus 9 intermediate posts between the bays. The general rule is posts = sections + 1. The fence calculator also rounds the section count up, because you cannot order 10.4 bays of materials — a 25 m run at 2.4 m spacing gives 11 bays (the last 0.6 m wide) and 12 posts.
What is the standard fence post spacing?
In North America it is 8 ft (2.4384 m), driven by the fact most stock fence panels and rails ship in 8 ft lengths. In the UK, BS 1722-5 closeboard fencing uses either 1.83 m (6 ft) bays or 3.0 m bays. Chain-link can run wider — 3.0 to 3.6 m between line posts — because the mesh carries the load between them. The fence calculator defaults to 2.4 m, which works for the majority of residential timber fences and matches stock 8 ft panel material almost exactly.
How many rails do I need per section?
Two rails for a fence under about 1.2 m, three for the standard residential 1.2 to 1.8 m fence, and four for tall, paddock or livestock fencing where animals lean on the lower rails. BS 1722-5 §6 specifies a minimum of three rails for closeboard fencing 1.5 m and above. Each extra rail adds proportional cost and adds stiffness — the fence calculator scales the rail subtotal linearly so you can run two-rail and three-rail prices in seconds.
Do I order pickets, panels and concrete separately?
Yes. The fence calculator costs the structural skeleton — posts and horizontal rails — because everything else depends on the specific cladding choice. Closeboard featheredge, pickets, mesh and pre-made panels are sold per linear metre or per panel and priced by the supplier. Post-setting concrete typically runs at one 20 kg bag of post-mix per post hole, or about 0.018 m³ of mixed concrete per post — the concrete calculator turns that into the right number of bags for the full run.
How do I handle corners and gate openings?
Calculate each straight run independently and add them together. At each corner the two runs share a single post, so subtract one post per corner from the combined total. For a gate, treat the gate opening as one bay the gate spans (it still counts as a section). Order heavier gate posts than line posts — typically 125 × 125 mm timber or a 75 mm box-section steel post against the 100 × 100 mm posts used along the run — because the gate hangs cantilever from one of them.
How accurate is the cost-per-metre figure?
The cost-per-metre output is exact for posts and rails at the prices you enter, but it does not include cladding, concrete, hardware, labour, delivery or wastage. A useful rule of thumb is that the structural-skeleton cost the fence calculator returns is around 35 to 50% of the all-in installed cost for a DIY project, and 20 to 30% for a contractor-installed fence. Treat the figure as the materials baseline you build the full quote on top of.
Why does the calculator round the section count up?
Because a fence run that does not divide evenly into bays still needs to terminate at the end post. A 25 m run at 2.4 m spacing comes to 10.42 sections. Rounding down gives you 10 bays of 2.4 m = 24 m, leaving the last 1 m unsupported. Rounding up gives 11 bays, with the last bay narrower than the rest (0.6 m). The calculator follows the second approach, which matches how the run gets built in practice — installers narrow the final bay rather than over-stretching the standard ones.
How do I convert the rail length to feet for a US supplier?
The calculator already shows both. The exact conversion is 1 ft = 0.3048 m exactly (NIST SP 811), so multiply metres by 3.28084 to get feet, or divide by 0.3048. A 93.6 m rail order is 307.09 ft — if the supplier sells 8 ft lengths, that is ⌈307.09 ÷ 8⌉ = 39 boards. Add one extra board per straight run to cover end trims and saw cuts.
Informational only. Not personalised financial, legal, or tax advice.