Skip to main content
FigureCalc

Fence Calculator

By Uzair Arshad , Senior Civil and Structural Engineer

Last updated: April 27, 2026

Use this fence calculator to estimate materials for your next wood fence project. Enter fence length, post spacing, height, and picket size to get a complete material list with posts, rails, pickets, concrete bags, fasteners, and an estimated cost range.

8 ft is standard for most wood fences

Use 3 for fences 6 ft or taller, 2 for shorter fences

Standard fence board is 5.5 in (nominal 6 in)

0 for privacy, 1.5 to 3 in for spaced picket, 1 to 1.5 in overlap for board on board

Combined width of all gate openings

Rule of thumb: 3× the post width (4-in post = 12-in hole)

36 in is standard. Check local frost line requirements.

How to use this calculator

This free fence calculator estimates every material you need for a wood fence project: posts, rails, pickets, concrete bags, and fasteners. Enter your fence dimensions below to get a complete takeoff with waste-adjusted quantities.

  1. Select your fence style at the top. Privacy fences use 0-inch picket spacing. Spaced picket fences use 1.5 to 3 inches between boards. Board on board fences overlap pickets on alternating sides.
  2. Enter your total fence length in feet. Measure each straight run separately between corners and add them up. A backyard with three sides of fencing at 40 ft, 60 ft, and 40 ft equals 140 linear feet.
  3. Set post spacing. Use 8 ft for most wood privacy fences. Use 6 ft in windy areas or for fences taller than 6 ft. Shorter spacing means more posts but a sturdier fence.
  4. Enter fence height and rails per section. Use 3 rails for fences 6 ft or taller. Two rails work for 4 ft picket fences.
  5. Set picket width and spacing. Standard fence boards are 5.5 inches wide (sold as nominal 6-inch). Use 0-inch spacing for a tight privacy layout.
  6. Add gate count and total gate opening width. The fence calculator subtracts gate openings from picket count but adds 2 extra posts per gate for the frame.
  7. Click "Calculate fence materials" to see your complete material list.

Pro tip: Keep the 10% waste factor for cutoffs, warped boards, and knots. On my last 150 ft privacy fence build, I used 12% waste and still pulled from the spare pile for two replacements within the first year.

Measuring tips for accurate fence estimates

Measure every fence run separately with a tape measure or laser tool. Do not estimate perimeter from your lot size because lot dimensions rarely match the fenceable area after setbacks and property line adjustments. Walk the fence line and flag each post location, especially at corners and gate openings.

Mark gate positions before measuring. A standard single walk gate is 3 to 4 ft wide. A double drive gate for vehicles is 10 to 12 ft wide. Subtract these openings from your total fence length for the picket count, but remember each gate adds 2 extra posts.

Assumptions and limitations

This fence calculator assumes straight fence runs on level ground. Sloped yards need stepped or racked panels, which change post height and picket count. Corners require extra posts not accounted for by the basic spacing formula. Add 1 post per corner turn.

Post depth assumes 36 inches, which meets most building codes above the frost line. In cold climates (USDA zones 3-5), your local code may require 42 to 48 inches. Always check with your building department before digging. Use ground-contact rated (UC4B) pressure-treated posts for any buried wood. Above-ground rated lumber rots within 2 to 3 years when set in concrete.

Cost estimates reflect 2026 national averages for materials plus professional labor ($15 to $30 per linear foot installed). DIY material-only cost runs roughly $5 to $12 per linear foot depending on lumber species and fence height.

Fence style comparison

Style Picket spacing Privacy level Boards per 100 ft
Privacy (dog ear)0 inFull219 boards
Spaced picket2 inLow160 boards
Board on board1.5 in overlapFull300 boards
Shadowbox3.5 in gapPartial267 boards
Split railNo picketsNone0 boards

How the calculation works

Posts and sections:
Adjusted Length = Fence Length − Gate Opening Width
Sections = ceiling(Adjusted Length / Post Spacing)
Posts = Sections + 1 + (Gates × 2)

Rails and pickets:
Rails = Sections × Rails per Section
Pickets = ceiling(Adjusted Length × 12 / (Picket Width + Spacing))

Concrete per post:
Hole Volume = π × (Hole Diameter / 2)² × Post Depth
Post Volume = Post Size² × Post Depth (square post)
Concrete = (Hole Volume − Post Volume) × Post Count

Waste:
With Waste = Base Count × (1 + Waste % / 100)
Fence Length
Total fence length in feet, measured along all runs
Post Spacing
Distance between posts in feet (typically 6 to 8 ft)
Fence Height
Height of the fence above ground in feet
Rails per Section
Number of horizontal rails per section (2 or 3)
Picket Width
Width of each picket or board in inches
Picket Spacing
Gap between pickets in inches (0 for privacy fences)
Gate Opening Width
Total width of all gate openings in feet
Waste %
Extra material for cuts, mistakes, and damaged boards
Post Depth
Buried depth of each post in inches (typically 36 in)
Hole Diameter
Diameter of each post hole in inches (typically 10 in)

