Fence Calculator

The fence calculator turns your fence length, height and gates into the posts, rails, pickets, concrete and gravel for a wood fence.

Updated September 27, 2026Free, no signup

1Fence size

ft
Fence height
Post spacing

8 ft matches standard rails; 6 ft is stiffer.

ft

2Posts, rails & pickets

Gap between pickets
Board layers

Board-on-board takes about 1.5 times the boards (CalcSummit).

Rails per section

3 rails for 6 ft and taller, 2 for shorter fences.

Post depth below ground

QUIKRETE: 1/3 to 1/2 of the height above ground, plus 6 in of gravel. Use 1/2 in cold or loose soil.

3Prices (optional)

$
$
$
$

Your estimate

For –:

Fence materials

–

Your shopping list

    How we calculated this

      Post holes per QUIKRETE's method; bag yield from the QUIKRETE data sheet. Check frost depth, property lines and local fence rules before you dig.

      On this page
      1. How to calculate fence materials
      2. How to use the fence calculator
      3. How many fence posts do I need?
      4. How many rails do I need?
      5. How many pickets do I need?
      6. How deep should fence posts be set?
      7. How much concrete does a fence post need?
      8. How far apart should fence posts be?
      9. Gates and openings
      10. Fence types and how the count changes
      11. Fences on a slope
      12. Wood for the posts, rails and pickets
      13. Call 811 before you dig
      14. Property lines, permits and HOA rules
      15. How much does a fence cost?
      16. Common fence mistakes
      17. Before you build the fence
      18. Frequently asked questions

      How to calculate fence materials

      Start with the fence length. Posts = sections + 1 (plus one per gate), rails = sections × rails per section, and pickets = fence length in inches ÷ (picket width + gap).

      Fence calculator: wood privacy fence with posts, rails and pickets
      Post holes: three times the post width, about a third of the height deep.
      Length ÷ post spacing=Sections→Posts, rails, pickets, concrete

      150 ft of 6 ft privacy fence with 8 ft sections and one 4 ft gate: 19 sections, 21 posts, 57 rails and about 335 pickets of 5½ in with 5% spare, set in about 31 bags of 80 lb concrete.

      How to use the fence calculator

      This tool turns the length, height and gates of your fence into a shopping list. The "How we calculated this" panel shows each step, and the PDF report keeps the list for your lumber yard.

      Step 1: Enter the fence length and gates

      Type the total length of the fence line in feet, the number of gates and the gate width. It takes the gates out of the run before it counts the sections, then adds a post for each gate.

      Step 2: Choose the height, spacing and style

      Pick the height, a post spacing of 6 or 8 ft, the post size, the picket width and the gap. Choose board-on-board if the boards overlap in two layers, and 1/2 of the height if your soil or climate calls for deeper posts.

      Step 3: Add your prices

      Type the price of a post, a rail, a picket and a bag of concrete to see the cost. Leave the prices blank if you only want quantities.

      How many fence posts do I need?

      Posts = fence length ÷ post spacing, rounded up, plus 1. Omni Calculator gives the same rule, and says post spacing is usually 6 to 8 feet. Add one more post for each gate, since the opening splits the run and needs a post on each side.

      Fence lengthPosts at 8 ft spacingPosts at 6 ft spacing
      50 ft810
      100 ft1418
      150 ft2026
      200 ft2635
      300 ft3951

      How many rails do I need?

      Rails are the horizontal boards that the pickets attach to. Rails = rails per section × the number of sections. Our default is 2 rails for fences under 6 feet and 3 rails for 6 feet and taller, and you can change it.

      How many pickets do I need?

      Pickets = the run in inches ÷ (picket width + gap), rounded up. It adds 5% spare for cuts and bad boards. A privacy fence has no gap, and a picket fence has a gap of an inch or more.

      Picket (width)No gap½ in gap1 in gap2½ in gap
      1×4 (3.5 in)28242216
      1×6 (5.5 in)18161512

      The table shows pickets per 8 ft section, before spare boards. Board-on-board and shadow-box fences overlap two layers of boards. CalcSummit puts them at about 1.5 times the boards of a butted privacy fence.

      How deep should fence posts be set?

      QUIKRETE's method for setting posts in concrete has four parts:

      • Hole width: three times the post width.
      • Hole depth: 1/3 to 1/2 of the post height above ground, plus 6 inches.
      • Gravel: 6 inches in the bottom, compacted, for drainage and to protect the post from rot.
      • Concrete: fill to 3 to 4 inches below ground level, then backfill with soil.

      Post depth at one third (the minimum) and one half of the fence height, with 6 inches of gravel under it:

      Fence heightBuried at 1/3Buried at 1/2Hole depthPost length to buy (1/3)
      4 ft16 in24 in22–30 in6 ft
      5 ft20 in30 in26–36 in8 ft
      6 ft24 in36 in30–42 in8 ft
      8 ft32 in48 in38–54 in12 ft

      Frost line and cold climates

      Frost heaving can push posts up when wet ground freezes, so in cold climates posts often go below the frost line. Your building department knows the local depth. CalcSummit gives 42 inches as an example for the Midwest, which is deeper than the 1/3 rule gives for a 6 ft fence.

      How much concrete does a fence post need?

      A fence post hole holds the concrete around the post. For a hole three times as wide as the post, filled to 3½ inches below grade, the number of 80 lb bags per post is the one below. The yield is 0.60 cubic feet per bag, from the QUIKRETE data sheet.

      Fence height4×4 post, 1/3 deep6×6 post, 1/3 deep4×4 post, 1/2 deep6×6 post, 1/2 deep
      4 ft0.92.21.53.6
      5 ft1.22.91.94.7
      6 ft1.53.62.35.8
      8 ft2.05.03.27.9

      QUIKRETE says fast-setting concrete sets in 20 to 40 minutes and takes heavy loads after about 4 hours. Set posts in concrete that is rated for it, and use a post that is rot-resistant wood, rust-resistant metal or an appropriate synthetic material.

      Frost line, utilities and property lines

      In cold climates, posts often need to go below the frost line, and many towns limit fence height and set it back from the line. Call 811 before you dig to have buried utilities marked.

      How far apart should fence posts be?

      Post spacing is the distance between the centers of two posts. Most wood fences put them 6 to 8 feet apart. An 8 ft spacing matches standard 8 ft rails and needs fewer posts, and 6 ft sections are stiffer. Choose the spacing before you buy rails so that each section ends on a post.

      Gates and openings

      Subtract each gate's width from the fence length, then count the sections for the rest. A gate needs a post on each side, and the hinge post carries the weight of the gate.

      Fence types and how the count changes

      This tool counts a wood fence with posts, rails and pickets. Other types use different parts:

      • Wood privacy fence: boards side by side with no gaps. Use the no-gap option.
      • Picket fence: boards with gaps of an inch or more, and fewer pickets per section.
      • Board-on-board: two layers of overlapping boards for full privacy, with about 1.5 times the boards.
      • Split-rail fence: posts and rails only, with no pickets. Ignore the picket count and use the post and rail counts.
      • Chain-link and vinyl fence: parts come in fixed sizes. Hoover Fence has separate calculators for chain link, vinyl, ornamental aluminum, wood and split rail, so follow the maker's post spacing.

      Fences on a slope

      On a slope you can follow the ground (racking) or build level sections that step down. Measure the run along the ground for racked sections, and expect to buy taller pickets, or longer posts, for stepped ones. Add more spare pickets on a slope.

      Wood for the posts, rails and pickets

      Pressure-treated pine, cedar and redwood are the usual woods for fences. Posts are in contact with the ground, so use treated wood or another rot-resistant post, as QUIKRETE advises, and fasten the pickets with exterior screws or nails.

      Call 811 before you dig

      811 is the free national before-you-dig service. Contact it a few business days before you begin, and the utilities mark the approximate location of buried lines with paint or flags. Then dig carefully around the marks.

      Property lines, permits and HOA rules

      Fence height, setback from the line and materials are set locally, and an HOA may add its own rules. Check with your building department before you buy. A fence on the line needs a survey, so check the plat and the lot size to acres calculator for how lots are recorded.

      How much does a fence cost?

      Fence cost is the sum of each part: posts × price + rails × price + pickets × price + concrete bags × price. For example, with prices of $18 a post, $8 a rail, $3 a picket and $6.50 a bag, the 150 ft fence above costs about $2,040, or $13.60 a foot, before gates, hardware and labor. Type your own prices in the fence calculator.

      Common fence mistakes

      • Forgetting the end post. Posts are sections + 1, not sections.
      • Not subtracting gates. The gate opening has no pickets, but it needs two posts.
      • Setting posts too shallow. Use 1/3 to 1/2 of the height above ground, plus gravel.
      • Skipping the spare boards. Buy about 5% more pickets for cuts and bad boards.
      • Digging before 811. Have the buried lines marked first.

      Before you build the fence

      Measure the fence line, subtract the gates and choose the spacing, then let the fence calculator turn it into posts, rails, pickets and concrete. Check the local rules and call 811, and download the PDF report for the lumber yard.

      Need concrete for a slab or footings instead? Use the concrete calculator.

      Concrete calculator

      Frequently asked questions

      How many fence posts do I need?

      Divide the fence length by the post spacing, round up for the number of sections, then add 1 for the end post and 1 more for each gate. A 150 ft run with 8 ft sections and one gate takes 21 posts.

      How deep should fence posts be?

      QUIKRETE's guide: dig the hole to 1/3 to 1/2 of the post's height above ground, plus 6 inches for a gravel layer. A 6 ft fence needs posts buried at least 2 ft, in a 30 inch hole. Local frost depth and code can require more.

      How wide should a fence post hole be?

      Three times the width of the post, according to QUIKRETE. A 4×4 post (3.5 in actual) needs a hole about 10½ inches across.

      How far apart should fence posts be?

      Most wood fences put posts 6 to 8 feet apart, center to center. Omni Calculator gives the same range. 8 ft sections match standard 8 ft rails; 6 ft sections are stiffer in high wind.

      How many bags of concrete per fence post?

      For a 4×4 post in a 10½ inch hole set 24 inches deep, with concrete to 3½ inches below ground, roughly 1.5 bags of 80 lb concrete mix. The calculator works it out from your post size and fence height.

      How many pickets do I need for an 8 ft section?

      With 1×6 boards (5½ inches wide) and no gaps, 96 inches ÷ 5.5 = 17.5, so 18 pickets. With ½ inch gaps it takes 16, and with 2½ inch gaps 12.

      How many rails does a fence section need?

      Our default is 2 rails for fences under 6 ft tall and 3 rails for 6 ft and taller. Multiply the rails per section by the number of sections.

      How many extra boards does board-on-board take?

      CalcSummit puts board-on-board and shadow-box styles at about 1.5 times the boards of a standard butted privacy fence. The calculator has a board-on-board option that applies the 1.5 factor.

      Do I need to call 811 before I dig fence post holes?

      Yes. 811 is the free national before-you-dig service. Call a few business days before you dig so the utilities can mark buried lines with paint or flags, then dig carefully around the marks.

      How accurate is the fence calculator?

      It is exact for the length, height, spacing and gates you enter. Slopes, corners, local frost depth and the real width of your boards change what you buy, so confirm them and round up.

      Sources

      1. QUIKRETE: Setting Posts in Concrete (PDF)
      2. QUIKRETE Concrete Mix No. 1101 data sheet
      3. Omni Calculator: fence posts, rails, pickets and concrete formulas
      4. CalcSummit: fence post depth, board-on-board count and frost line
      5. 811 Before You Dig: the free national before-you-dig service

      Keep planning after the fence calculator

      Free tools and guides that pair with the fence calculator for the same project.

      Deck board calculator: deck boards screwed down over joists
      Calculator

      Deck Board Calculator

      Deck boards, screws and joists for a rectangular deck.

      Open calculator