Construction calculators

Fence Calculator

Updated Nov 12, 2026 By Infinity Calculator Formulas Sources
Rate
Fence Material Type
Wood
Classic & customizable
Vinyl / PVC
Low maintenance
Chain Link
Affordable & durable
Ornamental / Iron
Elegant & strong
Solid Board
Privacy, no gaps
Shadowbox
Board-on-board
Stockade
Pointed tops
Picket Fence
Spaced pickets
Rail Fence
Rails only
Fence Layout & Dimensions
Total linear feet of fence (perimeter or single run).
Extra rails, pickets and chain link fabric for cuts and damaged pieces. Enter 0 for none.
Fence Specifications
Standard: 6-8 ft between posts.
0 = flush. Negative = overlap (shadowbox). Positive = gaps.
About one third of each post goes in the ground, so a 6 ft fence takes a 9 ft post.
Cost Estimates (Optional: adjust unit prices)
Estimated Material Cost
$1,009.18
$6.73 per linear foot
Project Summary
Total Fence Length
150 ft
Total Posts
22
Number of Gates
1
Material Total
$1,009.18
Fence Section Preview
Itemized Bill of Materials
Category Item Qty Unit Unit Price Total
Cost Breakdown
Project Notes

Introduction

Building a fence is a big project, and knowing how much material you need before you start can save you time and money. This Fence Calculator helps you figure out exactly how many posts, rails, and pickets you need based on the size of your fence. Just enter your fence length, height, and a few other details, and the calculator works out the totals. This tool helps you plan a privacy fence, a picket fence, or a ranch-style fence. It also helps you estimate costs so you can set a budget before you head to the lumber yard. Stop wasting materials and start your fencing project the smart way.

How to Use Our Fence Calculator

Enter your fence type, dimensions, and layout details to get a full materials list and cost estimate for your fencing project.

Fence Material Type: Pick the kind of fence you want to build. Choose from wood, vinyl/PVC or chain link. Ornamental and iron fences are not calculated yet. Each type has different styles, costs, and material needs.

Fence Style: Select a style within your chosen material type. For wood, options include solid board, shadowbox, stockade, picket, and rail. Vinyl and chain link each have their own style choices. The style you pick will set default values for spacing and dimensions.

Layout Input Mode: Choose how you want to enter your fence layout. Use Manual Entry to type in numbers directly, Draw on Canvas to sketch your fence line on a grid, or Map View to find your property by address.

Total Fence Length: Enter the total linear feet of fencing you need. This is the full distance your fence will cover, measured along its entire run or perimeter.

Number of Gates: Enter how many gates you want in your fence. Each gate adds extra posts and hardware to your materials list.

Gate Width: Enter the width of each gate in feet. A standard walk-through gate is about 4 feet wide.

Fence Height: Enter how tall you want your fence in feet. Common heights are 4 feet for picket fences and 6 feet for privacy fences. Many cities limit fence height, so check your local rules before you choose.

Post Spacing: Enter the distance between fence posts in feet. The standard range is 6 to 8 feet for wood fences and up to 10 feet for chain link.

Number of Rails: Select how many horizontal rails run between your posts. Most privacy fences use 3 rails, while shorter fences often use 2.

Picket Width: Enter the width of each picket board in inches. Standard pickets are 6-inch boards, which are actually 5 1/2 inches wide.2 Widths vary by fence style.

Picket Spacing: Enter the gap between pickets in inches. Use 0 for flush boards with no gaps, a positive number for spaced pickets, or a negative number for overlapping shadowbox styles.

Post Length: Enter the full length of each post in feet, including the part buried underground. Quikrete's post-setting directions make the hole one third of the post's length deep.5 So a 6-foot fence takes a 9-foot post with 3 feet buried, and the box starts at 9 feet. Lumber comes in 8- to 18-foot lengths in 2-foot steps, so the materials list rounds each post up to the next stock length.2

