Fence Calculator
Ready to buy? Search for fence materials:
A wood fence is four counts โ posts, rails, pickets and the concrete that holds the posts โ and each comes off the run length in feet and a few choices about height and style. This calculator works out all four for every section you add and totals them.
Posts divide the run into sections at your chosen spacing; rails span each section; pickets fill the face; and concrete sets the posts. Because a fence is a line rather than an area, the arithmetic is mostly division and rounding up โ you cannot buy most of a post.
A single 50 ft run of 6 ft privacy fence, posts at 8 ft, 5.5 in pickets, no gates:
Switch the style to a 2-inch spaced picket and each picket now occupies 7.5 in instead of 5.5, dropping the picket count from 110 to about 80 โ the same run, fewer boards, more gap.
Post length and depth. The tool sizes each post at about 1.33 times the fence height, so a 6 ft fence gets an 8 ft post with about 2 ft below grade. That follows the common fence-building rule of burying roughly one-third of the fence's above-ground height. The binding requirement, though, is depth: a post footing must reach below your local frost line, or freeze-thaw will heave it. In cold regions that frost depth โ often 24 to 42 inches โ governs, and you set the post to it regardless of the rule of thumb. Check your local frost depth with the building department.
Ground-contact treatment. A post sitting in soil and concrete stays damp, so it must be pressure-treated lumber rated for ground contact โ Use Category UC4A ("ground contact, general use") or higher under the AWPA U1 Use Category System, the standard treated wood is labeled against. Above-grade rails and pickets can be a lighter UC3 treatment, but the posts should never be less than UC4A, and cut ends buried in the ground should be field-treated.
Picket spacing. The picket count is the run in inches divided by the space each picket takes up โ its own width plus the gap you leave beside it. A privacy fence uses no gap, so 5.5 in pickets sit every 5.5 in; a spaced-picket fence adds the gap to the pitch and uses fewer boards. Widen the picket or the gap and the count falls in direct proportion.
How deep should fence posts be set?
Deep enough to resist wind and to sit below your local frost line so the ground cannot heave them. A common rule is to bury about one-third of the fence's above-ground height, so a 6-foot fence uses an 8-foot post set about 2 feet deep. In cold climates the frost line, often 24 to 42 inches, can require going deeper than the rule of thumb.
How many fence posts do I need?
One post per section at your chosen spacing, plus one to finish the last run, so a 50-foot line at 8-foot spacing takes about 8 posts, and each gate adds two. Closer spacing makes a stiffer fence but uses more posts and concrete.
What kind of lumber should fence posts be?
Pressure-treated wood rated for ground contact, Use Category UC4A or higher under the AWPA U1 system. Posts stay damp in soil and concrete, so a lighter above-ground treatment will rot early. Use galvanized or stainless fasteners with treated lumber, since the preservative corrodes plain steel.
This is a materials estimate for a straight, level run of wood fence. It does not design for wind load or soft soil, size gate hardware, follow a slope, or check your property line. Fence height, setback and even style are often restricted by local code or an HOA, and the posts must sit below the frost line โ confirm all of that, and call 811 to locate utilities, before you dig.
Ground-contact lumber should be rated to Use Category UC4A ("ground contact, general use") or higher under the American Wood Protection Association's U1 Use Category System, the standard pressure-treated wood is graded and labeled against. Post depth is governed by your local frost line, which the building code requires footings to reach below; the "bury one-third of the height" figure is conventional fence-building practice, not a fixed code number, and the frost-depth requirement overrides it. Post, rail and picket counts are geometry from the run length and your spacing choices. More on post setting and long-lasting fences is in our landscaping guide.