Fence Calculator
Work out the posts, rails and pickets a wood fence needs from its length, including the fencepost error that shorts nearly every first order by one.
Total run. Sum the sides for a yard perimeter.
8 ft is standard; 6 ft holds up better in wind.
2 for fences up to 5 ft tall, 3 for 6 ft privacy.
0 for privacy; 1.5–2.5 in for picket styles.
13 sections need 14 posts — one more than the section count. Counting one post per section is the classic fencepost error, and it shorts every order by exactly one.
What this calculator does
A wood fence is three separate counts that people try to make one: posts, rails and pickets. Each follows its own arithmetic, and the post count in particular contains a trap famous enough to have a name. This calculator runs all three from the fence length and prices the result per linear foot.
The three counts
Posts. Divide the length by the post spacing and round up for the number of sections — then add one, because a run of n sections has n + 1 ends:
sections = ceiling( 100 ft ÷ 8 ft ) = 13
posts = 13 + 1 = 14
Counting a post per section gives 13 and shorts the order by one. This is the fencepost error, and it is common enough in software that programmers named the whole off-by-one bug class after it. The fence version costs a trip to the store; at least the arithmetic is easy to fix.
Rails. Rails multiply by the section count — two per section for fences up to about five feet, three for a six-foot privacy fence. The third rail is not decoration: pickets fastened at only two points cup and twist as they dry.
Pickets. Divide the length in inches by the picket pitch — face width plus gap. A 100-foot privacy fence in 5.5-inch pickets butted tight needs 1,200 ÷ 5.5 = 219 pickets. As with deck boards, enter the actual face width: a nominal 1×6 measures 5.5 inches, and calculating with 6 undercounts by nearly 10%.
Spacing is a wind decision
Eight-foot spacing is standard because rails come in 8 and 16-foot lengths. But a privacy fence is a sail: a 6-foot solid fence takes the full push of every gust, and the posts are all that resists it.
In high-wind areas, drop to six-foot spacing. It costs a few more posts and rails, and it is the difference between a fence that stands straight for twenty years and one that leans after its first real storm. Semi-private styles with picket gaps shed wind and can stay at eight.
Posts are set in concrete, and that is its own estimate
Figure roughly two 50-pound bags per post — the calculator carries the count. Depth matters more than diameter: a third of the above-ground height, and below the frost line, whichever is deeper. In frost country a shallow post heaves a little every winter, which is why old fences lean in such tidy unison.
For larger pours alongside the fence — a gate apron, a patio — the concrete calculator works in cubic yards, and how to calculate concrete covers the bag-versus-truck decision.
What this leaves out
- Gates. A gate is a small carpentry project of its own — a frame, hinges, a latch and usually a beefier post on the hinge side. Price it separately rather than as fence-by-the-foot.
- Fasteners. Exterior screws or ring-shank nails, and they must be rated for treated lumber — ordinary zinc fasteners corrode against modern treatment chemistry.
- Post caps and stain. Untreated cut ends and unsealed tops are where rot starts.
- Slope. A run downhill needs either stepped sections or racked rails, both of which add cuts and waste a few pickets.
- The neighbour question. Confirm the line from your survey, not from the old fence — the existing fence being in the wrong place is common enough that building against it copies the mistake.
Before any hole is dug
Two calls. Your building department (or HOA) for height limits, setbacks and whether a permit applies — front-yard fences especially are regulated almost everywhere. And 811, the national dig-safe line, to have buried utilities marked. It is free, it is usually required by law, and a post hole through a gas service line is the most expensive fence upgrade available.
If the fence is part of a bigger yard project, the sod vs seed calculator handles the lawn inside it and the gravel calculator covers any path along it.
For treated-lumber standards and what the retention numbers on the tag mean, the American Wood Protection Association publishes the specifications US lumber is graded against.
How this is calculated
sections = ceiling( length ÷ post spacing ) posts = sections + 1 rails = sections × rails per section pickets = ceiling( length in inches ÷ (picket width + gap) )
Frequently asked questions
- How far apart should fence posts be?
- Eight feet is the standard for wood privacy fences, matching stock rail lengths. Drop to six feet in high-wind areas or for heavy panels, because the fence's wind resistance is set almost entirely by the posts. Closer spacing costs more posts and buys a straighter, longer-lived fence.
- Why do I need one more post than sections?
- Because a run of n sections has n + 1 boundaries — the ends both need a post. Counting one post per section is the fencepost error, familiar enough to programmers that the bug class is named after it, and it shorts a 100-foot order by exactly one post every time.
- How deep do fence posts go?
- A third of the above-ground height, and below the local frost line, whichever is deeper. A 6-foot privacy fence wants posts at least 2 feet down, set in concrete — roughly two 50-pound bags per post. In frost-heave country, shallow posts are the reason fences lean by year three.
- How many rails does a fence need?
- Two rails carry fences up to about five feet tall. Six-foot privacy fences want three, because pickets fastened at only two points cup and twist as they dry. The rail count multiplies by the section count, so it moves the material bill more than picket choices do.
- Do I need a permit to build a fence?
- Often, and the rules are municipal — height limits, front-yard restrictions, setbacks from the property line, and sometimes HOA approval on top. Confirm the property line with your survey rather than the existing fence, and call 811 before digging any post hole.