This fence calculator uses straightforward geometry to convert your fence dimensions into a material list. Every output comes from the formulas below, so you can verify the math yourself or adjust for special conditions like slopes and corners.

Posts and sections

The calculator first subtracts gate openings from the total fence length. Then it divides the adjusted length by post spacing and rounds up to get sections. Each section gets one post at the start, and you add 1 post at the very end of the fence run. Gates add 2 extra posts each (one on each side of the opening).

Rails

Rails run horizontally between posts. Multiply the number of sections by rails per section. Most 6 ft privacy fences use 3 rails (top, middle, bottom). A 4 ft decorative fence can use 2 rails. Standard 2x4 pressure-treated rails fit an 8 ft section perfectly.

Pickets and boards

Convert the adjusted fence length to inches, then divide by picket width plus spacing. Round up to a whole picket count. For a tight privacy fence with 5.5 in boards and 0 spacing, 100 ft of fence needs ceiling(1,200 / 5.5) = 219 pickets before waste.

Board on board fences place boards on both sides of the rails with overlap. The fence calculator finds the gap between same-side boards using the overlap you enter, then counts boards for each side and doubles the total. With 5.5 in boards and 1.5 in overlap, the same-side gap is 2.5 in, giving 150 boards per side and 300 total for 100 ft.

Concrete for post footings

Each post hole is a cylinder. The calculator finds the hole volume using π × (hole diameter / 2)² × depth, subtracts the post volume (square or round), and multiplies by the number of posts. One 50 lb bag of concrete mix fills about 0.375 cubic feet. A typical 10-inch hole with a 4x4 post at 36 inches deep uses roughly 1 to 2 bags per post.

Worked example: 100 ft privacy fence

Given:

  • Fence length = 100 ft, post spacing = 8 ft, height = 6 ft
  • 3 rails per section, 5.5 in boards, 0 spacing (privacy)
  • 1 gate at 4 ft wide, 10% waste
  • 4x4 square posts, 10 in holes, 36 in depth

Calculations:

  • Adjusted length = 100 − 4 = 96 ft
  • Sections = ceiling(96 / 8) = 12
  • Posts = 12 + 1 + (1 × 2) = 15 posts
  • Rails = 12 × 3 = 36 (with 10% waste = 40 rails)
  • Pickets = ceiling(96 × 12 / 5.5) = ceiling(209.5) = 210 (with 10% waste = 231 pickets)
  • Concrete per post = 0.93 cu ft, total = 13.9 cu ft, bags = 38 bags of 50 lb mix
  • Fasteners = 210 × 3 × 2 = 1,260 screws (with waste = 1,386)
  • Post length = 6 + 3 = 9 ft each
  • Fence area = 96 × 6 = 576 sq ft

Common gotchas

Corners need an extra post that the spacing formula does not add. If your fence turns 3 corners, add 3 posts to the total. Slopes change picket length because stepped panels leave triangular gaps at the bottom. On sloped runs, order 15% extra pickets instead of 10%.

Manufacturer panel widths (like pre-built 8 ft panels) may not divide evenly into your fence length. The last section might be shorter, requiring a custom-cut panel. Check with your lumber yard on whether they stock panels or individual boards for your fence style.

Local building codes often dictate maximum fence height (usually 6 ft for backyards, 4 ft for front yards), setback from property lines (often 2 to 6 inches), and minimum post depth (tied to frost line). Most cities require a permit for fences over 6 ft or within 5 ft of a property line. Check with your building department before starting.

Frequently Asked Questions

How do you calculate linear feet for a fence?

Measure the full fence path in feet, adding each straight run between corners and gates before you price materials. For example, runs of 40 ft, 60 ft, and 40 ft equal 140 linear feet before subtracting gate openings or adding waste.

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

Calculate concrete by post hole volume, then convert the total volume into bags. A standard 4x4 post in a 10-inch hole at 36 inches deep needs about 1 to 2 bags of 50 lb mix. Bag count changes with hole diameter, post size, depth, and bag yield.

How do you calculate how many fence panels you need?

Divide the adjusted fence length by the panel width, then round up to a whole panel count. For example, 96 ft of fence using 8 ft panels needs 12 panels. Subtract gate openings first when panels do not continue through that opening.

How do you calculate fence post spacing?

Choose a spacing, divide total fence length by that spacing, then round up to get sections. Add 1 post for the end. For example, 100 ft with 8 ft spacing gives 13 sections and 14 posts before extra gate posts.

How do you calculate fence materials?

Calculate posts from spacing, rails from sections times rails per section, and pickets from fence length in inches divided by picket width plus spacing. For a 100 ft fence with 13 sections and 3 rails, you need 39 rails before waste.