Wood fence calculator

Enter your sides and gates; get every post, rail, picket, bag of concrete and box of nails, sized to your frost line.

Wood fence. Other types: chain link, vinyl.

Step 01 of 05

What shape is your fence line?

Pick the closest shape to start. Every corner, end and gate needs a different post, so the shape matters more than the total length.


Number of straight sides
3
First side attaches to a wall, no post there
Last side attaches to a wall
The last side returns to where the first one started

How this calculator works

You do not enter a single total length. You enter each side of the fence as it runs around your yard, then place any gates on the side where they belong. From that, the calculator works out the rest, whether you are building a solid privacy fence, a spaced picket fence, board-on-board, shadow box or horizontal boards.

Corners and ends are derived. Where one side meets the next, that is a corner post. Where a side stops without meeting anything (at the house, a neighbor's fence, or a driveway), that is an end post. Each gate adds two gate posts, one on each side of the opening. If you put a gate at a corner or at the end of a side, the gate shares that post instead of adding a new one.

Gates split sides into runs. A 50 ft side with a 4 ft gate in the middle becomes two 23 ft runs. The gate opening is also subtracted from the fence length, so you do not buy pickets for a hole in the fence. That net length is called L_net below.

Posts are spaced evenly on each run. For every run, the calculator divides the length into the fewest bays that fit under the maximum spacing, then spreads them equally:

  • bays = ceil(run ÷ max spacing)
  • on-center spacing = run ÷ bays
  • line posts = bays − 1

The maximum spacing is 94 in (7 ft 10 in) if you face-mount 2x4x8 rails and cut them on post centers, since an 8 ft board has to reach the middle of the post on both ends. If you buy 16 ft rails or use rail brackets, it is 96 in.

Terminal posts = ends + corners + 2 per gate.

Rails depend on height: 2 per bay up to 4 ft, 3 per bay for 5 to 6 ft, and 4 per bay for 8 ft.

Pickets use actual widths, not nominal. A 1x6 is 5½ in wide and a 1x4 is 3½ in. Using 6 in for a 1x6 undercounts by about 9%.

  • Solid privacy: L_net × 12 ÷ w
  • Spaced picket: L_net × 12 ÷ (w + gap)
  • Horizontal boards, per bay: (H × 12 − 2 in) ÷ (w + gap), with a 2x4 nailer added mid-bay so boards are supported at no more than about 4 ft.

The calculator adds 5% waste to pickets by default.

Shadow box and board-on-board pickets

A shadow box fence and a board-on-board fence both put pickets on each face of the rails, offset so each board on one side covers the gap on the other. The calculator counts them as L_net × 12 ÷ (w − overlap), with a 1 in overlap on each edge by default. That works out to about 1.4 times the pickets of a solid fence of the same length, and the rails and posts are unchanged.

Post depth and concrete follow your frost line. Embed depth is the larger of the fence type's minimum and your frost depth plus 6 in. Corner and gate posts go 6 in deeper. Post length is height above grade plus embed, rounded up to a stock length. Line 4x4 posts get a 10 in hole and corners, ends, gates and 6x6 posts get 12 in. Concrete per hole is the hole volume minus the post, over the depth above a 6 in gravel base, summed for every hole plus 10%. See the fence post concrete calculator for the full formula.

Worked example

A 6 ft solid privacy fence in 1x6 pickets. Three sides of 50 ft each, a 4 ft walk gate in the middle of the third side, two corners and two free ends.

StepMathResult
Net fence length150 − 4146 ft
Runs50, 50, 23, 234 runs
Bays at 94 in maxceil(600 ÷ 94), ceil(276 ÷ 94)7, 7, 3, 3 = 20 bays
Line postsbays − 1 per run6 + 6 + 2 + 2 = 16
Terminal posts2 ends + 2 corners + 2 gate6
Total posts16 + 622
Rails20 bays × 360, plus gate framing
Pickets146 × 12 ÷ 5.5 = 319, +5%335
Picket nails335 × 3 rails × 22,010, about 14 lb, so three 5 lb boxes
Concrete16 line holes at 10 in, 6 terminal holes at 12 inabout 40 bags of 80 lb mix
Gravel6 in base in 22 holesabout 14 bags

The concrete count moves with your frost depth, so treat 40 bags as this example's number, not a rule.

Buy 16 ft rails if you can carry them

A 16 ft 2x4 spans two bays and staggers the joints, which makes a stiffer fence. It also lets you space posts a full 96 in, which can drop a post or two per side.

Wood fence reference

Fence heightRails per bayLine postsGate postsPickets per 8 ft bay (1x6 solid)
3 to 4 ft24x4x84x4 or 4x6about 18
5 to 6 ft34x4x8 (4x4x10 in frost or wind)4x6 or 6x6about 18
8 ft46x6x126x6about 18
PicketActual widthPickets per 10 ft, solid
1x43½ in35
1x65½ in22
1x87¼ in17

Posts in the ground need to be rated for ground contact. Look for UC4A on the tag for general use, or UC4B for posts in wet ground, severe climates, or where the fence is structural.

Fasteners, gates, kickboard and stain

Posts, rails and pickets are the frame. The list also counts everything that fastens, finishes and hangs on it:

Picket fasteners. Two per picket at every rail. For a 6 ft fence that is six per picket. 6d 2 in hot-dipped galvanized ring-shank nails run about 144 per pound. #8 × 2 in exterior screws run about 126 per pound. The calculator rounds up to 1, 5 or 25 lb boxes. Use stainless on cedar and redwood, which stain black around plain galvanized fasteners. For treated lumber, IRC R317.3 requires hot-dipped galvanized or stainless fasteners, since the treatment chemicals corrode bare and electroplated steel.

Rail fasteners. Two 16d nails or two 3 in screws at each rail end. If you use Simpson FB24Z fence brackets instead, that is 2 brackets per rail and 5 fasteners per bracket.

Kickboard and cap. An optional 2x6 pressure-treated kickboard per bay keeps pickets off the dirt. A cap is a 2x6 on top of the posts with a 1x4 trim board below it, both per bay. Post caps are one per post.

Gate materials. The gate leaf is the opening minus about 1 in for hinge and latch clearance. The calculator counts pickets over the leaf width, a 2x4 frame (3 to 4 pieces for leaves up to 4 ft, 5 to 6 pieces up to 6 ft), two T or strap hinges (a third if the gate is over 6 ft tall), a gravity latch and an anti-sag kit. Double gates add a cane bolt. You can swap the frame for an Adjust-A-Gate style steel kit.

Gravel. A 6 in base under each post helps drainage. At 0.5 ft³ per bag, the example above needs about 14 bags.

Stain. Semi-transparent stain covers about 125 ft² per gallon on rough-sawn lumber. Solid stain covers about 200. Count both faces if you want the neighbor's side done.

GuideFence post spacingHow far apart fence posts should be for wood, chain link, vinyl, aluminum and split rail, plus how to equalize spacing on each run so no bay is a stub.

Wood fence cost per foot

These are national ranges for a 6 ft wood privacy fence, dated September 2026. Your local price can sit well outside them.

SourceInstalled, per linear footMaterials only, per linear foot
Homewyse, 6 ft PT privacy$31.95 to $51.60about $15 to $21
Fence Advisors, pressure-treated pine$18 to $38not given
Fence Advisors, cedar$25 to $55not given
Ergeon, wood fence national average$44 to $67not given

The spread comes from labor rates, lumber grade, and how much digging your soil allows. Board-on-board uses about 40% more pickets than a solid fence, so expect its material line to rise by roughly that much for the pickets alone.

The calculator's cost estimate prices your own shopping list with editable national-average unit prices. Change any price to match your lumber yard and the total updates.

Before you buy

  • Call 811 at least a few business days before you dig. The locate service is free and marks buried utility lines.
  • Check permits. Many towns require a permit for fences over a certain height, often 6 ft in back yards and 3 to 4 ft in front yards.
  • Read your HOA rules. They often set height, style, which face points outward, and stain color.
  • Find your property line. A survey or your plat map beats a guess. Setting the fence a few inches inside the line keeps the posts and concrete on your property.
  • Measure along the ground, not off a satellite map. On a slope, the ground distance is longer than the map distance, and that difference is pickets and rails you will be short.
GuideHow deep should fence posts beFence post depth by fence height, frost line and soil, with hole diameters, gravel base, gate post rules and the post length to buy for each fence.

Questions people ask

How many pickets do I need for a 100 ft privacy fence?

For a solid privacy fence with 1x6 pickets, which are 5.5 in wide, you need 100 x 12 / 5.5 = 219 pickets, or 230 with 5% waste. Subtract any gate openings first, then add the pickets for the gate leaves separately.

How far apart should wood fence posts be?

No more than 8 ft on center. If you face-mount standard 8-ft 2x4 rails and cut them on post centers, the practical maximum is 94 in (7 ft 10 in). The calculator divides each side into equal bays under that limit, so your posts are evenly spaced.

How many rails does a 6 ft wood fence need?

Three per bay. Fences up to 4 ft use two rails, 5 to 6 ft use three, and 8 ft fences use four.

Should I use nails or screws for fence pickets?

Either works. Use 6d hot-dipped galvanized ring-shank nails or #8 x 2 in exterior screws, two per picket at every rail. Use stainless steel on cedar and redwood to avoid black staining.

What size posts do I need for a wood fence?

4x4x8 posts work for 4 to 6 ft fences in mild climates. Use 4x4x10 where frost or wind calls for a deeper hole, and 6x6x12 for 8 ft fences. Gate posts should be 4x6 or 6x6 and set 6 in deeper than line posts.

How much extra material should I buy?

The calculator adds 5% to pickets by default, which covers split or badly warped boards. Raise it to 10% if you are buying a low grade or cutting around a slope.

How many bags of concrete per wood fence post?

A 4x4 line post in a 10 in hole with 24 in of concrete takes about 1.5 bags of 80 lb mix. Corner, end and gate posts in 12 in holes with 30 in of concrete take about 3. The calculator sums every hole by class and adds 10%.

Does the calculator work for board-on-board fences?

Yes. Choose board-on-board or shadow box. Pickets go on both faces with a 1 in overlap on each edge, which works out to about 1.4 times the pickets of a solid fence.

Guides

Written by the My Fence Calculator editorial team. Last updated 2026-09-28. Quantities are estimates based on US stock sizes and building codes; verify with your supplier and local code.