Fence Calculator

Type the length of the fence line, the number and width of the gates, and the width of one panel. You see how many panels, posts and rails to buy for the run that the panels cover.

Free Runs in your browser Checked Tuesday, November 10, 2026

The whole straight line in metres, gates included.

The number of gates on this line.

The opening that one gate takes. Type 0 when there are no gates.

From the panel's data sheet, or the width of the panel you will buy.

Count the horizontal rails of one panel, or read them on the data sheet.

Result

Panels — Whole panels for the run, rounded up.
Posts — One post at each end of every panel, and one at each side of every gate.
Rails — The panels times the rails in one panel.
Run of panels (m) — The length less the gates, which the panels cover.

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Measure the whole line in metres, gates included, and type it as Length of the fence line.
  2. Type the Gates and the Width of one gate. Type 0 for the gate width when there are no gates.
  3. Type the Width of one panel and the Rails in one panel from the panel's data sheet.
  4. Read Panels, Posts and Rails to buy.

How the count is made

The gates come off the length, and what is left is the run that the panels cover. Each panel sits between two posts, so the panels are the run divided by the width of one panel, rounded up to whole panels.

A post stands at each end of every panel and at each side of every gate, which gives the panels plus the gates plus one. Each panel carries the rails you count in one panel.

run = length − gates × width of one gate
panels = run ÷ width of one panel (rounded up)
posts = panels + gates + 1
rails = panels × rails in one panel

What a fence is made of

Wikipedia describes a fence as a structure that encloses an area, usually made from posts connected by boards, wire, rails or netting. This page follows that pattern: the posts carry the panels, and each panel is held by its rails.

What this calculator does not include

  • Corners, bends and changes of slope, which add posts and sometimes panels of another length.
  • Concrete for the posts, post caps, gate hinges and fixings.
  • Any post that a gate frame needs of its own: check the gate's data sheet.

Worked example: 30 m of fence, one 1 m gate, 2.5 m panels with three rails

The run is 30 − 1 × 1 = 29 m. Panels of 2.5 m cover it in 29 ÷ 2.5 = 11.6, so 12 panels are needed.

The posts are 12 + 1 + 1 = 14, one at each end of each panel and one at each side of the gate, and the rails are 12 × 3 = 36.

Item Count
Panels 12
Posts 14
Rails (3 in each panel) 36

Frequently asked questions

How many fence panels do I need?

Take the gates off the length, divide what is left by the width of one panel and round up. The page does this, then counts the posts and the rails.

Why is there one more post than panels?

A panel sits between two posts, so a run of panels has one more post than panels. Each gate adds one more post, because it has a post on each side.

Do I include the gates when I measure the length?

Yes. Measure the whole line with the gates in it, and type the width of a gate separately. The page takes the gates out to find the run that the panels cover.

Do all the panels have the same number of rails?

Usually a standard panel has the same rails throughout, but some products differ. Count the rails in one panel of the product you buy and type that number.

Does the tool store what I enter?

No. The calculation runs in your browser and nothing you type is sent to us or stored.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.