Cost Estimates: Enter the unit price for each material from your local supplier. A few boxes start with a Do it Best retail price from November 2026: the galvanized gate kit, 5x5 vinyl post caps, chain link top rail, tension wire, tension and brace bands, rail ends and loop caps.3 The concrete box starts at $11.99 for a 50-pound bag of fast-setting mix.4 The rest start empty because their price depends on the size and grade you buy. A line with no price is still listed, and the total covers the priced lines only.

Waste Allowance: Enter the extra percentage of rails, pickets and chain link fabric to buy for cuts and damaged pieces. It starts at 0.

Corners (chain link): Enter the number of corners in a chain link fence. Each corner takes a terminal post with fabric on both sides.

After entering all your details, click Calculate to see a full bill of materials, an itemized cost breakdown, a cost-per-linear-foot estimate, and a visual chart showing where your money goes.

Fence Calculator – Estimate Materials and Costs for Your Fence Project

Building a fence is one of the most common home improvement projects. Whether you want privacy, security, or just a nice border around your yard, knowing how much material you need and what it will cost is the first step. This fence calculator helps you figure out the number of posts, rails, pickets, panels, concrete bags, and hardware you need based on your specific fence type, style, and dimensions. It also gives you an estimated material cost so you can plan your budget before you start.

Types of Fences You Can Calculate

This tool covers three main types of fencing material:

  • Wood fences come in several styles, including solid board (full privacy with no gaps), shadowbox (alternating boards on each side for a finished look from both directions), stockade (solid fences of boards with pointed tops), picket (short spaced boards often used for front yards), and rail fences (horizontal rails with no pickets, common on rural properties). Wood fences are usually built with pressure-treated pine, though cedar and redwood are premium options that resist rot naturally, and this lumber can be purchased by the board foot. Fence posts are often pressure-treated pine.8 It is the heartwood of cedar and redwood that resists decay.2
  • Vinyl (PVC) fences are a low-maintenance alternative to wood. They do not need painting or staining and resist rot, insects, and weather damage. The color runs all the way through the material, though white vinyl may need washing to remove mildew.8 Vinyl fences come as pre-assembled panels that fit between posts. Styles include privacy, semi-privacy, picket, and ranch rail.
  • Chain link fences use steel posts, a top rail, and woven wire mesh (called fabric). You can choose galvanized (standard silver), black vinyl-coated (better looking), or commercial grade (heavier wire for extra strength). Chain link fences require several types of fittings, including tension bars, tension bands, brace bands, rail ends, loop caps, ties and hog rings. Following the Chain Link Fence Manufacturers Institute guide specification for high security chain link fences, the calculator puts tension bands no more than 12 inches apart on each tension bar, a brace band for the top rail and one for the bottom tension wire at each bar, ties every 12 inches on line posts and the top rail, hog rings every 12 inches on the tension wire, and braces and trusses the terminal posts of fences 6 feet and taller.6 It counts a brace rail and truss rod for each side of a terminal post that holds fabric, so a corner post takes two.

Key Measurements You Need

Before using this calculator, measure the total length of your fence line in feet. This is the full distance the fence will cover, sometimes called the linear footage. You also need to know how many gates you want and how wide each gate will be. A standard walk-through gate is about 3 to 4 feet wide, while a driveway gate is usually 10 to 16 feet wide. The calculator subtracts the gate openings from your total fence length when figuring out materials.

How Fence Posts Work

Posts are the backbone of any fence. For wood and vinyl fences, posts are usually spaced 6 to 8 feet apart. For chain link, spacing is typically 10 feet. Each post needs to be set in concrete for stability. A general rule is to bury at least one third of the post, and no less than 2 feet.7 In areas with frost, posts should go at least a few inches below the frost line to prevent heaving.7 Quikrete's directions for its fast-setting mix use a hole about 3 times the post's width, one third of the post's length deep, filled to 3 to 4 inches from the top, and each 50-pound bag yields about 0.375 cubic feet.5 The calculator works out the bags of concrete from those figures, filling to 4 inches from the top. A 4x4 post (3.5 inches wide) buried 3 feet takes about 3.7 bags. Chain link footings follow the Chain Link Fence Manufacturers Institute high security guide specification: at least 24 inches deep plus 3 inches for each foot of fence height over 4 feet, and 4 times the post's width across.6 Gate posts need larger footings than that.6

