Civil & Structural Engineering

Fence Calculator

Calculate how many fence posts, rails, pickets, and bags of concrete you need for a straight-run fence.

Formula Posts = Sections + 1Reviewed Sep 8, 2026

Planning a fence? This calculator builds the full material list from your fence length, height, and post spacing: total posts, rails, pickets, and bags of concrete for setting the posts. Rails per section and post hole depth auto-size from the fence height using standard trade rules, but both can be overridden - post hole depth especially, since a local frost-line requirement can call for a deeper hole than the default rule of thumb. It is best for straight wood privacy or picket fence runs; gates, corners, end conditions, and sloped sections should be measured separately and added to the takeoff.

Calculation Bench

Fence Dimensions

01

L · Total straight-run length

02

H · Above-ground post height

Posts & Rails

03

s · 8 ft standard; 6 ft in high-wind areas

04

pw · Face width of a square post

05

d · Blank = auto (half the fence height); override for your frost line

06

rps · Blank = auto (1 rail per 24 in of height, min 2)

Pickets

07

bw · Face width of one picket or board

08

g · Gap between adjacent pickets

09

W% · Applied to picket count only

Concrete

10

cb · 60 lb is the most common bag size

Pricing (Optional)

11

$ · Leave blank to skip cost estimate

12

$ · Leave blank to skip cost estimate

13

$ · Leave blank to skip cost estimate

Solution

Enter fence dimensions and post spacing to calculate your material list.

N = Sections + 1

Formula Sheet

Sections=⌈Ls⌉\text{Sections} = \left\lceil \dfrac{L}{s} \right\rceil
N=Sections+1N = \text{Sections} + 1
Rails=Sections×rps\text{Rails} = \text{Sections} \times \text{rps}
Pickets=⌈⌈L+gbw+g⌉×(1+W%)⌉\text{Pickets} = \left\lceil \left\lceil \dfrac{L + g}{bw + g} \right\rceil \times (1 + W\%) \right\rceil
Bags=⌈N×(2.25π−1)×pw2×dBag Yield⌉\text{Bags} = \left\lceil \dfrac{N \times (2.25\pi - 1) \times pw^2 \times d}{\text{Bag Yield}} \right\rceil
  • NTotal Posts
  • LFence Length
  • HFence Height
  • sPost Spacing
  • pwPost Width
  • dPost Hole Depth
  • rpsRails per Section
  • bwPicket Width
  • gPicket Gap
  • W%Waste Factor
  • cbConcrete Bag Weight

Variables & Units

SymbolVariableDescriptionCommon Units
NTotal PostsTotal fence posts, including both end posts.
LFence LengthTotal straight-run length of the fence.ft, m
HFence HeightAbove-ground post height.ft, m, in
sPost SpacingCenter-to-center distance between posts.ft, m
pwPost WidthFace width of a square post.in, mm
dPost Hole DepthDepth of each post hole, auto-sized to half the fence height unless overridden.ft, in, m
rpsRails per SectionHorizontal rails per fence section, auto-sized from fence height unless overridden.
bwPicket WidthFace width of a single picket or board.in, mm
gPicket GapGap left between adjacent pickets.in, mm
W%Waste FactorA decimal allowance applied to picket count for cuts and mistakes (e.g. 0.10 = 10%).
cbConcrete Bag WeightWeight of one bag of premixed concrete.lb, kg

How to Use This Calculator

  • 01Enter the total fence length and the fence height (the above-ground post height).
  • 02Set the post spacing - 8 ft (2.4 m) on-center is standard for wood privacy fences; use 6 ft (1.8 m) in high-wind areas.
  • 03Enter the post's face width (e.g. 3.5 in for a nominal 4×4). Rails per Section and Post Hole Depth auto-size from the fence height - override either if your design or local frost line calls for something different.
  • 04Enter the picket's face width and the gap you're leaving between pickets, plus a waste factor (10% is standard) to cover cuts and mistakes.
  • 05Set the concrete bag weight you plan to buy - 60 lb is the most common size for setting fence posts.
  • 06Optionally enter a price per post, picket, and concrete bag for a total material cost estimate.
  • 07Use the result as the straight-run material count, then add separate material for gates, corner braces, terminal posts, fasteners, caps, and any extra concrete required by your local frost depth.

How the Formula Works

