Fence orders run short in the same places every time. The post count forgets that corners and gates need posts of their own. The concrete count forgets that a post hole is far wider than the post. The depth forgets the frost line. Each shortfall means a second trip to the lumber yard with half the fence already standing.
Enter the length, corners, gates, height, style, spacing and frost depth. The calculator builds the post count section by section, sizes each hole from the manufacturer’s rules and returns posts, rails, pickets or panels and bags of fast-setting concrete in two bag sizes.
What the calculator does
The fence line is split into equal sections at every corner and gate opening. Each section gets posts at your spacing, rounded up, and each gate opening gets a post on each side. Rails come from the number of bays and the number of rail rows for the style, and pickets or boards from the fence length divided by their spacing on center.
Each hole is sized from the post height and your frost depth: one third of the above-ground height plus 6 inches of gravel, or 6 inches below the frost line if that is deeper. The calculator fills the hole with concrete to 3.5 inches below grade, subtracts the post, applies 10% extra and converts to 50 pound and 60 pound bags. The chart compares post counts at 6, 7 and 8 foot spacing.
Problem: the fence ran out of posts
The textbook formula for posts is the fence length divided by the spacing, plus one. House Digest gives the example of an 80 foot fence with posts every 8 feet: 80 divided by 8 is 10, plus 1 is 11 posts. It adds that posts at 6 to 8 feet apart suit most wooden fences and that gates need extra posts, typically two per gate.
The formula assumes one straight run with no gates. A real fence has corners, and each section between corners rounds up on its own. A 120 foot line with two corners and a 4 foot gate is built from four sections of about 29 feet each, with the gate opening between two of them. Each section rounds up to 4 bays at 8 feet, so the line has 16 bays, and posts equal bays plus one start post plus one extra for the gate, which is 18. The simple formula gives 16.
Problem: the concrete bags ran out halfway
A post hole is not the size of the post. Quikrete says to make the hole three times the width of the post and to dig it to one third to one half of the above-ground length plus 6 inches, then add 6 inches of gravel at the bottom and fill with fast-setting concrete up to 3 to 4 inches below grade. For a 4×4 post, which measures 3.5 inches across, that is a hole about 10.5 inches wide.
The bag count follows from volume. Quikrete’s data sheet says a 60 pound bag yields approximately 0.45 cubic feet, and Bob Vila puts a 50 pound bag at about 0.375 cubic feet. A 36 inch deep, 10.5 inch wide hole filled from the gravel to 3.5 inches below grade, less the post, takes about 1.1 cubic feet, or three 50 pound bags. That is why the calculator reports 61 fifty pound bags or 51 sixty pound bags for 18 posts. Angi says a hole can need anywhere from one to 10 bags depending on its size, so the post size and depth you enter matter.
Problem: posts set too shallow
The depth rule has two parts. Quikrete’s rule sets the hole at one third to one half of the above-ground height plus 6 inches. Long Fence adds that the bottom should sit at least 6 inches below the frost line, and Bob Vila notes that local codes may require a minimum depth such as 30 inches. The calculator takes the deeper of the one third rule and the frost rule.
| Fence height | One third rule: hole depth | With a 36 inch frost line |
|---|---|---|
| 4 feet | 22 inches | 42 inches |
| 5 feet | 26 inches | 42 inches |
| 6 feet | 30 inches | 42 inches |
| 8 feet | 38 inches | 42 inches |
In cold climates the frost line, not the fence height, sets the hole, and the post you buy must be long enough: 6 feet above ground plus 36 inches buried is a 9 foot post. Ask your building department for the local frost depth; the calculator starts at 30 inches and treats 0 as no frost.
Rails, pickets and panels from simple geometry
Rails run one per bay per row. A picket style uses two rows and a privacy style uses three in the calculator, which are common building choices rather than a code requirement. Pickets come from dividing the fence length in inches by their spacing on center: 1×4 pickets, which measure 3.5 inches wide, with a 2.5 inch gap sit 6 inches apart, and 1×6 boards, which measure 5.5 inches, with a quarter inch gap sit 5.75 inches apart. A 120 foot line needs about 243 boards at 5.75 inches, and 256 with a 5% spare.
Prefabricated panels remove the rail and picket count and fix the spacing at 8 feet, so the panel count equals the bay count. Panels cost more than loose lumber per foot but arrive with the spacing built in.
Gates: where the budget leaks
A gate is a different product from the fence beside it. HomeLight quotes a contractor who says a gate usually costs three to six times more per linear foot than the rest of the fence, and another who multiplies the per-foot fence price by twice the gate opening. On his example of $40 a foot and a 4 foot gate, that rule gives $320. Angi, in a page labeled 2025 data, puts a standard 4 foot gate at $200 to $600.
The calculator assumes a 4 foot opening for a single gate and 8 feet for a double. Change the count rather than the width if your gates differ, and add gate hardware separately.
Before the first hole
- Call 811 a few business days ahead. The service is free and gets buried utility lines marked before you dig, according to 811.
- Confirm the frost depth and any required post depth with the building department.
- Check property lines and permits before setting posts.
- Stake and string the full line, and mark corners and gates so the section lengths are real, not assumed.
- Let concrete cure at least 24 hours before hanging rails, as Long Fence advises.
Reading the result without over-trusting it
Three lines deserve a second look before an order goes in. First, the post count assumes equal sections between corners and gates. If your corners fall at uneven distances, one long section can round up differently, so measure the real sections and run the calculator on the longest straight run if the numbers look close. Second, the concrete count assumes each hole is dug cleanly to the depth shown. Holes in soft soil often end up wider than the auger, and that extra width eats bags quickly. Third, picket and board counts assume a straight, level fence. A fence that steps down a slope is built in raked or stepped sections, and each step adds cut-offs.
None of this makes the calculator unreliable; it makes it a baseline. If the first list is within a few percent of what you buy, the order was right. If the store ticket is far above the calculator, check the spacing, the frost depth and the bag size before suspecting the math.
What these quantities cost
Angi puts wood fences at $10 to $30 per linear foot installed, an average of about $3,220 with a typical range of $1,919 to $4,820, and posts at $10 to $50 each. NerdWallet, updated July 10, 2025, lists picket fence materials at $5 to $30 per linear foot. The two sets of figures measure different things, so the calculator leaves prices to you and counts the items you will actually price at the lumber yard. For installed pricing by material, the fence cost calculator is the better tool, and the estimating guide shows how to turn these quantities into a budget.
For the concrete step, the bags-versus-truck guide explains when bags stop being the cheapest way to pour.
Worked example: a backyard line, a long run and a panel fence
An illustrative example. The numbers are exactly what the calculator shows with the inputs listed.
A 120 foot privacy fence, 6 feet tall, with 1×6 boards, 3 rails per bay, 8 foot spacing, two corners, one single gate and a 30 inch frost depth needs 18 posts and 16 bays. Each hole is 36 inches deep, and the posts are 9 feet long. The order includes 48 rails, 243 boards or 256 with a 5% spare, and 61 fifty pound bags or 51 sixty pound bags of concrete. The simple formula would have counted 16 posts.
A 200 foot picket fence, 4 feet tall, with 6 foot spacing, four corners, one single gate and one double gate and no frost depth needs 38 posts, 35 bays, 70 rails and 376 pickets, or 395 with a spare. Holes are 22 inches deep with 6 foot posts, and concrete is 60 fifty pound bags or 50 sixty pound bags. The simple formula gives 35 posts, so 3 would have been missing.
The same 120 foot line as the first example, built as prefabricated panels that are 8 feet wide and 8 feet tall, needs 16 panels and 18 posts that are 11 feet long, because an 8 foot fence calls for a 38 inch hole. Concrete rises to 65 fifty pound bags or 54 sixty pound bags. The extra height costs posts, depth and concrete before the first panel is hung.
Frequently asked questions
Is a 4x4 post enough for gate posts?
Why does the post count change at corners?
Do the bag counts assume wet mixing?
What if the ground is sloped or rocky?
Can the posts be spaced wider than 8 feet?
Does the calculator include a permit or survey?
Is it worth setting posts in gravel instead of concrete?
Sources
- Quikrete: Setting posts in concrete
- Quikrete: Fast-Setting Concrete Mix data sheet
- Bob Vila: Installing fence posts (2018, modified 2020)
- House Digest: How many fence posts you need (May 2, 2025)
- Long Fence: How deep to dig wood fence posts (October 14, 2024)
Related calculators and guides
- Fence cost calculator: installed price by material
- Wood fence DIY vs professional calculator: what the labor line is worth
- Concrete calculator: volume for slabs and footings
