Introduction
Linda, a homeowner in Texas, wants to replace 150 feet of old chain-link fence with a cedar privacy fence. She guesses she needs about 20 posts and a bunch of pickets. She buys 20 bags of concrete and 150 pickets. After setting the first 5 posts, she runs out of concrete because her holes are deeper than she planned. She also discovers she needs 200 pickets, not 150, because she forgot to account for the picket width and spacing. A fence calculator would have told her she needed 20 posts, 60 rails, 200 pickets, and 40 bags of concrete in one trip.
Building a fence is a repetitive but precise process. Every section needs the same components: posts, rails, and either pickets or panels. Getting the counts right before you start saves trips to the lumber yard and keeps the project moving. The 2024 IRC governs fence structural requirements in jurisdictions that have adopted it, but fence permits and height limits are typically set by local zoning ordinances, not the building code. Most cities require a permit for fences over 6 or 7 feet tall and have setback requirements from property lines and sidewalks.
What This Calculator Does
This calculator estimates the number of posts, rails, pickets or panels, and concrete bags needed for a fence of any length. It supports four common fence styles: picket (gapped), privacy (butted), pre-built panel, and post-and-rail. It calculates post count based on your specified spacing, picket count based on picket width and gap, and concrete volume based on hole diameter and depth.
Inputs Required
- Fence Length (ft): Total linear feet of fence
- Fence Height (ft): Height of the fence, typically 4, 6, or 8 ft
- Fence Style: Picket, privacy, panel, or post-and-rail
- Post Spacing (ft): Distance between posts, typically 6 or 8 ft
- Post Hole Diameter (in): Typically 10 to 12 inches for 4x4 posts
- Hole Depth (in): Should extend below frost line, typically 24 to 36 in
- Waste Factor (%): Extra pickets for cuts and defects, typically 5%
Outputs Provided
- Posts: Number of 4x4 posts needed
- Rails: Number of 2x4 horizontal rails
- Pickets or Panels: Depending on fence style
- Concrete: 80-lb bags for post setting
- Rail Lumber: Board feet for ordering from a lumber yard
How the Calculation Works
Post count is the fence length divided by post spacing, plus one for the end post. Rail count is the number of sections (posts minus one) multiplied by the number of rails per section (2 for picket, 3 for privacy, 3 for post-and-rail). Picket count is the fence length divided by the combined picket width and gap, multiplied by the number of sections and the waste factor. Concrete volume is calculated per hole using the cylinder formula, then converted to 80-lb bag count.
Posts = ceil(Length / PostSpacing) + 1
Sections = Posts - 1
Rails = Sections x RailsPerSection
Pickets = ceil((SectionLength x 12 / (PicketWidth + Gap)) x Sections x (1 + Waste%))
Concrete Bags = Posts x (pi x (Diameter/2)^2 x Depth) / 0.6
The calculator assumes 4x4 posts, 2x4 rails, and standard picket widths (3.5 inches for picket style, 5.5 inches for privacy style). For privacy fences, pickets are butted together with no gap. For picket fences, the gap equals the picket width, creating an even spacing pattern. Pre-built panel fences use one panel per section, with the panel width matching the post spacing.
How to Use the Calculator
- Measure the total length of your fence line in feet
- Decide on the fence height (4, 6, or 8 ft are common)
- Select your fence style (picket, privacy, panel, or rail)
- Set the post spacing (8 ft is standard for privacy, 6 ft for panels)
- Enter the post hole diameter (10 inches for 4x4 posts is typical)
- Enter the hole depth (check your local frost line, typically 24 to 36 inches)
- Set the waste factor (5% for pickets, 0% for panels)
- Review the post, rail, picket, and concrete counts
For ordering lumber by the board foot, use our Lumber Calculator to convert your rail and post counts. For the concrete, our Concrete Calculator can help you verify the bag count and explore different hole sizes.
Example Calculations
Example 1: 100 ft Privacy Fence with 8 ft Spacing
A homeowner in Georgia is building a 100 ft cedar privacy fence with 6 ft tall posts at 8 ft spacing, using 5.5-inch pickets butted together:
- Posts: ceil(100 / 8) + 1 = 14 posts
- Sections: 13
- Rails (3 per section): 13 x 3 = 39 rails at 8 ft
- Pickets: ceil((8 x 12 / 5.5) x 13 x 1.05) = 240 pickets
- Concrete (10 in x 24 in holes): 14 x 1.09 cu ft / 0.6 = 26 bags
- Rail Lumber: 39 x 8 x 0.667 = 208 board feet
At $3 per picket, $12 per post, $0.80/BF for rails, and $5 per concrete bag, the total material cost is roughly $720 for pickets, $168 for posts, $166 for rails, and $130 for concrete, or about $1,184 total.
Example 2: 200 ft Picket Fence with 6 ft Spacing
A homeowner in Connecticut is building a 200 ft white picket fence with 4 ft tall posts at 6 ft spacing, using 3.5-inch pickets with 3.5-inch gaps:
- Posts: ceil(200 / 6) + 1 = 35 posts
- Sections: 34
- Rails (2 per section): 34 x 2 = 68 rails at 6 ft
- Pickets: ceil((6 x 12 / 7) x 34 x 1.05) = 367 pickets
- Concrete (10 in x 30 in holes): 35 x 1.36 cu ft / 0.6 = 80 bags
At $2 per picket, $10 per post, and $5 per concrete bag, the total is $734 for pickets, $350 for posts, $204 for rails, and $400 for concrete, or about $1,688 total.
Real-World Scenarios
Backyard Privacy Fence with Gate
Mark is building a 180 ft cedar privacy fence around his backyard in Oregon, with a 4 ft wide gate. He subtracts the gate width: 176 ft of fence at 8 ft post spacing. The calculator shows 23 posts, 66 rails, 342 pickets, and 43 bags of concrete. For the gate, he buys a 4 ft metal gate frame, 2 heavy-duty hinges, a latch, and 20 extra pickets to face the gate. He also buys 2 extra posts for the gate (set in 12-inch holes with 36-inch depth for stability). Total material cost: about $1,800. The project takes him and a friend two weekends to complete.
Property Line Post-and-Rail Fence
A farmer in Vermont is installing a 500 ft three-rail post-and-rail fence along his property line. Posts are spaced 8 ft apart. The calculator shows 63 posts, 186 rails at 8 ft, and 115 bags of concrete. He uses 4x4 pressure-treated posts and 4x4 cedar rails. At $10 per post, $8 per rail, and $5 per bag, the total is $630 for posts, $1,488 for rails, and $575 for concrete, or about $2,693. He skips concrete on half the posts (using tamped gravel instead in well-drained soil) and saves $285.
Replacing Pickets on Existing Posts
Susan has a 120 ft fence with sound posts but weathered pickets. The posts are at 8 ft spacing, so there are 16 sections. She needs 312 new pickets at 5.5 inches butted, plus 48 new rails (3 per section) since the old rails are also splitting. She does not need concrete because the posts are solid. At $3 per picket and $6 per 2x4x8 rail, the material cost is $936 for pickets and $288 for rails, or $1,224 total. She reuses the old screws and hardware, saving about $50.
Common Mistakes to Avoid
- Not calling 811 before digging: Underground utility lines can be anywhere. Calling 811 (the national Call Before You Dig hotline) is free and required by law in most states. Hitting a gas line or power line can be fatal and expensive.
- Shallow post holes: Posts set above the frost line will heave during freeze-thaw cycles, causing the fence to lean. In cold climates, holes should be 36 to 48 inches deep. In warm climates, 24 inches may suffice. Check your local frost depth.
- Inconsistent post spacing: If your post spacing varies, pre-cut rails and pickets will not fit. Measure carefully and adjust the last section to fit rather than letting spacing drift. Use a string line to keep posts aligned.
- Forgetting property line setbacks: Most zoning ordinances require fences to be set back 2 to 12 inches from the property line. Some require the finished side to face the neighbor. Check your local zoning office before building.
- Underestimating concrete: A 10-inch hole at 24 inches deep needs about 1.3 cubic feet of concrete, or roughly 2 bags per post. Many DIYers buy one bag per post and come up short. Always calculate the volume, not just one bag per post.
Limitations of This Calculator
This calculator assumes a straight, level fence line. It does not account for corners (which require an extra post), gates, slopes, or changes in fence height. Post hole depth should be based on your local frost line, which varies from 12 inches in southern states to 60 inches in northern states. The calculator uses 4x4 posts and 2x4 rails; if you use 6x6 posts or 2x6 rails, adjust the lumber order accordingly. Concrete estimates assume 80-lb bags of pre-mixed concrete; 60-lb bags cover less volume (about 0.45 cubic feet per bag). This tool does not estimate gates, hardware (hinges, latches, post caps), stain, or sealant.
Authoritative Research and Resources
- AWC DCA 6: Prescriptive Residential Wood Construction Guide - While focused on decks, this American Wood Council guide covers post setting, concrete footing volumes, and wood fastening practices that apply to fence construction.
- Call 811 Before You Dig - The national call-before-you-dig hotline. Calling 811 is free, required by law in most states, and prevents damage to underground utilities. Call at least 72 hours before digging.
- FHWA Frost Depth Maps - The Federal Highway Administration provides frost depth data by region. Use this to determine the minimum post hole depth for your area to prevent frost heave.
For the lumber in your fence project, our Lumber Calculator converts post and rail counts into board feet. For concrete, the Concrete Calculator handles the bag count. If you are also building a deck, try our Deck Calculator.