Skip to content
RoofElm

Yard

Fence repair or replacement: start at the posts

How to count a fence run, why posts decide how long it lasts, what to settle before digging, and the rules that apply around a pool.

By RoofElm Editorial Team Updated 7 min read

Posts in a straight run
Sections plus one
Before digging post holes
Call 811
Pool fence height (CPSC)
At least 48 inches
Pool fence gaps (CPSC)
Under a 4-inch sphere
Illustration: a fence run in plan and elevation with posts, rails, a gate, a property line and a setback arrow
A fence run: posts, sections, the gate and the property line.

In short

A fence is only as sound as its posts. If the posts are firm and only boards or panels are broken, repair is usually enough. If the posts are rotted, leaning or heaved, replacing the run is the honest fix. A straight run needs one more post than it has sections, and before any hole is dug you call 811. Setbacks, height limits, permits and frost depth come from your city or county and your neighborhood association, not from this page. A fence around a pool follows stricter safety guidelines, and your locality may make them law.

Repair or replace: look at the posts

Walk the fence and push each post. A post that is solid at the ground and has a broken board or a loose rail is a repair. A post that is soft at the base, split or leaning is not, because the fence hangs on it.

  • Repair: firm posts with a few broken or loose boards, panels or rails.
  • Replace some posts: a few posts rotted or heaved while the rest is sound.
  • Replace the run: most posts soft or leaning, or the fence is no longer where your property line says it should be.

If a fence is old and you are not sure how much of it is worth saving, ask a fence contractor to price both a repair and a replacement on the same scope. See the estimate reading guide.

Counting posts and sections

Fence jobs are sized by the linear foot of run and the post spacing. Divide the run by the spacing and round up to get the sections. A straight run has one more post than it has sections. Gates, corners and ends need extra posts, and gate posts often need to be heavier.

Worked example: a 100 foot straight run
Post spacingSectionsPosts
8 feet100 ÷ 8 = 12.5, rounds up to 1314
6 feet100 ÷ 6 = 16.7, rounds up to 1718

Use the fence section of the yard and concrete calculator for your own run, then add the corner and gate posts by hand. Compare the post count in a bid to your own number. Closer spacing costs more in posts and holes, and the bid should say the spacing and the post size.

Post depth, frost and concrete

A University of Wisconsin Extension guide to setting posts says the deeper a post goes into the ground, the better. It was written for livestock fence, and it says that for a 40 to 48 inch fence it would be great if posts could be buried 4 feet, which in most northern climates usually gets the bottom of the post below the frost line. It warns that freezing and thawing of silt and clay soils can push a post out of the ground.

The same guide says to tamp the backfill as you go, using a pry bar rather than a shovel handle to concentrate force. In silt or clay it suggests bringing in sand and gravel for backfill. It cautions against a collar of cement at the top of the hole, which can help heave a post out. It also says to use good treated posts, since cement can hold moisture near the top of a post and speed rot.

Before the first hole: lines, 811 and permits

  1. Find your property line. A recorded survey or the boundary pins show it. A fence on the wrong side of the line can be a dispute with a neighbor.
  2. Call 811 or your state 811 center a few business days before digging. The national 811 site says state laws vary on the waiting period, and to dig carefully around the marks, not on them.
  3. Ask your city or county whether the fence needs a permit, what height limit applies and how far it must sit from the property line, the street and any easement. These rules vary by locality.
  4. If you have a homeowners association, ask for its fence rules before you pick a style or a color.
  5. Tell the neighbor. A fence that borders their yard is easier to build with their agreement.

See permits and inspections for how an inspection works. Easements, setbacks and height limits can all differ between the front yard, the side yard and the back yard, so ask about each.

Fences around a pool

The U.S. Consumer Product Safety Commission publishes safety barrier guidelines for home pools. They are guidelines, not a federal standard, and the commission says some states and localities have built them into their building codes, so check with your local authority. Among the guideline figures, the top of the barrier should be at least 48 inches above grade, and 5 feet or higher is preferable. The bottom clearance should be no more than 4 inches above the ground, or 2 inches on grass or gravel. No opening should let a 4-inch sphere pass.

Gates matter as much as the panels. The guidelines say pedestrian gates should open outward, away from the pool, and be self-closing and self-latching, with a locking device on every gate. They also say to eliminate handholds and footholds a child could climb, and to place the barrier so a child cannot use nearby structures or equipment to climb it. Some localities require more than the guidelines, such as 60 inches, so the local rule wins.

What to ask before you sign

  1. Ask the contractor to write in the bid the linear feet, the post spacing, the post material and size, the post depth and the rail and picket or panel material.
  2. Ask who checks the property line, who calls 811 and who pulls any permit. Put the ticket number and the permit in the contract.
  3. Ask what happens to the old fence and whether hauling is in the price.
  4. Ask for a certificate of insurance sent by the insurer and the workmanship warranty in writing. See the contractor hiring guide.
  5. Hold the final payment until the work is finished and the permit, if any, is signed off. See contracts, warranties and lien waivers.

Length and height

Linear feet and fence height set the material and the number of posts.

Material

Wood, vinyl, metal and chain link differ in price, upkeep and how long they last.

Ground and gates

Slopes, rock, tree roots, old fence removal and gate hardware add work.

Replacing a few boards or a gate hinge is a reasonable DIY job. Setting posts in a long run, around a pool or near a property line is easier to get right with a crew that knows the local rules. Landscaping around the new fence is in landscaping.

Common questions

How many posts do I need for a fence?

Divide the run by the post spacing, round up for the sections, then add one. A 100 foot straight run at 8 foot spacing has 13 sections and 14 posts, plus extra posts at gates and corners.

How deep should fence posts be?

It depends on frost depth and soil where you live. One University of Wisconsin Extension guide for livestock fence says 4 feet is a great target for a 40 to 48 inch fence and usually clears frost in northern climates. Ask your building office for the local rule.

Do I need a permit for a fence?

It depends on where you live. Cities and counties set their own rules on permits, height and setbacks, and a homeowners association can add more, so ask your building office and your association before you build.

How tall must a pool fence be?

The CPSC guidelines say at least 48 inches above grade, with 5 feet or higher preferable, and some localities require 60 inches. The guidelines are not federal law, so follow your local code.

Sources

Facts checked on November 19, 2026 against the pages above. The post-depth guide was written for livestock fence. Frost depth, setbacks, height limits, permits and pool-barrier rules vary by city and county: confirm with your building office.