Fence Calculator
Calculate posts, rails, and pickets for your fence — enter length, post spacing, and picket dimensions.
Fence Length
Enter your fence dimensions and click Calculate.
How Does the Formula Work?
The fence calculator determines the number of posts, rails, and pickets needed for a straight fence run. The key formula starts with posts: divide the total fence length by the desired post spacing and add one for the starting post.
Sections = Posts − 1
Rails = Sections × Rails per Section
Pickets = ⌈Fence Length ÷ (Picket Width + Gap)⌉
Standard post spacing in the US is 8 feet (2.4 m). Most privacy fences use 2 horizontal rails; fences taller than 6 ft often need 3. Picket width varies: standard dog-ear boards are 3.5 inches (9 cm) with typical gaps of 1.75 inches (4.5 cm) for semi-privacy or zero gap for full privacy.
Material Planning Tips
Posts should be pressure-treated or cedar and set 2 feet (60 cm) deep in concrete. Each post hole needs about 1–2 bags of pre-mixed concrete. Rails are typically 2×4 lumber cut to match the section width. Add 10% extra pickets for cuts and defects.
Fence Types and Materials
The most popular residential fence materials in the United States are wood, vinyl, chain link, aluminum, and composite. Pressure-treated pine is the most affordable wood option at $3–$7 per linear foot for materials, lasting 15–20 years with proper maintenance. Cedar costs $8–$15 per linear foot and naturally resists rot and insects without chemical treatment. Redwood is premium at $15–$25 per linear foot. Vinyl (PVC) fencing from brands like ActiveYards, Bufftech (CertainTeed), and Freedom (Lowe's exclusive) costs $15–$30 per linear foot but requires virtually no maintenance and carries a lifetime warranty. Chain link is the most economical at $5–$15 per linear foot installed and is ideal for property boundaries where aesthetics are secondary. Aluminum ornamental fencing costs $20–$35 per linear foot and mimics the look of wrought iron without rusting.
Post Spacing and Structural Integrity
Post spacing is the most critical structural decision in fence building. The industry standard for wood privacy fences is 8 feet on center — meaning posts are spaced 8 feet apart from center to center. This spacing works with standard 8-foot rails and keeps the fence rigid in normal wind conditions. In high-wind areas (coastal regions, open plains, hilltops), reduce spacing to 6 feet for additional strength. Vinyl fence systems typically use 6-foot or 8-foot panel widths dictated by the manufacturer. Corner posts and gate posts must be set deeper and often require a larger diameter. Posts should be buried at least one-third of their total length — for a 6-foot fence, use 9-foot posts set 3 feet deep in concrete footings.
Calculating Materials
This calculator determines the number of posts, rails, and pickets you need based on total fence length, post spacing, rails per section, and picket dimensions. Posts equal the total length divided by post spacing, plus one (for the end post). Rails equal the number of sections multiplied by rails per section — standard privacy fences use 2 or 3 rails. Pickets per section depend on picket width plus gap width divided into the section width. A typical 6-foot privacy fence with 3.5-inch pickets and 1.75-inch gaps uses about 13 pickets per 8-foot section. For a 100-foot fence run, that is 14 posts, 26–39 rails, and approximately 163 pickets.
Gate Planning
Every fence needs at least one gate. Standard pedestrian gates are 36 to 42 inches wide. Double gates for vehicle access are 10 to 16 feet wide. Gate posts bear extra weight and stress from swinging, so they should be 4×6 or 6×6 lumber (versus 4×4 for line posts) set in concrete footings at least 36 inches deep. Heavy-duty gate hardware — self-closing hinges, drop rods for double gates, and magnetic latches — costs $30–$80 per gate. Plan gate locations before finalizing your fence layout, as gates require different post spacing and hardware that affect the total material count.
Permits and Property Lines
Most US municipalities require a building permit for fences over 6 feet tall, and some require permits for any fence. Check your local building department before starting. Homeowner associations (HOAs) often have strict rules about fence height, style, material, and color. Property line surveys cost $300–$700 but prevent expensive disputes with neighbors — a fence built even 6 inches over the property line may need to be removed at your expense. Many jurisdictions require the "good side" (finished face) to face outward toward the neighbor. Setback requirements typically mandate that fences be 2–6 inches inside the property line rather than directly on it.
Cost Estimation
A complete 150-linear-foot wood privacy fence (6 feet tall, pressure-treated pine) costs approximately $2,500–$4,500 for materials and $4,000–$7,500 installed professionally. Materials breakdown: 20 posts ($8–$15 each = $160–$300), 40 rails ($4–$8 each = $160–$320), 245 pickets ($1.50–$3 each = $370–$735), concrete for post footings ($150–$200), hardware and screws ($100–$150). Professional labor adds $15–$25 per linear foot. Cedar increases material costs by 40–60 percent. Vinyl fencing for the same length runs $3,500–$6,000 for materials with professional installation adding $2,000–$4,000. This calculator helps you determine the exact material quantities so you can get accurate quotes from local suppliers like Home Depot, Lowe's, or your local lumberyard.
Maintenance and Longevity
Wood fences need staining or sealing every 2–3 years to prevent rot, warping, and UV damage. A gallon of fence stain from Behr, Cabot, or Thompson's WaterSeal costs $25–$40 and covers 150–300 square feet. Pressure-treated pine lasts 15–20 years with regular maintenance; cedar lasts 20–30 years. Vinyl fencing requires only occasional washing with a garden hose and mild soap — no painting, staining, or sealing ever. Metal fences should be inspected annually for rust spots, which can be sanded and touched up with rust-inhibiting spray paint.
Tips & Recommendations
Standard post spacing is 8 ft (2.4 m). Closer spacing adds strength for windy areas; wider saves material but reduces rigidity.
Boards split, warp, and have knots. Buy 10% more than calculated to account for waste and defects.
Fences over 6 ft (1.8 m) need a third horizontal rail for structural stability and to prevent picket warping.
Each post hole typically needs 1–2 bags (60–80 lb) of pre-mixed concrete. Use the Concrete Calculator for exact amounts.
Frequently Asked Questions
How many posts for a 100 ft fence?
With 8 ft spacing: ceil(100/8)+1 = 14 posts. You need 13 sections of rails and enough pickets to span 100 ft.
What spacing should I use for posts?
8 ft (2.4 m) is standard for most residential fences. Use 6 ft for high-wind areas or heavy panel fences.
How many pickets per foot?
With 3.5 in pickets and 1.75 in gaps: about 2.3 pickets per foot. For privacy (no gap): about 3.4 pickets per foot.
Do I need 2 or 3 rails?
2 rails for fences under 6 ft. 3 rails for fences 6 ft and taller to prevent sagging and warping.
Should I buy extra materials? Yes, always purchase 10% more pickets than calculated to cover splits, knots, and cutting waste. Add 1-2 extra posts for gate supports and corner reinforcement
Yes. Add 10% extra pickets for waste, 1–2 extra posts for gate supports, and extra rails for angled sections.
Recent Calculations
No calculations yet