Understanding Picket Spacing

For wood fences with pickets, the spacing between boards matters a lot. A spacing of zero means the pickets are placed flush against each other with no gaps, which gives full privacy. Positive spacing creates gaps between pickets, like on a traditional picket fence. Negative spacing means the boards overlap, which is how a shadowbox or board-on-board fence is built. Shadowbox fences need more pickets than a solid board fence of the same length because the boards overlap. The calculator places one picket for every picket width minus the overlap you enter, so 5.5-inch pickets with a 1.5-inch overlap take one picket every 4 inches.

Cost Factors to Keep in Mind

The prices shown in this calculator are estimates for materials only. They do not include labor. Lumber prices can change a lot depending on the season and market conditions, so always check with local suppliers for current pricing.

Tips for a Successful Fence Project

Before you build, call 811 (in the United States) to have underground utility lines marked for free.1 State laws require the call 48 to 72 hours before you dig, and you must wait the required time for the lines to be marked.1 Check your local building codes and HOA rules because many areas have height limits, setback requirements, and rules about which side of the fence faces your neighbor. Always buy 5 to 10 percent extra material to account for waste, mistakes, and odd cuts. Enter the extra you plan to buy in the Waste Allowance box and the calculator adds it to the rails, pickets and chain link fabric.


Formulas used

Net Fence Length
L_{\text{fence}} = L_{\text{total}} - (N_{\text{gates}} \times W_{\text{gate}})
Number of Posts (Wood/Vinyl)
N_{\text{posts}} = \left\lceil \frac{L_{\text{fence}}}{S_{\text{post}}} \right\rceil + 1 + 2\,N_{\text{gates}}
Total Pickets (Wood)
N_{\text{pickets}} = \left\lceil \left\lceil \frac{12\,L_{\text{fence}}}{w_{\text{picket}} + s_{\text{gap}}} \right\rceil \times \left(1 + \frac{p_{\text{waste}}}{100}\right) \right\rceil
Total Rail Boards (Wood)
N_{\text{rails}} = \left\lceil \left\lceil \frac{(N_{\text{posts}} - 1 - N_{\text{gates}}) \times R \times S_{\text{post}}}{8} \right\rceil \times \left(1 + \frac{p_{\text{waste}}}{100}\right) \right\rceil
Concrete Bags (Wood and Vinyl) 5
N_{\text{concrete}} = \left\lceil \frac{N_{\text{posts}} \times \left(\frac{\pi (3w_{\text{ft}})^2}{4} - w_{\text{ft}}^2\right) \times \left(d_{\text{ft}} - \frac{1}{3}\right)}{0.375} \right\rceil
Vinyl Panels
N_{\text{panels}} = \left\lceil \frac{L_{\text{fence}}}{W_{\text{panel}}} \right\rceil
Chain Link Fabric (with waste)
L_{\text{fabric}} = \left\lceil L_{\text{fence}} \times \left(1 + \frac{p_{\text{waste}}}{100}\right) \right\rceil
Cost per Linear Foot
C_{\text{per\,ft}} = \frac{\sum_{i} (Q_i \times P_i)}{L_{\text{total}}}

Frequently asked questions

How many fence posts do I need?

Divide your total fence length by your post spacing, then add 1. For example, a 150-foot fence with 8-foot post spacing needs about 20 posts (150 ÷ 8 = 18.75, rounded up to 19, plus 1 = 20). Each gate opening needs a post on each side.7 That adds 2 posts for each gate. Corner posts count as part of your total. For chain link, enter your corners in the Corners box: each one takes a terminal post.

How deep should fence posts be buried?

A common rule is to bury at least one third of the post's total length, and never less than 2 feet.7 For a 6-foot fence, that means a 9-foot post with 3 feet underground. Local codes, soil and wind can call for deeper holes.7 In cold areas, dig at least a few inches below the frost line to stop posts from shifting when the ground freezes and thaws.7

