How the fence calculator works
You describe the fence the way you would walk along it: a stretch of fence, then a gate, then another stretch, and so on. Each part is worked out on its own, then the posts where parts meet are shared.
Sections = length ÷ post spacing, rounded up · Posts = sections + 1
Boards = (length + gap) ÷ (board width + gap), rounded up
Panels = (length − post width) ÷ (panel width + post width), rounded up
Concrete per post = (π × (1.5 × post width)² − post width²) × depth in the ground
Posts are never further apart than the spacing you type, so 50 ft at 8 ft spacing is 7 sections of 7.14 ft, not 6 sections and a short one. Rails go from post to post: each section takes the number of rails you choose, and a section longer than one rail takes two pieces per rail. The extra for waste is added to boards and rails, then rounded up.
Worked example
A 6 ft privacy fence along the back of a yard: 48 ft of fence, a 4 ft gate, then 40 ft of fence, all in a line. Posts at most 8 ft apart, 3 rails of 8 ft per section, 1 × 6 boards (5½ in wide), 4 × 4 posts (3½ in), 5% extra, 50 lb bags of fast-setting concrete.
- Part 1: 48 ÷ 8 = 6 sections → 7 posts. Boards: 576 in ÷ 5.5 = 104.7 → 105. Rails: 6 × 3 = 18.
- Part 2, the gate: 2 posts. Built from the same boards: 48 ÷ 5.5 = 8.7 → 9 boards and 3 rails.
- Part 3: 40 ÷ 8 = 5 sections → 6 posts, 88 boards, 15 rails.
- Posts: 7 + 2 + 6 = 15, less 2 shared where the parts meet = 13 posts, each at least 9 ft long.
- Boards: 202 × 1.05 = 212.1 → 213 boards. Rails: 36 × 1.05 = 37.8 → 38 rails.
- Holes: 3 × 3.5 = 10.5 in across, 36 in of concrete over 6 in of gravel, so 42 in deep.
- Concrete: (π × 5.25² − 3.5²) × 36 = 2,676.2 in³ = 1.55 ft³ a post; × 13 = 20.13 ft³ ÷ 0.375 = 53.7 → 54 bags.
At $22 a post, $7.50 a bag and $45 for the gate kit, those three items come to $286 + $405 + $45 = $736.
The same in metric: 15 m of fence, a 1 m gate and 12 m of fence, 1.8 m high, posts at most 2.4 m apart, 12 cm boards, 10 cm posts. That is 7 + 2 + 6 − 2 = 14 posts, 246 boards with 5% extra, holes 30 cm across, 54.6 L of concrete a post and 66 bags of 25 kg.
Setting the posts
QUIKRETE’s rule of thumb, used here: dig the hole 3 times as wide as the post, set a third of the post’s whole length in the ground (half the height above ground) and put 6 in (15 cm) of gravel in the bottom for drainage. A 6 ft fence on 4 × 4 posts needs 9 ft posts in holes 10½ in across and 42 in deep. QUIKRETE’s web page allows as little as a third of the height above ground (2 ft for a 6 ft fence), and in cold places local code may ask for deeper holes below the frost line, so the depth box lets you type your own. Gate posts carry the gate’s weight: a bigger post and a deeper hole are common. To price the concrete for one odd hole, the concrete calculator has a post hole shape, and the gravel calculator covers a gravel path along the fence.
Local rules decide
This page counts materials. It does not say how high your fence may be, whether you need a permit, or how close to the property line it can stand: cities, counties and home owners’ associations set those rules, and they often differ for front and back yards. Check them before you buy, find your property line, and have buried cables and pipes marked before you dig.
Different countries, different sizes
US lumber is sold by its nominal size: a 4 × 4 post is really 3½ in wide and a 1 × 6 board 5½ in, so type the real sizes. Choose “Metres” to type metres for lengths and centimetres for boards, posts and depth; bags are then 20, 25 or 30 kg, at the same yield per kilogram as the concrete calculator. In the UK, panels are usually 6 ft (1.83 m) wide; in France, 1.8 to 2 m. The words change too: a gate is a portail in French and a portón in Spanish, and this calculator is also in French and Spanish.
Tips before you buy
- Mark the posts first with stakes and a string line, then measure each stretch along the string.
- Buy a few spare boards from the same batch: wood from another load can differ in color and width.
- Add the small parts: post caps, nails or screws, rail brackets and a diagonal brace for each gate you build.
- Need the area of the yard too? The square footage calculator works it out.
Frequently asked questions
How many fence posts do I need?
Divide each straight stretch by the post spacing and round up: that is the number of sections, and the stretch needs one more post than sections. 48 ft at 8 ft spacing is 6 sections and 7 posts. Where two stretches meet at a corner, or a gate meets the fence, they share a post, so take one off for each join. A gate adds its own opening with a post on each side.
How many pickets or privacy boards do I need?
Boards per stretch = (length + gap) ÷ (board width + gap), rounded up. With privacy boards there is no gap: 48 ft (576 in) of 5½ in boards takes 576 ÷ 5.5 = 104.7, so 105 boards. With 3½ in pickets 2½ in apart, 30 ft takes (360 + 2.5) ÷ 6 = 60.4, so 61 pickets. Add 5% or so for split or warped boards.
How deep should fence posts be set?
QUIKRETE’s rule is a third of the post’s whole length in the ground, which is half the height above ground: 3 ft deep for a 6 ft fence, so a 9 ft post (buy 10 ft). Dig 6 in deeper for a gravel base. Where the ground freezes, local code may ask you to go below the frost line; type that depth in “Post depth in the ground”.
How many bags of concrete per fence post?
It depends on the hole. QUIKRETE says to make the hole 3 times as wide as the post. For a 4 × 4 post (3½ in) that is a 10½ in hole; 36 in of concrete around the post is 1.55 ft³, or about 4.1 bags of 50 lb fast-setting mix (0.375 ft³ each). A shallower 18 in setting takes about half that. The calculator adds up all the posts and rounds up once, since a part bag carries over to the next hole.
Pickets, privacy boards or panels: what changes?
Pickets have gaps between them, privacy boards sit side by side, and both are nailed to rails between the posts. Ready-made panels replace the rails and boards: the posts then follow the panel width, and the calculator works out how many panels and posts fill each stretch, allowing for the width of the posts.
Does the calculator work for a fence that goes all the way round?
Yes. Choose “Go all the way round” and the last part shares its post with the first, so a square of four 20 ft sides takes 12 posts rather than 13. Choose “Stand apart” for stretches that do not touch.
Sources
- QUIKRETE, Setting Posts project sheet: hole 3 times the post width, a third of the post length in the ground plus 6 in (150 mm) of gravel
- QUIKRETE, Setting posts in concrete (depth 1/3 to 1/2 of the above-ground length, plus 6 in of gravel)
- QUIKRETE, Fast-Setting Concrete Mix spec data (about 0.375 ft³ per 50 lb bag; two bags set a 4 in post in a 10 in hole 2 ft deep)
Calculations are exact for the measurements you enter. Local rules decide the height, permits and where on your lot a fence may go, and the ground and frost decide how deep posts must be set. This is a material count, not structural or legal advice; have buried lines marked before you dig. Read the full disclaimer and how we check our formulas.