Fence Calculator – Posts, Rails & Pickets
Calculate fencing materials needed including posts, rails, and pickets for any yard perimeter. Try this free construction calculator for instant estimates.
How to Calculate Fence Materials
Planning a fence project requires accurate material calculations to avoid costly overages or frustrating shortages. A standard fence consists of three primary components: posts (vertical structural members set in the ground), rails (horizontal supports connecting the posts), and pickets or panels (the vertical boards or pre-assembled sections that form the fence face).
The fundamental formulas for fence material calculation are:
- Posts: (Total Perimeter ÷ Post Spacing) + 1 for each straight run. Add one additional post for each corner and each side of every gate opening.
- Rails: (Total Perimeter ÷ Rail Length) × Number of Rails. Standard rails come in 8-foot lengths; round up each section to account for cuts.
- Pickets: (Total Perimeter × 12) ÷ Picket Width in inches. This gives you the number for a zero-gap privacy fence. For spaced pickets, account for the gap width in your calculation.
This calculator automates the math. Enter your total fence perimeter in linear feet, your desired post spacing, the number of horizontal rails, and the width of your pickets. The calculator returns the total number of posts, rail boards, and pickets needed for your project.
Before ordering materials, always walk the fence line and mark post locations with stakes and string. This reveals terrain changes, obstacles (trees, rocks, utility lines), and property line discrepancies that affect your material count.
Fence Styles and Material Requirements
Different fence styles require different material quantities and configurations. Below is a comparison of the most popular residential fence styles and their material needs per 100 linear feet:
| Fence Style | Height | Rails | Posts (per 100 ft) | Pickets/Panels (per 100 ft) | Concrete Bags |
|---|---|---|---|---|---|
| Privacy (dog-ear) | 6 ft | 3 | 14 | ~343 pickets (3.5") | 14–21 |
| Board-on-Board | 6 ft | 3 | 14 | ~429 pickets (overlap) | 14–21 |
| Shadowbox | 6 ft | 3 | 14 | ~343 pickets (alternating) | 14–21 |
| Picket (classic) | 3–4 ft | 2 | 14 | ~240 pickets (3" + 2" gap) | 7–14 |
| Split Rail | 3–4 ft | 2–3 | 14 | 25–38 rails (no pickets) | 0 (tamped earth) |
| Ranch/Horse | 4–5 ft | 3–4 | 14 | 38–50 rails (no pickets) | 14–21 |
| Vinyl Privacy | 6 ft | 2–3 | 14 | ~17 panels (6 ft wide) | 14–21 |
| Chain Link | 4–6 ft | 1 top rail | 14 | 100 ft mesh roll | 14–21 |
| Horizontal Slat | 6 ft | N/A (pickets are horizontal) | 14 | ~102 boards (6" wide) | 14–21 |
Board-on-board fences use approximately 25% more pickets than standard privacy fences because each picket overlaps the adjacent one by about 1 inch. This creates a fence that looks finished from both sides and provides complete privacy even as the wood shrinks over time.
Pre-assembled fence panels (typically 6 ft wide × 6 ft tall) simplify installation significantly. For panel-based fencing, divide your perimeter by the panel width (usually 6 or 8 feet) and round up. Posts must be set at exactly the panel width apart, so precise layout is critical.
Post Holes, Concrete, and Foundation Requirements
Properly set fence posts are the foundation of a durable fence. Post holes must be sized and filled correctly to prevent leaning, heaving, and rot. Here are the standard requirements:
| Fence Height | Post Length | Burial Depth | Hole Diameter | Concrete per Hole |
|---|---|---|---|---|
| 3 ft (picket) | 5 ft | 18–24 in | 8–10 in | 1/4 bag (50 lb) |
| 4 ft (standard) | 6 ft | 24 in | 10 in | 1/3 bag (50 lb) |
| 5 ft (semi-privacy) | 7 ft | 24–30 in | 10–12 in | 1/2 bag (50 lb) |
| 6 ft (privacy) | 8 ft | 24–30 in | 10–12 in | 1/2–2/3 bag (50 lb) |
| 8 ft (tall privacy) | 12 ft | 36–48 in | 12 in | 1 bag (50 lb) |
The general rule for burial depth is one-third of the total post length. A 6-foot fence uses 8-foot posts with 2 feet buried underground. In frost-prone areas, the post must extend below the frost line to prevent frost heave — this depth ranges from 24 inches in moderate climates to 48+ inches in northern states like Minnesota, Wisconsin, and Maine.
For concrete, the most common approach is dry-set (pour dry quick-set concrete mix into the hole around the post, then add water). This method is faster and easier for DIYers than mixing wet concrete. One 50 lb bag of quick-set concrete fills approximately 1/3 of a 10-inch diameter by 30-inch deep hole. A standard 200 linear foot privacy fence with 26 posts requires approximately 13–18 bags of 50 lb concrete.
Alternative post-setting methods include compacted gravel (better drainage, allows post replacement), post brackets/anchors set in concrete (allows easy post replacement), and driven steel posts (for chain link). In soft or sandy soils, increase hole diameter and concrete volume by 25–50%.
Fence Material Types and Cost Comparison
Choosing the right fence material affects durability, maintenance, appearance, and total project cost. Below is a comprehensive cost comparison for a standard 200-linear-foot fence installation:
| Material | Cost per Linear Foot (installed) | Lifespan | Maintenance |
|---|---|---|---|
| Pressure-Treated Pine | $15–$30 | 15–20 years | Stain/seal every 2–3 years |
| Cedar | $20–$40 | 20–30 years | Optional stain; naturally rot-resistant |
| Redwood | $30–$50 | 25–35 years | Optional stain; premium appearance |
| Vinyl / PVC | $25–$50 | 25–30+ years | Wash with hose; virtually maintenance-free |
| Composite | $25–$45 | 25–30 years | Low; occasional cleaning |
| Chain Link (galvanized) | $10–$25 | 20–30 years | Minimal |
| Chain Link (vinyl-coated) | $15–$30 | 25–35 years | Minimal |
| Wrought Iron / Steel | $25–$60 | 30–50+ years | Repaint every 3–5 years; rust prevention |
| Aluminum | $25–$55 | 30–50 years | Virtually maintenance-free; no rust |
| Bamboo | $12–$25 | 10–15 years | Annual sealing recommended |
For a 200-linear-foot privacy fence in pressure-treated pine (the most common residential choice), expect a total project cost of $3,000–$6,000 for materials only, or $5,000–$10,000 professionally installed. Cedar adds approximately 30–50% to material costs but lasts longer and looks better without staining. Vinyl fencing has the highest upfront cost but the lowest lifetime maintenance cost.
Building Codes, Permits, and Property Lines
Fence construction is regulated by local building codes, zoning ordinances, HOA covenants, and property line laws. Failing to comply can result in fines, forced removal, and neighbor disputes. Key requirements include:
- Height Restrictions: Most municipalities limit front-yard fences to 3–4 feet and side/rear-yard fences to 6 feet. Some jurisdictions allow 8-foot fences with a permit. Pool enclosure fences have specific height requirements (typically 4 feet minimum per IRC and IBC, 5 feet in many jurisdictions).
- Setback Requirements: Fences must typically be set back a minimum distance from the property line (often 0–6 inches). Some jurisdictions require the "good side" (finished face) to face outward toward the neighbor. Check your local code — some areas allow fences directly on the property line with neighbor consent.
- Property Line Survey: Before building a fence, verify your exact property boundaries with a professional survey or by locating existing survey markers. Building on a neighbor's property — even by inches — can result in legal action and forced removal.
- Permits: Many cities require a fence permit for fences over 6 feet tall, or for any fence in a front yard. Permits typically cost $20–$200. Some jurisdictions require permits for all fences regardless of height. Check with your local building or planning department.
- HOA Restrictions: Homeowner associations often impose additional restrictions on fence material, color, style, and height. Some HOAs prohibit certain fence types entirely (e.g., chain link) or require architectural review board approval before installation. Violating HOA covenants can result in fines and mandatory removal.
- Utility Locates: Before digging post holes, call 811 (the national "Call Before You Dig" hotline) at least 48–72 hours before your project. Utility companies will mark underground gas, electric, water, sewer, cable, and phone lines at no charge. Hitting a utility line can cause serious injury, service disruption, and thousands of dollars in repair costs.
- Pool Fencing (IRC P2904, IBC 3109): Fences around swimming pools must be at least 48 inches tall with no openings that allow passage of a 4-inch sphere. Gates must be self-closing and self-latching, with the latch at least 54 inches above grade. These requirements are mandated by the IRC and enforced strictly during inspections.
- Sight Triangle Restrictions: Fences near intersections and driveways must not obstruct driver visibility. Most codes require a clear sight triangle — typically 25–35 feet from the intersection along each street — where fences cannot exceed 30–36 inches in height.
Always notify adjacent property owners before building a fence. Many states have "good neighbor" fence laws that address shared boundary fences, cost sharing, and maintenance responsibilities. In some jurisdictions (California, for example), both property owners are legally required to share the cost of maintaining a boundary fence.
Gate Planning and Hardware
Gates are the most failure-prone component of any fence. Proper planning and heavy-duty hardware are essential for gates that operate smoothly for years:
- Standard pedestrian gate: 3–4 feet wide. Uses two heavy-duty hinges and a thumb latch or lever handle. Total weight: 30–60 lbs.
- Double-width gate: 6–8 feet wide (two 3–4 ft panels). Requires a center drop rod and heavy-duty hinges. Ideal for wheelbarrow and mower access.
- Driveway gate: 10–16 feet wide (two panels). Requires steel posts set in 18-inch diameter concrete footings, heavy-duty strap hinges or ball-bearing hinges, and a manual or automated latch system. Gate posts should be 6×6 minimum (4×4 posts will sag under the weight).
Gate posts experience significantly more stress than line posts. Use posts one size larger than your line posts (6×6 for a fence with 4×4 line posts). Set gate posts 6–12 inches deeper than line posts and use 50% more concrete. For heavy gates (over 75 lbs per panel), use steel-reinforced posts or steel post inserts.
To prevent gate sag, install a diagonal anti-sag brace from the bottom hinge corner to the top latch corner (forming a "Z" pattern with the rails). Use a turnbuckle and cable system for existing gates that have already started to sag.
Budget $50–$150 per gate for hardware (hinges, latch, screws), $100–$300 for a pre-built gate panel, and $200–$500 for a custom-built gate. Automated driveway gates with openers range from $1,500–$5,000 installed.
DIY vs. Professional Fence Installation
Deciding between DIY and professional installation depends on your skill level, available tools, and the scope of the project. Here is an honest comparison:
| Factor | DIY | Professional |
|---|---|---|
| Cost (200 ft privacy fence) | $2,000–$4,000 (materials only) | $5,000–$10,000 (materials + labor) |
| Time | 3–5 weekends | 2–4 days |
| Tools Needed | Post hole digger or auger, level, string line, saw, drill, concrete mixer | All provided |
| Quality | Good (with careful planning) | Professional grade |
| Warranty | Material warranty only | Labor + material warranty (1–5 years typical) |
| Permits | You handle | Contractor typically handles |
DIY fence installation can save 40–60% compared to hiring a contractor. The most physically demanding part is digging post holes — consider renting a two-person gas-powered auger ($50–$100/day) or a skid-steer-mounted auger for large projects. The most technically demanding part is ensuring posts are plumb, level, and aligned in a straight line.
Hire a professional if your property has significant slopes (stepped or racked fencing requires advanced skills), rocky soil (hand digging is impractical), complex gate requirements, or if the fence exceeds 6 feet in height. Also consider hiring a professional if you need the fence completed quickly — a crew of 3–4 can install 100–200 linear feet per day.
Frequently Asked Questions
How many posts do I need for 200 linear feet of fence?
With standard 8-foot post spacing: 200 ÷ 8 = 25 sections + 1 end post = 26 posts minimum. Add one extra post for each corner (typically 4 for a rectangular yard) and two extra posts for each gate opening. For a 200-foot yard with 4 corners and one gate, order 32–34 posts.
How deep should fence posts be set?
The standard rule is to bury 1/3 of the total post length. For a 6-foot fence, use 8-foot posts with 24 inches buried. In frost-prone areas, posts must extend below the frost line — 36 inches in most northern states, up to 48+ inches in extreme cold climates (Minnesota, Maine). Always check your local frost depth requirements.
How do I calculate the perimeter of my yard?
Measure all sides of the area to be fenced and add them together. For a rectangular 50 × 80 ft yard: perimeter = (50 + 80) × 2 = 260 linear feet. Subtract gate openings (typically 3–4 ft for pedestrian gates, 10–16 ft for driveway gates) from the total fencing perimeter, but remember you still need gate posts.
How much does a 200-foot fence cost?
Materials only: pressure-treated pine $2,000–$4,000; cedar $3,000–$6,000; vinyl $4,000–$8,000. Professionally installed: pine $5,000–$10,000; cedar $7,000–$14,000; vinyl $8,000–$16,000. Chain link is the most affordable at $2,000–$5,000 installed. Costs vary significantly by region and material quality.
Do I need a permit to build a fence?
In most jurisdictions, yes — especially for fences over 6 feet tall or fences in front yards. Permit costs range from $20–$200. Even if your jurisdiction does not require a permit, you must still comply with setback requirements, height restrictions, and sight triangle rules. Call your local building department before starting.
How far from the property line should I build my fence?
This varies by jurisdiction. Some areas allow fences directly on the property line; others require 2–6 inches of setback. If you are unsure of your property boundaries, invest in a professional survey ($300–$800) before building. Building even inches onto a neighbor's property can result in legal action and forced removal.
What is the best wood for a fence?
Cedar is the best all-around choice for wood fences — it is naturally rot-resistant, insect-resistant, dimensionally stable, and weathers to an attractive silver-gray patina. Pressure-treated pine is the most affordable and lasts 15–20 years with proper maintenance. Redwood is premium but expensive and increasingly hard to source sustainably.
How long does a wood fence last?
Pressure-treated pine: 15–20 years. Cedar: 20–30 years. Redwood: 25–35 years. These lifespans assume proper installation (posts set in concrete, adequate drainage, ground contact treatment) and maintenance (staining or sealing every 2–3 years for pine, optional for cedar). Posts typically fail first — consider post sleeves or concrete post brackets to extend fence life.
Should I use 4×4 or 6×6 fence posts?
Use 4×4 posts for standard fences up to 6 feet tall with 8-foot post spacing. Use 6×6 posts for fences over 6 feet, gate posts (always), corner posts in high-wind areas, and any application where the post spacing exceeds 8 feet. 6×6 posts are significantly stronger and resist wind loads much better than 4×4s.
How do I build a fence on a slope?
There are two methods: Stepped (each panel is level but offset vertically, creating a stair-step pattern) — this is easier and works best with pre-assembled panels. Racked/Contoured (the fence follows the slope continuously) — this looks better but requires custom-cut pickets and angled rail connections. For slopes greater than 1 foot of rise per 8 feet of run, stepping is recommended.