Calculator: Skip the hand math: run your own numbers with the free Fence Calculator, then come back here for the full method.
Fence Materials Calculator Guide: Posts, Rails, Pickets, and Concrete
A fence looks simple from the street. It is a line, some posts, and boards in between. Getting the materials list right, though, takes a little care. If you buy too few pickets, you make a second trip and the new boards may not match the first batch in colour. If you buy far too many posts and bags, you pay to haul weight you do not need and then have to store the leftovers. This guide from Mississippi Maple walks through the math in order, in metric first, so you can build a list you trust.
This is an explainer about how the counting works. It is not a building permit, a survey, or a substitute for your local rules. Property lines, setbacks, height limits, and footing depths vary by municipality and province, so verify locally before you dig.
Start with the line, not the lumber
Measure the full run in sections
Walk the line you plan to fence and break it into straight runs. A backyard fence is often three runs: two sides and a back. Measure each run separately in metres, and write the numbers down. Corners matter because a corner post ends one run and starts the next, and it can be shared between them if you count carefully.
Note every gate opening as its own segment. A gate needs its own, usually stronger, posts and its own hardware, and pickets do not fill a gate opening the same way they fill a fixed section. If you subtract the gate width from the picket count but leave it in the post count by mistake, your list will be off in two places at once.
Also note slopes. On flat ground, sections are all the same length. On sloped ground, you will either step the fence, where each section is level and drops at a post, or rack it, where the rails follow the slope. Stepped fences can use a bit more material at the drops, so keep the slope in your notes for the store or for your builder.
Check the things you cannot see from the yard
Before you count a single board, confirm the property line. Guessing a line and then moving a finished fence is far more expensive than a survey or a conversation with a neighbour first. Check for easements, underground utilities, and tree roots along the line, and arrange a utility locate before digging any footing hole. Local rules can also set a maximum height and can say which side the finished face should favour. Verify locally with your municipality and, where relevant, guidance tied to the Ontario Building Code for any attached or structural work, because a garden fence, a pool fence, and a retaining structure are not treated the same way.
How many fence posts do I need?
The post formula
Posts carry the whole fence. The basic formula is:
Posts for one straight run equals number of sections plus 1.
Sections equals the run length divided by the post spacing, rounded up to a whole number.
You round sections up, not down, because a partial section still needs a post at its end, and rounding down would stretch the last spacing past the spacing you chose. Common backyard spacing is 1.8 m to 2.4 m (about 6 ft to 8 ft). Shorter spacing makes a stiffer fence with more posts and more holes. Longer spacing uses fewer posts but puts more load and more flex on each rail and picket span.
If your division comes out even, the formula is neat. A 24 m run at 2.4 m spacing gives 10 sections and 11 posts. If it does not come out even, as in the worked example below, you increase the section count by one and then divide the run length by the new section count to get a slightly shorter, even spacing. Even spacing looks better and makes rail cutting simpler, because every rail in that run is the same length.
Corner, end, and gate posts
End posts finish a run against a house, a garage, or an existing fence. Corner posts turn the line. When you total a whole yard, do not double count a shared corner post. Count posts run by run, then look at your sketch and subtract any post you counted twice at a corner where two runs meet.
Treat gate posts as their own decision. A wide or heavy gate can rack a light post over time, so many builders set gate posts deeper, use larger lumber, or brace them differently. Your calculator count tells you how many posts the line needs. Your gate plan tells you which two of those posts need extra attention.
Rails: the horizontal backbone
Two rails or three rails
Rails run horizontally between posts and give pickets something to fasten to. A typical 1.8 m (6 ft) tall privacy fence uses two rails per section, one near the top and one near the bottom. Taller fences, heavier boards, or fences on windy, exposed sites often use three rails per section to reduce bowing between the top and bottom rails.
The rail count is simple:
Rails equals sections multiplied by rails per section.
If a run has 10 sections and two rails per section, you need 20 rails for that run. The rail length you buy should match the actual section spacing, not just the target spacing from your first division. That is why settling the final even spacing first matters. If the final spacing is 2.31 m, a rail has to span 2.31 m between post centres, plus allow for how it attaches to the post face or between posts, depending on your build style.
Rail placement and picket support
Pickets are thin. If the unsupported span between rails is long, pickets can cup, twist, or bow as they dry. Keep the top rail close enough to the picket tops and the bottom rail close enough to the picket bottoms that the ends are supported, but keep the bottom of the fence clear of soil contact where your design calls for a gap at grade. Standing water and soil contact shorten the life of most wood, so the detail at the bottom matters more than an extra board saved on the list.
Pickets: fence pickets per metre explained
The picket formula
This is where most lists go wrong, because people divide the fence length by the picket width and forget the gap.
Effective width per picket equals picket width plus gap width.
Pickets needed equals fence length divided by effective width per picket, rounded up.
All units must match. Work in millimetres or in metres, but do not mix them in one division.
For quick estimating, pickets per metre equals 1 divided by the effective width in metres. If a picket is 140 mm wide and the gap is 10 mm, the effective width is 150 mm, or 0.15 m. One divided by 0.15 is about 6.67 pickets per metre. On a short fence you can count exactly. On a long fence, that per metre figure helps you sanity check the total in seconds.
Privacy versus spaced picket styles
In a privacy fence, the gap may be zero at installation or may even be an overlap in a board on board style. In that case the formula changes. With no gap, effective width equals picket width alone, so you need more pickets for the same length. In a board on board fence, a second layer of boards covers the gaps left by the first layer, so you are counting two layers with different widths, and you should count each layer on its own.
In a spaced picket fence, the gap is part of the look, sometimes as wide as the picket itself. The formula still holds. You just insert the wider gap. Whatever style you choose, remember that wood shrinks as it dries. A tight gap on the day you build may open a little over the first season, and a zero gap fence may show thin sight lines later. Many builders plan for that movement instead of fighting it.
Height, dog ears, and trimming
Picket count tells you how many boards run along the line. It does not tell you the length to buy. Buy pickets at or a little longer than the finished fence height, so you can trim tops level across a run, especially on stepped sections. If you want a dog ear, a flat top, or a shaped top, confirm whether the pickets you are buying already have that profile or whether you will cut it yourself, which adds time and waste.
Footings and concrete for fence posts
One hole per post is the starting point
Unless a post is attached to an existing structure by an approved method, each post needs its own footing hole. So, as a first count:
Footing holes equals total posts.
Depth and diameter depend on soil, frost, fence height, and wind load, and they are set by local practice and local rules, so verify locally. A shallow hole in soft soil will let a tall fence lean. In much of Canada, builders dig below the local frost depth so freezing ground does not lift the post, a problem called frost heave. Your municipality, a local builder, or published guidance can confirm the depth expected where you live.
From holes to concrete volume
If you are setting posts in concrete, the volume for one round hole is:
Volume per hole equals pi multiplied by radius squared, multiplied by depth.
Radius equals hole diameter divided by 2.
Total volume equals volume per hole multiplied by number of holes.
That total, in cubic metres, is the number you take to a concrete calculator to turn into bags. Bag yield is printed on the bag itself and differs by product and bag size, so divide your total volume by the yield stated on the packaging you will actually buy, and round up. Do not rely on a yield from memory for a different product. Some posts are set in compacted gravel instead of concrete, and some soils drain well enough for that approach, while low, wet soils may call for a different detail. The hole count stays the same either way. The fill material is what changes.
Call before you dig. Underground lines are not always where a sketch suggests, and a locate is a standard step across Canada before excavation.
Worked example
This example uses clearly stated assumptions so you can repeat it with your own numbers. Assume one straight, flat run, no gate in this run, and the following:
Fence length: 30 m (about 98 ft 5 in) Target post spacing: 2.4 m (about 8 ft) Rails per section: 2 Picket width: 140 mm Gap between pickets: 10 mm Footing holes: 1 per post Assumed hole size, for volume only: 250 mm diameter (about 10 in) and 900 mm deep (about 36 in). Verify the depth and diameter required locally.
Step 1: sections and posts
Step 1a: Divide length by target spacing. 30 divided by 2.4 equals 12.5 sections.
Step 1b: Round sections up to a whole number. 12.5 rounds up to 13 sections.
Step 1c: Count posts. Posts equals sections plus 1. 13 plus 1 equals 14 posts.
Step 1d: Find the actual even spacing. 30 divided by 13 equals about 2.31 m per section. Every section will be about 2.31 m, which is under the 2.4 m target, so the spacing rule is respected and all rails can be cut the same.
Step 2: rails
Rails equals sections multiplied by rails per section. 13 multiplied by 2 equals 26 rails. Each rail must span the actual section, about 2.31 m, plus whatever your attachment detail requires.
Step 3: pickets
Step 3a: Effective width per picket. 140 mm plus 10 mm equals 150 mm. 150 mm equals 0.15 m.
Step 3b: Pickets per metre, as a check. 1 divided by 0.15 equals about 6.67 pickets per metre.
Step 3c: Total pickets. 30 divided by 0.15 equals 200 pickets. Cross check: 6.67 multiplied by 30 equals about 200, which matches.
Step 3d: Optional waste allowance, your choice. If you choose to add 10 percent for damaged boards, cuts, and spares: 200 multiplied by 0.10 equals 20 extra pickets. 200 plus 20 equals 220 pickets to buy. If you choose 5 percent instead, the extra is 10 and the total is 210. The percentage is a planning choice, not a fixed rule.
Step 4: footing holes and concrete volume
Step 4a: Holes. Holes equals posts, at 1 per post, so 14 holes.
Step 4b: Radius. 250 mm diameter divided by 2 equals 125 mm, or 0.125 m.
Step 4c: Volume per hole. Pi is about 3.1416. Radius squared: 0.125 multiplied by 0.125 equals 0.015625 square metres. 3.1416 multiplied by 0.015625 equals about 0.04909. Multiply by depth, 0.9 m: 0.04909 multiplied by 0.9 equals about 0.04418 cubic metres per hole.
Step 4d: Total volume. 0.04418 multiplied by 14 equals about 0.6185 cubic metres in total. To turn this into bags, divide 0.6185 by the yield in cubic metres printed on the bag you will buy, and round up to whole bags. If part of each hole is taken up by the post itself, your supplier or calculator may account for that displacement. The simple cylinder volume above is a conservative starting point that does not subtract the post.
Your list for this run
Posts: 14 Rails: 26 Pickets: 200 before any waste allowance, or 220 with a 10 percent allowance Footing holes: 14 Concrete volume to convert to bags: about 0.62 cubic metres, using the assumed hole size above
Common mistakes that throw a list off
Forgetting the plus 1 post
Dividing length by spacing gives sections, not posts. Every straight run needs one more post than it has sections. Forgetting that plus 1 is the single most common fence counting error.
Mixing units in the picket math
A 140 mm picket is not 140 of anything in metres. Convert first, divide second. If your answer is in the thousands for a backyard fence, a unit slipped.
Counting a corner twice, or not at all
Sketch the whole yard and mark each post once with a dot. Then count dots. A sketch count and a formula count should agree. If they do not, find out why before you shop.
Treating every run like the gate run
Gates sag, swing, and get slammed. Latches, hinges, and a diagonal brace are extra materials that a plain section list will never show. List the gate separately, with its posts, frame lumber, and hardware as their own lines.
FAQ
How many fence posts do I need for 30 metres?
With a target spacing of 2.4 m, a 30 m run needs 13 sections and 14 posts. You get this by dividing 30 by 2.4 to get 12.5, rounding sections up to 13, and adding 1 post. The actual spacing becomes about 2.31 m, which keeps every span at or under your target.
How many pickets do I need per metre?
It depends on picket width plus gap. For a 140 mm picket with a 10 mm gap, the effective width is 0.15 m, so you need about 6.67 pickets per metre. Multiply that figure by your fence length, or divide the length by 0.15 directly, to get the total before any waste allowance.
Should I set fence posts in concrete or gravel?
Both methods are used in Canada. Concrete gives a rigid set and is common where wind load is a concern, while compacted gravel drains well and can make a future post replacement easier. Soil type, drainage, frost depth, fence height, and local practice should drive the choice, so verify locally and follow the detail that suits your soil and your fence design.
How deep should fence post holes be?
Depth depends on your local frost depth, soil, and fence height, and it is set locally, so there is no single Canadian number that fits every yard. The usual goal is to get the bottom of the hole below the depth where ground freezes in your area, to reduce frost heave. Check with your municipality or a local builder before you dig.
How much extra material should I buy for waste?
Many homeowners add about 5 percent to 10 percent for pickets, to cover damaged boards, bad grain, trimming, and a few spares for later repairs. Posts and rails are larger and easier to inspect in store, so allowances there are often smaller. Whatever percentage you choose, apply it on purpose and write it on the list, so you know what was math and what was cushion.
Do I need a permit for a backyard fence?
In many Canadian municipalities a standard backyard fence does not need a building permit, but height limits, pool enclosure rules, corner lot sight lines, and heritage or easement rules can still apply. Pool fences in particular are tightly regulated in many places. Always verify locally with your municipality before you build.
Calculators and next steps
Run your own numbers in the Mississippi Maple fence calculator, then check the supporting work with the other tools:
Fence calculator: https://mississippimaple.ca/tools/fence.html Footings calculator: https://mississippimaple.ca/tools/footings.html Concrete calculator: https://mississippimaple.ca/tools/concrete.html
A good order of work is: sketch and measure, settle post spacing, count posts and rails, count pickets with the gap included, count holes, then convert hole volume into bags using the yield on the bag you will buy. Save the sketch with the numbers on it. If a section changes later, you can redo one run without starting the whole list over.
Sources and figures
Sources and figures note: Post, rail, and picket counts in this guide come from the arithmetic shown in the text, using the stated assumptions. Hole volume uses the standard cylinder volume formula. Bag yields, frost depths, height limits, and permit rules are product specific and local, so they are to be verified from the packaging and from local sources. Guidance sources to consult and verify locally include Natural Resources Canada publications and resources, the Ontario Building Code where it applies to related structures, your municipal bylaws and permit office, and the locate service for underground utilities in your province.
Calculator: Ready to work out your own project? Use the free Fence Calculator for an instant estimate with the method in this guide.
Estimates only, verify before you buy materials. This guide plans quantities and costs; it does not replace local building codes, manufacturer instructions, or professional advice.