Skip to main content
force.tools

Fence Calculator

Lay out a fence run by run: count posts, panels and rails from each run length, post spacing and gates, with shared corner posts and gate posts made explicit.

Unit system

Measurements

A run is a straight section between corners or ends.

in ft

Leave blank for none.

Dimension diagramFence run of posts showing Run 1 length overall and Post spacing between posts.Run 1 lengthPost spacing
Run 1 length: not entered · Post spacing: not entered

Material

in ft

Centre-to-centre distance, usually the panel width. 8 ft (2.4 m) is common.

in ft

Opening per gate, post face to post face. Needed when runs include gates.

Your estimate

Enter your measurements to see an estimate.

Estimate only. Verify dimensions, product data and local requirements before ordering, and consult a qualified professional where structure or code applies.

How to use this calculator

What to measure
Walk the fence line and split it into straight runs between corners and ends. Measure each run and note how many gates it contains. Decide your post spacing, which is usually the panel width.
Units
Imperial: feet for runs, spacing and gate width. Metric: metres.
Reading the result
Use the total post count for ordering, and the per-run figures when setting out. Buy gate hardware and any heavier gate posts separately.

Formula

Variables used in the formula
VariableMeaning
LᵢLength of run i
gᵢGates in run i
GGate opening width
sPost spacing
cShared corners: runs − 1 if connected, runs if a closed loop
Bays in run i = ⌈ (Lᵢ − gᵢ × G) ÷ s ⌉
Posts in run i = bays + 1 + gᵢ
Total posts = Σ posts − c
Rails = Σ bays × rails per bay

Bays are rounded up per run, so every bay is no longer than the post spacing.

Worked example

Three connected runs of 50 ft, 30 ft and 50 ft, with one 4 ft gate in the middle run, 8 ft post spacing and 2 rails per bay.

  1. Run 1: ⌈50 ÷ 8⌉ = 7 bays → 8 posts
  2. Run 2: ⌈(30 − 4) ÷ 8⌉ = 4 bays → 4 + 1 + 1 = 6 posts
  3. Run 3: ⌈50 ÷ 8⌉ = 7 bays → 8 posts
  4. Posts = 8 + 6 + 8 − 2 shared corners = 20
  5. Panels = 18, rails = 18 × 2 = 36
Result
Total posts20 posts
Panels or bays18 panels
Rails36 rails
Gates1 gate
Shared corner posts2 posts
Total fence line130.0 ft
Run 1 posts (standalone)8 posts
Run 1 panels7 panels
Run 2 posts (standalone)6 posts
Run 2 panels4 panels
Run 3 posts (standalone)8 posts
Run 3 panels7 panels

Reference

Typical post spacing
Fence typeSpacing
Wood privacy, 6 ft panels6 ft (1.8 m)
Wood privacy or picket, 8 ft panels8 ft (2.4 m)
Vinyl panels6–8 ft, to suit the panel
Chain linkup to 10 ft (3 m)
Post and rail, farm8–10 ft (2.4–3 m)

Follow the manufacturer's spacing for panels, and local wind and code requirements.

Questions

Why does a gate add a post?

The fence section ends at one gate post, and a second post hangs or latches the gate on the other side. One of those is already the end of a bay, so each gate adds one post to its run.

What's the difference between connected runs and a closed loop?

Connected runs share a post at each corner between them. A closed loop also joins the last run back to the first, which shares one more post.