Posts are found from the number of sections a fence divides into: Sections = ⌈Length / Post Spacing⌉, and Posts = Sections + 1 - one more post than the number of spans between them, the same relationship that governs fence posts, deck balusters, or any row of evenly spaced dividers.

Rails per section default to the standard trade rule of one rail for every 24 inches of fence height, with a floor of 2 - a 6 ft fence auto-sizes to 3 rails, a 4 ft fence to 2. Total rails is then Sections × rails per section. This value can be overridden directly if a specific fence style calls for a different count.

Pickets are found the same way as deck boards: N pickets laid side by side have only N − 1 gaps between them, not N, so the picket count is ⌈(Length + Gap) / (picket width + Gap)⌉ - adding one gap width to the fence length before dividing - which correctly guarantees the picket run covers the full fence length. Dividing length by footprint alone would under-count by one picket in some length-and-gap combinations. The waste factor is then applied on top and rounded up again.

Concrete per post starts from the standard trade convention that a post hole's diameter runs about 3× the post's face width. For a round hole around a square post, the net concrete volume (hole volume minus the post's own displaced volume) works out to (2.25π − 1) × post width² × hole depth - roughly 6.07 times the post's cross-sectional area, times the hole depth. Hole depth itself defaults to fenceHeight / 2, which buries exactly a third of the post's total length (post length = 1.5 × fence height) - the standard "bury a third of the post" rule - but should be overridden with a deeper value where the local frost line requires it.

Bags of concrete come from dividing total concrete volume by one bag's cured yield. Bag yield is derived from Quikrete's published concrete-mix specification of 0.0075 cubic feet of cured yield per pound of bag weight - a ratio that holds constant across the common 40, 50, 60, and 80 lb bag sizes, so entering any bag weight gives an accurate yield.

Worked Example 01

Standard 100 ft backyard privacy fence

Known

  • Fence Length (L): 100 ft
  • Fence Height (H): 6 ft
  • Post Spacing (s): 8 ft
  • Post Width (pw): 3.5 in
  • Picket Width (bw): 5.5 in
  • Picket Gap (g): 0.25 in
  • Waste Factor (W%): 10%

Formula

Sections = ⌈L / s⌉

Substitution

Sections = ⌈100/8⌉ = 13, Posts = 14, Rails/Section = ⌈72in/24in⌉ = 3, Rails = 39, Pickets = ⌈(1200+0.25)in/5.75in⌉ × 1.10 = 230

Result

14 posts · 39 rails · 230 pickets · 49 bags of concrete

A 100 ft, 6 ft tall privacy fence at 8 ft post spacing needs 14 posts and 13 sections. Rails auto-size to 3 per section (6 ft = 72 in, one rail per 24 in) for 39 rails total. Pickets, with a 10% waste allowance, come to 230. Post holes default to 3 ft deep (half the fence height), giving 49 bags of 60 lb concrete for all 14 holes.

Worked Example 02

Metric fence, no-gap shadowbox style, exact fit

Known

  • Fence Length (L): 24 m
  • Fence Height (H): 1.8 m
  • Post Spacing (s): 2.4 m
  • Post Width (pw): 9 cm
  • Picket Width (bw): 15 cm
  • Picket Gap (g): 0 cm
  • Waste Factor (W%): 0%

Formula

Sections = ⌈L / s⌉

Substitution

Sections = ⌈24/2.4⌉ = 10, Posts = 11, Rails/Section = ⌈1.8m/0.6096m⌉ = 3, Pickets = ⌈(24+0)/0.15⌉ = 160

Result

11 posts · 30 rails · 160 pickets · 39 bags of concrete

A clean 24 m fence at 2.4 m post spacing divides into exactly 10 sections (11 posts). With a no-gap (shadowbox-style) picket layout, the picket count simplifies to fence length divided by picket width directly - 24 m / 0.15 m = 160 pickets exactly, with no waste needed since both divisions land on whole numbers.

Applications

  • 01Estimating posts, rails, pickets, and concrete for a new residential wood fence build
  • 02Quick quantity takeoff for contractor bidding or homeowner budgeting
  • 03Checking concrete bag counts against a specific bag size already on hand or available locally
  • 04Comparing 6 ft versus 8 ft post spacing before buying posts and concrete

Fence Planning Checks Before You Buy Materials

Planning itemTypical starting pointWhy it matters
Post spacing6-8 ft on-centerCloser spacing usually improves stiffness but increases posts and concrete.
Post hole diameterAbout 3x post widthA wider hole gives concrete room around the post instead of only filling a tight annulus.
Post embedmentAbout 1/3 of total post lengthA common starting rule; frost depth or local code can require deeper holes.
Picket waste5-15%Covers cuts, warped boards, layout changes, and a few damaged pickets.
Gates and cornersEstimate separatelyGate posts and corner posts often need heavier posts, bracing, or deeper footings.

Assumptions

  • 01The fence runs in a single straight line (or straight segments totaling the entered length) with evenly spaced posts - no corners, curves, or gate openings are modeled separately.
  • 02Posts are square in cross-section (e.g. 4×4, 6×6). For a round post, enter an equivalent width close to the post's actual diameter.
  • 03Post holes are assumed round (as from a power auger) with a diameter of about 3× the post's face width - the standard trade convention - and posts are centered in the hole.
  • 04Post hole depth defaults to half the fence height, which buries a third of the post's total length (post length = 1.5 × fence height) - a common starting rule, not a substitute for local frost-line or code requirements.
  • 05The waste factor applies to picket count only; posts and concrete bags are calculated as exact counts.

Where This Model Stops

  • 01Does not model gate openings, corner posts, or non-straight runs - a fence with corners or a gate should be measured and calculated as separate straight segments.
  • 02Does not account for local frost-line depth requirements. In any region where the ground freezes, code typically requires the bottom of the concrete footing to sit at least 6 inches below the local frost line, which can be considerably deeper than the default half-height rule - override Post Hole Depth with your jurisdiction's required depth.
  • 03Does not calculate fasteners (screws, nails, post caps) or gate hardware.
  • 04Assumes a single post width and hole size throughout - taller sections or gate posts that need a larger post or deeper footing should be estimated separately and added to the totals.
  • 05Does not optimize panel layout. If you are buying prebuilt panels, compare the calculated section count with the panel width sold locally and decide whether to trim a final panel or tighten spacing.

References

  1. [1]

    Fence Calculator - Estimate Wood Fencing

    Inch Calculator

    Industry reference for post-count, rail-count (1 rail per 24 in of height), and picket-count formulas used by wood fence contractors.

  2. [2]

    Concrete Mix Product Data - Bag Yield by Weight

    Quikrete

    Manufacturer-published cured yield of 0.0075 cubic feet per pound of bag weight, constant across the 40, 50, 60, and 80 lb bag sizes, used to derive the concrete bag count.

Frequently Asked Questions

Why does the calculator ask for post hole depth if it can auto-calculate it?

The auto value (half the fence height) is a standard rule-of-thumb starting point, not a code requirement. In regions where the ground freezes, local code typically requires the concrete footing to sit at least 6 inches below the frost line, which is often deeper than the default - override the field with your jurisdiction's actual required depth.

How does the calculator decide how many rails to use?

It defaults to one rail per 24 inches of fence height, with a minimum of 2 - a 6 ft fence auto-sizes to 3 rails, a 4 ft fence to 2. This is a common trade rule, not a universal standard; some 6 ft privacy fences are built with only 2 rails, so override the field if your design calls for a different count.

Why does the concrete formula subtract the post's own volume?

Concrete only fills the space around the post, not the space the post itself occupies. The formula starts from the full hole volume (a round hole about 3× the post's width in diameter) and subtracts the post's own volume, so the bag count reflects concrete actually poured, not the hole's total volume.

Does the waste factor apply to posts and concrete too, or just pickets?

Just pickets. Posts and concrete bags are calculated as exact counts, since buying an intentional surplus of structural posts or partial concrete bags doesn't correspond to the same kind of cutting waste that lumber pickets incur.

How do I handle a gate in my fence run?

Measure and calculate the fence run and the gate opening separately. Subtract the gate width from your total fence length before entering it here, then add the gate's own posts, hardware, and panel material - which this calculator doesn't model - to your total material list.

Should I use 6 ft or 8 ft post spacing?

For many residential wood fences, 8 ft on-center is a common starting point. Use closer spacing such as 6 ft when the fence is tall, exposed to wind, carrying heavier panels, or when the manufacturer or local code requires it. Closer spacing increases post and concrete count but usually makes the fence stiffer.

How is this different from the Concrete Calculator?

The Concrete Calculator estimates volume for slabs, footings, and other concrete shapes. This Fence Calculator uses fence layout rules first - sections, posts, rails, pickets, and post holes - then converts the post-hole volume into concrete bags.