Skip to content

Fence Calculator

Estimate fence posts, rails, pickets and bags of concrete for the post holes, with gates, post spacing, frost depth and material cost, in metric or imperial units.

Calculator Details

Posts:14 postsSee results ↓

Metres and millimetres, or feet and inches

Total length along the fence line, gates included

Height above ground

Centre to centre; 2.4 m (8 ft) is common, 1.8 m (6 ft) for heavier fences

2 for fences up to about 1.2 m (4 ft), 3 for taller fences

Each gate adds one post

Opening per gate, post to post

Actual width (a 1×6 is 140 mm, 5½ in); 0 for no pickets

0 for a privacy fence

Actual size of a square post (a 4×4 is 89 mm, 3½ in)

About 3 times the post width

Below the frost line where you live; ask your municipality

Your Results

Posts: 14 posts

Posts

14 posts

12 sections of 2.4 m + 1 gate · each post 3 m long

Rails

36

3 per section

Pickets

192

Concrete (30 kg bags)

50

0.692 m³ · 24.42 ft³

Material cost

$1,856.00

Layout

Elevation (not to scale): posts in grey, rails in blue, gates shaded at the end.

Materials list

Materials, quantities and cost
ItemQtyEachCost
Posts14$25.00$350.00
Rails36$8.00$288.00
Pickets192$4.00$768.00
Concrete, 30 kg bags50$9.00$450.00
Total$1,856.00

A 30 m fence with 1 gate needs 14 posts, 36 rails, 192 pickets and 50 bags of 30 kg concrete (0.692 m³) for 12 sections of up to 2.4 m.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

How This Calculator Works

How the Fence Materials Are Counted

Sections = ⌈(length − gates × gate width) ÷ spacing⌉
Posts = sections + 1 + gates · Rails = sections × rails per section
Pickets = ⌈fenced length ÷ (picket width + gap)⌉
Concrete per hole = (π × (hole ÷ 2)² − post²) × depth

Your numbers: 30 − 1 × 1.2 = 28.8 m of fence; ⌈28.8 ÷ 2.4⌉ = 12 sections; 12 + 1 + 1 = 14 posts. Concrete: 0.0494 m³ per hole × 14 = 0.692 m³, which is 50 bags of 30 kg or 41 bags of 80 lb, rounded up.

Frequently Asked Questions

How many fence posts do I need?

Divide the length of fence (without the gate openings) by the post spacing and round up to get the number of sections; you need one more post than sections, plus one extra post for each gate. A straight 100 ft fence with posts every 8 ft has ⌈12.5⌉ = 13 sections and 14 posts.

How far apart should fence posts be?

Most wood fences use posts 8 ft (2.4 m) apart on centre, because rails come in 8 ft lengths. Use 6 ft (1.8 m) or less for heavy boards, tall privacy fences, windy sites or vinyl and metal panels that come in set widths. Your fence panels or rails set the spacing; the calculator treats the spacing as a maximum.

How deep should fence post holes be in Canada?

Deep enough to sit below the frost line, so frost heave can't lift the posts. The National Building Code of Canada (Table 9.12.2.2) requires unheated foundations in frost-susceptible soils to reach the depth of frost penetration, which ranges from about 1.2 m in southern Ontario and coastal BC to well over 2 m on the Prairies and in the North. The calculator opens with 1200 mm; ask your municipality for the local frost depth.

How many bags of concrete per fence post?

It depends on the hole. With the defaults (a 250 mm hole 1200 mm deep around an 89 mm post), each hole takes 0.0494 m³, about 3.5 bags of 30 kg (0.014 m³ each). A 10 in hole 3 ft deep around a 4×4 takes 1.381 ft³, a little over two 80 lb bags (0.6 ft³ each).

How wide should a fence post hole be?

A common rule from concrete makers such as Quikrete is a hole about three times the width of the post: about 10 in (250 mm) for a 4×4 and 16 in (400 mm) for a 6×6. A wider hole uses more concrete without adding much strength; a narrower one leaves too thin a collar.

How many pickets do I need?

Divide the length of fence by the picket width plus the gap and round up. Pickets on gates are not included, because gates are usually bought or built separately. For a board-on-board fence, where boards overlap on both sides, count each side as its own row with the gap equal to the overlap.

How many rails does each section need?

Two rails for fences up to about 4 ft (1.2 m) high, three for 5–6 ft (1.5–1.8 m) privacy fences, and sometimes four on very tall or heavy fences. The calculator multiplies the number of sections by the rails per section, with each rail spanning one section.

Do I need a permit for a fence?

Fence height, location and pool-enclosure rules are set by municipal by-laws in Canada and by local zoning codes in the US. Many cities limit backyard fences to about 2 m (6–6.5 ft) and front-yard fences to about 1 m, and pool fences have their own minimums. Check with your city and call before you dig to locate buried utilities.

Counts posts, rails, pickets and premix concrete for a straight fence, and their cost at your prices. Not included: extra posts at corners and ends of separate runs, gate hardware and gate boards, gravel at the bottom of the holes, fasteners, stain, waste and delivery. Bag yields are 0.014 m³ per 30 kg bag (Sakrete Concrete Mix data sheet) and 0.6 ft³ per 80 lb bag (Quikrete Concrete Mix data sheet); fast-setting post mixes yield less per bag. Set the hole depth below your local frost depth (National Building Code of Canada Table 9.12.2.2 for foundations; your municipality publishes local values) and check fence-height by-laws before you build.

