About this calculator
This calculator does the take-off for a post-and-rail fence: how many posts (end, corner, gate and intermediate), how many rails, how many boards or ready panels, and how much concrete the post holes need. Enter the fence as one or more straight runs, add gates to any run, and choose between boards on rails or ready-made panels.
Runs can be joined end to end (a fence line that turns corners, where consecutive runs share a corner post) or separate (each run stands alone with its own two end posts). A closed loop, where the last run returns to the first run's start post, is not modelled: enter it as joined runs and remove one end post yourself.
Formula
All distances are measured between post centrelines: a run's length is from
its first end post centre to its last; a gate's offset is from the run's start
to the first gate post centre, and its width is between the two gate post
centres (the clear opening is width − post section).
Infill segments and posts. Gates cut each run into infill segments. A segment of zero length (a gate right at a run end, or two gates side by side) is dropped, because that gate post is also the end post or the neighbouring gate's post.
bays in a segment n = ceil(segment length / post spacing)
posts in a segment n + 1 (end posts shared with neighbours, never double counted)
posts in a run = all bays in the run (infill bays + 1 bay per gate) + 1
posts in total = Σ posts in runs − (runs − 1) if runs are joined
= Σ posts in runs if runs are separate
end posts = 2 (joined) or 2 × runs (separate); corner posts = runs − 1 (joined)
gate posts = distinct gate post positions that are not already a run end
intermediate posts = total − end − corner − gate posts
post length = fence height + hole depth
Boards. Within a board-infill segment the bays are equal (segment / n).
Boards run continuously along the rails across intermediate posts, so they are
counted per segment. n boards of width w with n − 1 gaps g must cover
the segment s:
n·w + (n − 1)·g ≥ s ⇒ boards = ceil((s + g) / (w + g))
waste boards = ceil(net boards × waste% / 100); total = net + waste
board length = fence height
rails = infill bays × rails per bay; rail cut length = bay length (post centre to centre)
Panels. A panel's module equals the post spacing. Posts are set at full modules from the start of each segment; any remainder becomes one shorter bay with a cut-down panel:
full panels = Σ floor(s / spacing); cut panels = number of segments with a remainder
Concrete. Each hole is a cylinder; the embedded part of the square post is deducted:
hole volume = π × (d / 2)² × depth
concrete per hole = hole volume − post² × depth
concrete total = concrete per hole × posts; excavation = hole volume × posts
Worked example
Defaults: two joined runs, 12 m and 6 m; a 1 m gate 4 m from the start of run 1; height 1.5 m; post spacing 2 m; 100 mm posts; holes Ø300 mm × 800 mm deep; boards 100 mm wide with 20 mm gaps; 2 rails per bay; 10 % waste.
run 1: segments 4000 and 7000 mm around the gate
4000 → 2 bays; 7000 → 4 bays of 1750 mm; gate → 1 bay; 7 bays → 8 posts
run 2: 6000 → 3 bays → 4 posts
posts = 8 + 4 − 1 corner = 11 (2 end, 1 corner, 2 gate, 6 intermediate)
post length = 1500 + 800 = 2300 mm
boards: ceil(4020/120) = 34, ceil(7020/120) = 59, ceil(6020/120) = 51 → 144
waste = ceil(14.4) = 15 → 159 boards, 1500 mm long
rails = 9 bays × 2 = 18 (10 × 2000 mm, 8 × 1750 mm)
hole = π × 150² × 800 ≈ 56 548 668 mm³ ≈ 0.0565 m³
concrete per hole = 56 548 668 − 100² × 800 = 48 548 668 mm³ ≈ 0.0485 m³
concrete total = 11 × 0.0485 ≈ 0.534 m³
FAQ
Why do I get more posts than fence length divided by spacing? Every infill segment is rounded up to whole bays separately, and every gate adds its own pair of gate posts. A run of 12 m with a gate needs more posts than a plain 12 m run.
Does a gate at the end of a run need an extra post? No. If a gate starts exactly at a run's start (or ends exactly at its end), the end post is also the gate post. Two gates placed side by side share their middle post.
Is the concrete volume enough to order? It is the geometric volume of the holes minus the embedded posts. Add your own allowance for irregular holes and spillage; no gravel drainage layer at the bottom of the hole is deducted.
How deep should the post holes be? This calculator does not decide that. Embedment depth depends on fence height, wind exposure, soil and frost depth; follow local practice and the post manufacturer's guidance and enter the depth you will actually dig.
Are rails calculated for panel fences? No. Ready panels are assumed to be self-framed and fixed directly to the posts, so rails are only counted for board infill.
Assumptions and limits
No standard was found that fixes fence post spacing, rail count, post embedment depth or hole size as a universal rule, so none is cited. Post spacing, post section, hole diameter and depth, rails per bay, board width and gap, and the 10 % board waste are all editable estimates, not normative values.
All lengths are to post centrelines. Boards are counted to post centres at run ends and at gates; the half-post difference is left to the waste allowance. Boards are assumed to span the full fence height with no ground clearance. Rail cut length is the bay's centre-to-centre length (rails butted between posts are shorter by one post section). Gates are counted as openings only; the gate leaves, hinges and hardware are not included, and heavier gate posts are not sized. Runs are straight; a closed loop is not modelled. The elevation shows run 1 only and, on long runs, a representative selection of posts and boards.