How many bags of concrete do I need per fence post?

It depends on the post and the hole. Quikrete's directions for its fast-setting mix use a hole about 3 times the post's width and one third of the post's length deep, filled to 3 to 4 inches from the top, and each 50-pound bag yields about 0.375 cubic feet.5 Filled to 4 inches from the top, a 4x4 post buried 3 feet takes about 3.7 bags, and the same post buried 2 feet takes about 2.3. The calculator works this out for every post in your fence.

How do I measure my total fence length?

Use a tape measure or a measuring wheel to measure along the exact path where you want the fence to go. Measure the full distance in feet, including all straight runs and turns. Include gate openings in your fence length. The calculator subtracts those automatically based on the number and width of gates you enter.

What is the best post spacing for a wood fence?

Most wood fences use 6 to 8 feet between posts. Eight feet is the most common because standard lumber comes in 8-foot lengths, so rails fit perfectly between posts. If you live in a windy area or want extra strength, use 6-foot spacing instead.

How wide should a fence gate be?

A standard walk-through gate is 3 to 4 feet wide. This is enough for a person or a wheelbarrow. For a driveway gate or equipment access, make the gate 10 to 16 feet wide. You may need a double gate for wider openings.

Is vinyl fencing cheaper than wood fencing?

Prices depend on your area and supplier, so run this calculator for the same fence as wood and as vinyl with your local prices and compare the totals. Vinyl never needs painting, staining, or sealing, which wood does. The color runs all the way through the material, but white vinyl may need washing to remove mildew.8

What is the cheapest type of fence to build?

Prices depend on your area and supplier, so run this calculator for each fence type with your local prices and compare the totals. Chain link does not provide privacy unless you add slats or screening.

How many rails does a fence need?

Most privacy fences that are 6 feet tall use 3 horizontal rails. Shorter fences, like 4-foot picket fences, usually need only 2 rails. Very tall fences (8 feet or more) may need 4 rails to keep the pickets from warping or bowing.

What are terminal posts and line posts in chain link fencing?

Terminal posts are the heavy-duty posts used at corners, ends, and gate openings. They are thicker and stronger because they anchor the chain link fabric. Line posts are the lighter posts spaced evenly between terminal posts. They hold the fabric up but do not bear as much tension.6


Sources

  1. Call Before You Dig! Pipeline and Hazardous Materials Safety Administration. Accessed September 26, 2026.
  2. Senalik CA, Farber B. Wood Handbook: Wood as an Engineering Material (FPL-GTR-282), Chapter 6: Commercial Lumber, Round Timbers, and Ties. USDA Forest Service, Forest Products Laboratory. 2021;Table 6–6. Accessed September 26, 2026.
  3. Chain link, fencing material, gate hardware and fence post listings. Do it Best. Chain link fencing posts and fittings, fencing, gate hardware and fence post category pages; names and prices as listed. Accessed November 6, 2026.
  4. Concrete mix listings. Do it Best. Quikrete Fast-Set 50 Lb. Concrete Mix, price as listed. Accessed November 6, 2026.
  5. QUIKRETE Fast-Setting Concrete Mix, Product No. 1004 (data sheet). The Quikrete Companies, LLC. 2025;Yield (p. 1); Application, Method for Setting Posts (p. 2). Accessed November 6, 2026.
  6. High Security Chain Link Fence and Gates guide specification. Chain Link Fence Manufacturers Institute. 2018;Part 3, Execution: posts and footings, top rail, terminal posts, tension wire, fabric installation. Accessed November 6, 2026.
  7. Building a Fence. Treated Wood. Viance. 2 General Fencing Components; 6 Setting Your Posts. Accessed November 12, 2026.
  8. John W. Worley. Fences for the Farm (Circular 774). CAES Field Report. University of Georgia Cooperative Extension. 2024;Rail Fences; Fence Posts. Accessed November 12, 2026.