How to Plan a Fence Layout
Start by locating your property lines. If you do not have a recent survey, check with your county assessor's office or hire a surveyor ($300-700). Most municipalities require fences to be set 2-6 inches inside the property line. Check local zoning ordinances for height restrictions (typically 6 feet in back yards, 4 feet in front yards) and setback requirements. Pull a building permit if required ($25-100) before starting work. Mark the fence line with stakes and mason line, then mark post locations with spray paint at your chosen spacing interval.
Call 811 (underground utility locating service) at least 48 hours before digging. This free service marks gas, electric, water, and communication lines so you do not accidentally dig into them. When planning gates, allow at least 3 feet for a walk gate or 10-12 feet for a vehicle gate. Use our lumber calculator to price out the rail and framing lumber separately from the pickets. For corner posts and gate posts, use larger 6x6 posts instead of the standard 4x4 for added strength.
Fence Cost by Material and Style
Pressure-treated pine is the most economical wood at $3-6 per picket for 6-foot heights. Cedar costs $5-10 per picket but resists rot and insects naturally without chemical treatment. Composite fencing (Trex, Fiberon) runs $25-40 per linear foot installed and lasts 25-50 years with zero maintenance, but the upfront cost is 3-4 times that of wood. Vinyl fencing costs $15-30 per linear foot installed and never needs painting or staining but becomes brittle in extreme cold and can yellow over time.
Chain link fencing is the cheapest option at $5-15 per linear foot installed but offers no privacy. Aluminum fencing costs $15-30 per linear foot and provides an ornamental look with low maintenance. Wrought iron is $20-40 per linear foot for custom work. For a complete backyard privacy fence on a 1/4 acre lot (roughly 300 linear feet), expect to pay $1,800-3,500 for pressure-treated pine (DIY) or $4,500-9,000 professionally installed. When budgeting the full project, a deck calculator helps estimate any adjacent outdoor living spaces.
Fence Post Installation Guide
Dig post holes using a manual post hole digger or gas-powered auger ($50-80/day rental). Holes should be three times the post diameter and deep enough to bury 1/3 of the post height. For a 6-foot fence with 4x4 posts, dig 2 feet deep and 10-12 inches in diameter. Place 6 inches of gravel at the bottom for drainage. Set the post, brace it plumb in both directions, then pour concrete around it. Use fast-setting concrete ($5-7 per bag) if you want to attach rails the same day, or standard concrete ($3-5 per bag) if you can wait 24-48 hours.
When setting posts on a slope, step the fence down the hill rather than racking it. Each section should be level, with the next section starting at a lower height. This means your post heights will vary along the slope. For very steep slopes (more than 1 foot of drop per 8-foot section), consider reducing post spacing to 6 feet to maintain structural integrity. Always slope the concrete crown away from the post at the top of the hole so water runs off rather than pooling against the wood.
Building and Installing Pickets
Attach rails (typically 2x4 lumber) to posts using exterior screws or galvanized nails. Install two rails for fences under 5 feet, three rails for 5-8 foot fences. The top rail should be positioned near the top of the fence, and the bottom rail about 6-8 inches off the ground to prevent rot from soil contact. Use a string line stretched between corner posts to keep the rail height consistent along the entire run. For a cleaner look, install rails on the inside face of the posts (the side facing your property).
Start installing pickets from a corner or end post, using a spacer block to maintain consistent gaps. Check every 5-6 pickets with a level to ensure they are plumb. For dog-ear style pickets, the flat side faces up. For pointed pickets, the decorative top faces outward. Secure each picket with two screws or nails at each rail (4-6 fasteners per picket). Use exterior-grade screws ($5-10 per box of 200) rather than nails for easier replacement of damaged pickets. When staining the fence, use a paint calculator to estimate stain coverage, which typically covers 150-300 sq ft per gallon.
Common Fence Building Mistakes
The most expensive mistake is not setting posts deep enough or without concrete. Shallow posts heave out of the ground during freeze-thaw cycles and lean after the first year. The second mistake is using non-pressure-treated wood for posts. Untreated posts in contact with soil rot within 3-5 years. Even pressure-treated posts should be rated for ground contact (UC4A tag on the lumber). Not using gravel at the bottom of post holes traps water against the wood, accelerating rot by 50-100%.
Spacing posts too far apart (over 8 feet) causes rails to sag under the weight of pickets, creating a wavy fence line that gets worse each year. Not using gravel at the bottom of post holes traps water against the wood, accelerating rot by 50-100%. Use our sand calculator to estimate the gravel needed for post hole drainage.
For related calculations, try the concrete slab to estimate materials for your project.