Learning how to build a wood fence is one of the most rewarding DIY projects a homeowner can take on, and it saves a small fortune over hiring a contractor who often charges $30 to $60 per linear foot installed. Do it yourself and your material cost drops to roughly $12 to $25 per foot. The work is physical but not complicated, and the results last 15 to 20 years when built correctly. The whole job comes down to setting straight, plumb posts and hanging rails and pickets on them. Here is the complete process from string line to final board.
Part of our Decks & Outdoor guide — explore the full guide →
Plan the Layout and Check the Rules
Before you dig, do the homework that saves headaches later. This planning stage is part of how to build a wood fence that too many people skip.
- Call 811 to have underground utilities marked. This is free and required, and hitting a gas line is a nightmare.
- Confirm your property lines, ideally with a survey, and check your setback rules.
- Verify local codes and any HOA restrictions on fence height, usually 6 feet for backyards and 4 feet for front yards.
- Talk to neighbors about shared fence lines before you build.
Skipping the utility locate or building on the wrong line can force you to tear the whole thing out, so treat this step as mandatory.
Gather Materials and Tools
A standard wood privacy fence uses pressure-treated 4×4 posts, 2×4 rails, and pickets, commonly cedar or pressure-treated pine. For a 6-foot privacy fence you will need posts long enough to set 2 feet into the ground, so 8-foot posts. Your tool list:
- Post-hole digger or a rented gas auger for many holes.
- Bags of fast-setting concrete, roughly one to two 50-pound bags per post.
- A level, a string line, stakes, and a tape measure.
- A circular saw, a drill or impact driver, and exterior-rated screws or a nail gun.
Buy 10 to 15 percent extra pickets to account for culls and cuts. Warped or cracked boards are common in any bundle.
Set the Posts First
Everything depends on straight, plumb, evenly spaced posts. Space them 8 feet on center for standard panels, or 6 feet for extra strength in windy areas. Run a taut string line along the fence run to keep every post in a dead-straight line.
- Dig each hole about 2 feet deep and 3 times the post width, roughly 10 to 12 inches across.
- Add a few inches of gravel at the bottom for drainage so the post base does not sit in water.
- Set the post, brace it with stakes, and check plumb on two adjacent faces with your level.
- Pour in fast-setting concrete, add water per the bag, and let it cure. Crown the concrete slightly above grade to shed water.
Let the posts cure at least a few hours, ideally overnight, before hanging anything on them. Rushing this step guarantees leaning posts.
Attach the Rails
With posts set, run the horizontal 2×4 rails between them. A 6-foot fence uses three rails: one about 8 inches from the top, one near the bottom, and one in the middle. Attach them on edge for maximum strength, either butted between posts on metal fence brackets or face-mounted to the posts.
Keep the top rail level using your string line as a reference, and if your yard slopes, step the panels down in even increments rather than following the grade in one continuous ramp. Secure each rail with exterior screws or galvanized nails.
Install the Pickets
Now the fence takes shape. Starting at one end, hang the pickets against the rails, checking the first one for plumb with your level. Use a spacer block to keep consistent gaps, or butt them tight for full privacy.
- Keep pickets 1 to 2 inches off the ground to prevent rot and wicking.
- Check plumb every few boards, since small errors compound across a long run.
- Fasten each picket with two screws or nails per rail.
- Snap a chalk line across the tops afterward and trim to a perfectly straight line if needed.
Finishing Touches
A few final steps make the fence look professional and last longer. Add post caps to shed water off the end grain of the posts, which is where rot starts. Then protect the wood. Let new pressure-treated lumber dry out for several weeks, then apply a quality semi-transparent stain or sealer to block UV and moisture. Cedar can be sealed sooner. This finishing coat is what carries the fence from a decade to two.
Choosing the Right Wood
The wood you pick determines both the cost and how long the fence lasts. Three species dominate residential fencing, each with clear trade-offs.
- Pressure-treated pine: The most affordable and widely available. Treated to resist rot and insects, it lasts 15 to 20 years but can warp as it dries and needs sealing.
- Western red cedar: Naturally rot- and insect-resistant with beautiful grain and stability. Costs more but stays straighter and ages gracefully.
- Redwood: Premium, rot-resistant, and stunning, but expensive and regional.
A common money-saving strategy is pressure-treated posts, which sit in ground contact, paired with cedar rails and pickets above grade. You get rot resistance where it matters most and cedar’s looks where they show.
Dealing With Slopes and Corners
Few yards are perfectly flat, and how you handle a slope defines whether the fence looks intentional or sloppy. There are two approaches. Stepping keeps each panel level and drops it down in even increments as the grade falls, leaving small triangular gaps at the bottom. Racking, or raking, angles the pickets to follow the slope for a continuous top line with no gaps.
Stepping suits picket and panel fences and gives a crisp, formal look on gentle grades. Racking works better on steep or rolling ground and with board-on-board construction. For corners, set a post precisely at each turn and run rails into it from both directions, checking that the corner post is dead plumb since two fence runs depend on it. Take extra care bracing corner and gate posts, which bear the most stress.
Building a Gate That Lasts
The gate is the hardest-working part of any fence and the first thing to sag if built carelessly. Frame it from 2x4s with a diagonal brace running from the bottom hinge corner up to the top latch corner; this brace carries the gate’s weight in compression and prevents droop. Use heavy-duty exterior hinges rated for the gate’s weight, and hang it from a well-braced, plumb post set in extra concrete.
Leave a consistent gap of about half an inch around the gate so it swings freely without binding as the wood moves with the seasons. Add a solid latch and, if you have pets or kids, a self-closing spring hinge. A well-built gate on a solid post will open smoothly for the life of the fence.
Cost and Time Expectations
For materials, budget roughly $12 to $25 per linear foot depending on wood species and picket style, so a 100-foot fence runs $1,200 to $2,500 in materials, versus $3,000 to $6,000 or more installed by a pro. Time-wise, a typical backyard run takes a determined DIYer two to four weekends, with post-setting spread across days for curing. Renting an auger for the digging day is the single best time-saver.
Popular Fence Styles to Consider
Before you build, decide on a style, because it changes the picket layout and material list. The common residential options each serve a different priority.
- Solid privacy: Pickets butted tight for full screening, the go-to for backyards and pool areas.
- Board-on-board: Overlapping pickets on alternating sides that block sightlines even as the wood shrinks, and look finished from both sides.
- Shadowbox: Pickets alternating front and back with gaps, giving privacy plus airflow and a neighbor-friendly identical appearance on both sides.
- Spaced picket: Classic gaps between boards for a decorative front-yard look that still marks the boundary.
Shadowbox and board-on-board styles handle wind better than a solid wall of pickets, which acts like a sail and stresses the posts in a storm. If you live somewhere gusty, a design with some airflow is both more durable and less likely to blow over. Match the style to your goal, whether that is total privacy, curb appeal, or getting along with the neighbors, and lay out your pickets accordingly.
The Bottom Line
Knowing how to build a wood fence puts a major home improvement within reach of any capable homeowner. Plan the layout and call 811 first, set plumb posts in concrete on a straight string line, hang level rails, and install pickets with consistent spacing off the ground. Finish with post caps and a protective stain. Take your time on the posts especially, because straight posts make everything after them easy, and you will have a solid, good-looking fence that stands for two decades.