Fence Calculator: Posts, Rails, Pickets and Concrete for Post Holes

By FindMySum · Last reviewed

A fence calculator turns a fence line into a shopping list: how many posts, rails and pickets to buy, and how many bags of concrete to set the posts. The counting is simple but easy to get wrong by one, and the concrete is where most people under-buy. This article explains each count, the frost-depth question that matters most in Canada and the northern US, and a worked example with the calculator's defaults.

Sections and posts

A straight fence is a row of sections, each spanning from one post to the next. With a maximum spacing between posts, the number of sections is the fenced length divided by the spacing, rounded up. Because the fence starts and ends with a post, there is always one more post than there are sections.

Gates change the count. A gate opening needs a post on each side, and the calculator subtracts the gate widths from the fence length and adds one post per gate. That's exact for gates set in a straight run; corners of L- or U-shaped fences need their own post, so work each run separately if the runs don't divide evenly by the spacing.

Rails and pickets

Rails run horizontally between posts. Two rails suit fences up to about 1.2 m (4 ft); privacy fences 1.5 to 1.8 m (5 to 6 ft) high normally get three, top, middle and bottom. The calculator multiplies the sections by the rails per section.

Pickets are counted over the fenced length: length ÷ (picket width + gap), rounded up. Use the actual width of the board, not its nominal size: a 1×6 is 5½ in (140 mm) wide. For a privacy fence, set the gap to zero. Gates are left out because their boards are usually cut to fit or come with the gate.

Setting posts below the frost line

In cold climates, wet soil that freezes expands and can lift a shallow post a little each winter, a process called frost heave. The fix is to set the bottom of the post below the depth the ground freezes. Fence posts aren't foundations, but the same physics applies, and the National Building Code of Canada's foundation rules show how seriously it is taken: Table 9.12.2.2 requires unheated foundations in clay and other frost-susceptible soils to reach the depth of frost penetration. That depth varies a great deal, from about 1.2 m in milder parts of the country to more than 2 m on the Prairies and in the North. In the US, local codes publish a frost depth for each county.

The calculator starts at 1,200 mm (about 4 ft) and lets you set any depth. Ask your municipality for the local value, and remember that the post's total length is the fence height plus the hole depth.

Concrete per hole

Each hole is a cylinder with a square post standing in it, so the concrete is the cylinder minus the post:

concrete = (π × (hole diameter ÷ 2)² − post width²) × depth.

A good hole is about three times the post width across. The calculator multiplies by the number of posts and divides by the bag yield printed on the manufacturer's data sheets: about 0.014 m³ for a 30 kg bag of Sakrete Concrete Mix, the usual size in Canada, and 0.60 ft³ for an 80 lb bag of Quikrete Concrete Mix. Fast-setting post mixes yield less per bag, so check yours.

Worked example: the calculator's defaults

The calculator opens with a 30 m fence, 1.8 m high, with one 1.2 m gate, posts at most 2.4 m apart, three rails per section, 140 mm pickets with 10 mm gaps, and 89 mm (4×4) posts in 250 mm holes 1,200 mm deep.

  1. Fenced length: 30 − 1.2 = 28.8 m, which is exactly 12 sections of 2.4 m.
  2. Posts: 12 + 1 + 1 gate = 14 posts, each 3.0 m long (1.8 m above ground plus 1.2 m below).
  3. Rails: 12 × 3 = 36 rails.
  4. Pickets: 28.8 ÷ 0.150 = 192 pickets.
  5. Concrete: (π × 0.125² − 0.089²) × 1.2 = 0.0494 m³ per hole, × 14 = 0.692 m³, or 50 bags of 30 kg.

At the default prices of $25 a post, $8 a rail, $4 a picket and $9 a bag, the materials come to $1,856 before fasteners, gate hardware and tax.

Before you dig

Call your provincial or state one-call service to locate buried gas, power and communications lines; it is free and required in most places. Check the municipal fence by-law for height limits, setbacks and pool-enclosure rules, and talk to your neighbour if the fence is on or near a property line.

More questions

Should fence posts be set in concrete or gravel?

Both work. Concrete gives the stiffest post and is the usual choice for gate posts and tall privacy fences. Compacted gravel drains better around wood posts and makes replacement easier, and some builders use gravel for line posts and concrete only at gates and corners. Either way, put a few inches of gravel at the bottom of the hole so water drains away from the end grain.

What kind of wood should I use for fence posts?

Posts in contact with the ground should be rated for ground contact: pressure-treated lumber labelled for in-ground use (UC4A or higher in the AWPA system, or the equivalent CSA O80 use category in Canada), or naturally durable heartwood such as cedar. Above-ground treated lumber rots quickly when buried.

How do I handle a fence on a slope?

You can either step the fence, with level sections that drop at each post, or rack it, with rails that follow the slope. Measure the length along the ground for the calculator; on steep ground, stepped sections need slightly longer posts on the downhill side to keep the height.

How do corners change the post count?

Each change of direction needs a post at the corner. If you enter the total length of an L-shaped or U-shaped fence, the calculator may count one post short per corner when the runs don't divide evenly by the spacing. For accuracy, work out each straight run separately and add the posts, subtracting one for each shared corner post.

How long should I wait before hanging rails and pickets?

Regular concrete mixes need a day or two to set enough to carry rails, and fast-setting post mixes are usually ready for building in about four hours. Follow the curing time on the bag, and brace posts plumb while the concrete sets.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy