How to Calculate Fence Materials
The first step in any fence project is determining the total linear feet of fencing you need. Measure each side of the area you want to enclose, then add the measurements together. Subtract the width of any gate openings from this total to get the actual fence line length. Dana Kowalski, a contractor in Pinewood Falls, recommends measuring twice and marking post locations with stakes and string before buying a single board.
Posts: Divide the fence line length by your chosen post spacing (typically 8 feet) and round up to get the number of sections. Add 1 to get the total line posts, since you need a post at each end. Then add 2 posts for every gate opening (one on each side of the gate). For example, a 150-foot fence with 8-foot spacing has 19 sections (150 / 8 = 18.75, rounded up) and needs 20 line posts. With one gate, you need 22 posts total.
Pickets and boards: Convert your fence line length to inches and divide by the effective board width. For a privacy fence with 5.5-inch pickets and no gap, a 150-foot fence line (1,800 inches) needs 1,800 / 5.5 = 328 pickets. For a picket fence with 2.5-inch gaps, the effective width is 8 inches per picket, so you need 1,800 / 8 = 225 pickets. Board-on-board fences use an effective width of 4 inches (5.5 minus 1.5-inch overlap), requiring 1,800 / 4 = 450 boards. The concrete calculator can help you figure out how much concrete you need for setting all those posts.
Rails: Each section between posts needs horizontal rails spanning the gap. Multiply the number of sections by the post spacing to get total rail linear feet, then divide by 8 (for standard 8-foot lumber) to get the number of boards. A 150-foot fence with 3 rails per section needs 19 sections x 8 ft x 3 rails = 456 linear feet, or 57 boards of 8-foot rail lumber.
Post Depth and Sizing Guide
Setting posts to the correct depth is the most important factor in building a fence that lasts. The general rule is to bury one-third of the total post length underground. This means a 6-foot fence needs a 9-foot post with 3 feet below grade. In areas with freeze-thaw cycles, posts should extend below the local frost line to prevent heaving. The table below shows recommended post depths for common fence heights based on guidelines from the American Wood Council.
| Fence Height | Post Length | Burial Depth | Post Size | Concrete (80 lb bags) |
|---|---|---|---|---|
| 3 ft | 5 ft | 2 ft | 4x4 | 1 bag |
| 4 ft | 6 ft | 2 ft | 4x4 | 1 bag |
| 5 ft | 7.5 ft (8 ft) | 2.5 ft | 4x4 | 1 bag |
| 6 ft | 9 ft (10 ft) | 3 ft | 4x4 or 6x6 | 1 to 2 bags |
| 8 ft | 12 ft | 4 ft | 6x6 | 2 bags |
Source: American Wood Council post framing guidelines. Check local building codes for frost line requirements in your area.
Post holes should be about 3 times the width of the post. For a 4x4 post (actual dimension 3.5 inches), dig a hole 10 to 12 inches in diameter. For 6x6 posts (actual 5.5 inches), dig 14 to 16 inches wide. Use pressure-treated posts rated for ground contact (look for the "GC" or "Ground Contact" stamp). Coach Rivera had Dana Kowalski install a 6-foot fence around the school athletic field in Pinewood Falls, and she used 6x6 posts at every corner and gate location for extra strength where stress concentrations are highest.
Fencing Cost by Material Type
Fencing costs vary widely depending on the material, height, and style you choose. The table below shows average installed costs per linear foot for the most common residential fence types, based on national pricing data from HomeAdvisor and contractor estimates. Material-only costs run about 40% to 60% of the installed price if you plan to build the fence yourself.
| Fence Material | Cost per Linear Foot (installed) | Lifespan | Maintenance |
|---|---|---|---|
| Pressure-treated pine | $15 to $35 | 15 to 20 years | Stain/seal every 2 to 3 years |
| Cedar | $20 to $40 | 20 to 30 years | Optional stain, naturally rot-resistant |
| Redwood | $30 to $55 | 25 to 35 years | Optional stain, naturally rot-resistant |
| Vinyl / PVC | $25 to $50 | 25 to 30+ years | Wash with soap and water |
| Composite | $30 to $55 | 25 to 30+ years | Very low, occasional cleaning |
| Chain link | $10 to $25 | 15 to 25 years | Minimal, may rust over time |
| Aluminum | $25 to $55 | 30+ years | Very low, rust-free |
| Wrought iron | $30 to $75 | 50+ years | Repaint every 3 to 5 years to prevent rust |
Source: HomeAdvisor national average pricing (2025 to 2026). Prices vary by region, fence height, and terrain.
For a typical 150-foot, 6-foot-tall privacy fence in pressure-treated pine, expect to pay $2,250 to $5,250 installed. Materials alone run $900 to $2,100. Cedar costs more upfront but lasts longer and does not require staining since the natural oils resist rot and insects. The square footage calculator can help you estimate the total surface area if you plan to stain or paint your fence after installation.
Choosing the Right Fence Style
The three most common wood fence styles each serve different purposes. A privacy fence places boards edge to edge with no gaps, creating a solid visual and wind barrier. This style is the most popular for residential backyards, offering full screening from neighbors and the street. The downside is that solid fences catch more wind, putting extra stress on the posts. In high-wind areas, consider leaving a small gap at the bottom or using post spacing of 6 feet instead of 8.
A picket fence spaces boards 2 to 3 inches apart, creating the classic look associated with front yards and garden borders. Picket fences are typically 3 to 4 feet tall and use less material than privacy fences because of the gaps. They define boundaries and keep pets contained without blocking views or airflow. The open design also means less wind load, so standard 8-foot post spacing works well.
Board-on-board fencing alternates boards on each side of the rails so that each board overlaps the gap behind it by about 1.5 inches. This style looks the same from both sides (no "bad side" facing the neighbor) and allows some air to pass through, reducing wind resistance. The trade-off is material cost: board-on-board uses roughly 30% more pickets than a standard privacy fence. Board-on-board is a popular choice for side-yard fences where both the homeowner and neighbor see the fence daily.
Tips for Building a Strong Fence
Set corner and gate posts first. These are the anchor points of your entire fence. Run a mason's line between them to keep all intermediate posts perfectly aligned. Corner posts should be larger (6x6 instead of 4x4) or braced diagonally, since they bear forces from two directions. Gate posts need extra depth and concrete because the repeated swinging motion of the gate puts constant lateral stress on the post.
Use proper concrete technique for post holes. Set the post in the hole and pour dry concrete mix around it, then add water on top. The mix absorbs moisture from the surrounding soil over the next 24 to 48 hours and forms a solid footing. This method, recommended by Quikrete, is faster than pre-mixing in a wheelbarrow and produces equally strong results. Crown the concrete slightly above grade so water drains away from the post base.
Attach rails correctly. The top rail should sit 6 to 8 inches below the top of the pickets, and the bottom rail should be 6 to 8 inches above the ground. For 3-rail fences, space the middle rail evenly between the other two. Use 3-inch exterior-grade screws or 16d galvanized nails to fasten rails to posts. Each picket gets 2 fasteners per rail (one near each edge), which prevents the board from cupping or twisting as the wood dries.
Order extra pickets. Buy 10% to 15% more pickets and rails than your calculated total. Lumber from the store often includes warped, split, or knotty boards that are not usable. Having extras on hand avoids a second trip and gives you replacement boards for future repairs. Posts should be ordered at the exact calculated count since each one goes into a specific hole.
Check local regulations. Most municipalities require a building permit for fences over 6 feet tall and may regulate maximum height, setback from property lines, and style in front yards. Homeowner association (HOA) rules can be even more restrictive. Always pull the permit before starting a fence job, since a fence built without one may need to be removed or modified at the homeowner's expense.
This calculator provides material estimates for planning purposes. Actual quantities may vary based on terrain, lumber dimensions, and local building codes. Consult a licensed contractor or your local building department for projects that require permits or engineering review.