Fence Calculator
Find how many posts, rails, and boards a wood fence needs, or how many posts and panels for a panel fence, and how many bags of concrete to set the posts. Enter each straight side and each gate, and the calculator places a post at every corner, end, and gate.
- Choose US or Metric, then the Fence type: Boards on rails for pickets or privacy boards nailed to rails, or Panels for ready-made panels set between posts.
- Enter the length of each straight side, measured from the center of the post at one end to the center of the post at the other. Use Add side for each side that meets another at a corner. Where a gate is, enter the fence on each side of it as two sides and use Add gate for the opening between them.
- Check The fence closes into a loop if the fence goes all the way around, so the last side ends at the first post.
- For boards on rails, keep or change the Max post spacing of 8 ft (2.4 m in Metric). For panels, enter the Post spacing from the panel's instructions.
- Enter the actual Post width and, for the post length and the concrete, the Fence height. For boards on rails, enter the actual Board width.
- Leave Hole diameter and Hole depth blank to use the rules of thumb below, or enter the hole you plan to dig.
- Optionally, enter a price for each item to estimate the cost.
Length fields accept whole numbers, decimals, fractions, and mixed
numbers, such as 100, 10.5, 3/4, or
5 1/2. Choose ft + in as the unit to enter a
length such as 16 ft 6 in in two fields.
How to calculate fence materials
Each side gets a post at both ends and posts in between, no farther apart than the max post spacing:
Sections per side = side length ÷ max post spacing, rounded up
Posts = sections of all sides + gates + 1
A gate is an opening between two posts, so it counts as one section. In a fence that closes into a loop, the last post is the first one, so leave out the + 1. Corner posts are shared by the two sides that meet there, which is why the calculator counts each side on its own: three sides of 50, 100, and 50 ft at 8 ft spacing need 7 + 13 + 7 = 27 sections, while 200 ft divided at once gives only 25.
For boards on rails and for panels:
Rails = rails per section × sections
Boards per side = (side length + gap) ÷ (board width + gap), rounded up
Panels = sections
For boards that overlap, the gap is negative: (side length − overlap) ÷ (board width − overlap). Boards run along the rails from one end of a side to the other and cover the posts, so the post width is not taken off.
The 8 ft default follows Millard Lumber's guide to building wood fences, which sets posts about 6 to 8 ft apart, and decks.com, which notes that keeping sections just under 8 ft lets you use 8 ft rails. Set posts closer in windy places or for heavy boards. Whether you divide a side evenly or leave a shorter section at a corner or gate, as Master Halco's PostMaster installation guide suggests, the number of posts is the same.
For panels, Freedom's vinyl fence instructions measure the post spacing as the panel width plus one post width. Use the spacing in your panel's instructions when it gives one. Panel names such as 6x6 are nominal sizes, so measure the actual panel.
Concrete for fence posts
The calculator treats each post hole as a cylinder filled with concrete around a square post:
Concrete per hole = (π × hole diameter² ÷ 4 − post width²) × hole depth
Bags = concrete per hole × posts × (1 + waste % ÷ 100) ÷ yield per bag, rounded up
If you leave the hole size blank, the calculator uses:
- Hole diameter = 3 × post width. Both Quikrete's Fast-Setting Concrete Mix data sheet and Jacksons Fencing suggest a hole about three times as wide as the post. Vinyl fence instructions often call for smaller holes, such as 8 in for a 4x4 post, so enter the size your fence's instructions give.
- Hole depth = half the fence height. Quikrete's data sheet buries 1/3 of the post's length, which leaves 2/3 above the ground, so the hole is half as deep as the fence is tall: 36 in for a 6 ft fence and 900 mm for a 1.8 m fence. This is the deep end of the advice: Jacksons Fencing digs 600 mm for most garden fences, and decks.com gives 1/3 to 1/2 of the height above the ground. Codes where the ground freezes can require deeper holes, so enter your own depth if it differs.
The hole depth is measured to the bottom of the post. Quikrete, UFP, and Freedom all put about 6 in of gravel under the post, so dig that much deeper. Post length = fence height + hole depth.
Fast-setting mix for posts comes in the same bag sizes as regular concrete mix: Quikrete's data sheet gives about 0.375 ft³ for a 50 lb bag and 0.45 ft³ for a 60 lb bag, the same yields as the Concrete Calculator uses. For a size that is not listed, such as the 25 kg bag sold in Canada (about 11.6 L), enter its yield as a custom bag. Yields differ between products, so check the label on the bag you buy. The 10% waste allowance follows Sakrete's advice for bagged concrete and covers holes that come out wider than planned. It applies to the concrete only.
Examples
A 100 ft privacy fence
One straight side of 100 ft with posts at most 8 ft apart needs 100 ÷ 8 = 12.5, rounded up to 13 sections, so 14 posts. With 3 rails per section, that is 39 rails, and boards 5 1/2 in wide need 1,200 ÷ 5.5 = 218.18, rounded up to 219 boards. For a 6 ft fence, the holes are 10 1/2 in across and 36 in deep, the posts are 9 ft long, and the 14 holes take 23.85 ft³ of concrete with 10% added, or 64 bags of 50 lb mix.
A yard with a gate
Sides of 50, 100, and 30 ft, a 4 ft gate, and a last side of 16 ft need 7 + 13 + 4 + 2 = 26 sections. Adding 1 for the gate and 1 for the end of the fence makes 28 posts, with 78 rails and 430 boards for the 196 ft of fence.
Metric panels
Panels 1.83 m wide on 100 mm posts are spaced 1.93 m apart. A 20 m side needs 20 ÷ 1.93 = 10.36, rounded up to 11 panels and 12 posts. For a 1.8 m fence, the holes are 300 mm across and 900 mm deep, and they take 0.72 m³ of concrete with 10% added, which is 52 bags of 30 kg or 78 bags of 20 kg.
FAQ
For a 100 ft fence with posts at most 8 ft apart, 14. Divide each side by the spacing and round up, add the sections of all sides and the gates, then add 1 for a fence with two ends.
Usually 6 to 8 ft for a wood fence, center to center. For a panel fence, use the panel's actual width plus one post width, or the spacing in the panel's instructions.
About half the fence height, so a third of the post is buried: 36 in for a 6 ft fence, plus about 6 in of gravel under the post. Where the ground freezes, local codes may require deeper holes.
About 1.55 ft³ for a 4x4 post in a hole 10 1/2 in across and 36 in deep. That is a little over four 50 lb bags of fast-setting mix, at about 0.375 ft³ each, before the waste allowance.
Related calculators
- Concrete Calculator
Concrete volume and how many bags of concrete mix to buy.
- Deck Calculator
How many deck boards, joists, and screws to buy for a deck, with the cost.
- Deck and Fence Stain Calculator
How much stain and how many cans to buy for a deck, railings, stairs, or fence, by wood surface and coats.
- Chain Link Fence Calculator
How many terminal and line posts, top rails, fabric rolls, fittings, and bags of concrete to buy for a chain link fence.
- Stair Calculator
Number of steps, riser height, tread depth, and stringer length for a straight stair.
- Framing Calculator
How many studs and plates to buy for wood-framed walls, with corners, openings, and the cost.