Fence Calculator — How Many Posts, Rails, and Pickets Do You Need?

Enter your fence length and height below and I’ll tell you exactly how many posts, rails, and pickets to buy — along with how many bags of concrete you’ll need to set the posts.

Fence material calculator

 

 

Estimate for planning. Round up and add 5-10% when buying pickets to account for defects and cuts.

How I calculate this

A wood fence is built from four types of material: posts, rails, pickets, and concrete. Each one follows a straightforward formula once you know your spacing and fence height.

Posts

Posts go every 8 feet on center — that’s the standard spacing for residential wood fences and the length of a standard 2×4 rail. To find the number of posts, I divide your total fence length by 8, round up to get the number of sections, then add 1 for the final end post:

sections = ceil(fence length / 8)
posts = sections + 1

So a 100-foot fence needs ceil(100 / 8) = 13 sections, plus 1 end post = 14 posts total.

Gate openings break this pattern. A standard single gate is 4 feet wide; a double gate is 8 feet. Each gate needs two dedicated gate posts (typically a heavier 4×6 or doubled 4×4) placed exactly at the opening width. The calculator deducts the gate width from picket material but keeps the gate post count in your total.

Rails

Rails run horizontally between posts. The rule of thumb I use, consistent with what InchCalculator and most framing guides recommend: 2 rails for short fences, 3 for standard 6-foot privacy fences, 4 for tall 8-foot fences. In practice:

  • Up to 4 ft tall: 2 rails per section
  • 5 ft to 7 ft tall: 3 rails per section
  • 8 ft tall: 4 rails per section

Total rails = sections x rails per section. A 6-foot fence with 13 sections needs 39 rails (13 x 3).

Pickets

Pickets are the vertical boards. I calculate them from your total fenced length (minus gate widths), the actual board width, and the gap between boards:

pickets = ceil(fenced length (in inches) / (picket width + gap))

Standard dog-eared privacy fence boards have an actual width of 5.5 inches (sold as a “6-inch” board). A true privacy fence runs them edge-to-edge with 0-inch gap. A picket fence typically uses 3.5-inch boards (a 1×4) with a 3.5-inch gap between them. The calculator defaults to privacy (5.5 in wide, 0 gap) but you can enter any combination.

Concrete

I use 1 bag of 80 lb fast-setting concrete per standard post hole (a 4×4 post in a roughly 10-inch diameter hole, 2 feet deep). For corner posts and gate posts — which carry more load and stress — I recommend 2 bags each. The calculator applies that upgrade automatically when you enter a gate.

Post hole depth: the rule every fencing guide agrees on is that the hole must be at least one-third the above-ground height of the post. For a 6-foot fence (above-ground post height 6 ft), dig at least 2 feet deep. In frost climates, go to your local frost line depth instead — whichever is greater. The calculator notes your required hole depth but does not adjust concrete bags for frost-line depth; check your local code.

Source: Post spacing formula and rail count from Inch Calculator fence calculator. Concrete per post (1 bag 80 lb per standard 4×4 hole) verified against Quikrete’s calculator and confirmed by Hoover Fence Co.’s material guides.

Fence post spacing diagram showing 8 ft panels, post positions, 3 rails, and a 4 ft gate opening
Standard fence layout: posts every 8 ft on center, 3 horizontal rails for a 6 ft fence, gate opening sized to your gate width.

Worked example

My neighbor and I split a 120-foot backyard fence last spring. Here’s how the math worked out for my 60-foot side with one 4-foot gate, using standard 6-foot dog-eared privacy pickets.

Sections: ceil(60 / 8) = 8 sections. With the 4-foot gate, the tool adjusts: the gate replaces 4 feet of picket run but adds 2 gate posts.

Posts: 8 sections + 1 end post = 9 line posts, plus 2 gate posts = 11 posts total.

Rails: 6-foot fence = 3 rails per section. 8 sections x 3 = 24 rails.

Pickets: Fenced run = 60 ft – 4 ft gate = 56 ft = 672 inches. Board width 5.5 in, gap 0 in. 672 / 5.5 = 122.2, round up = 123 pickets.

Concrete: 9 line posts x 1 bag + 2 gate posts x 2 bags = 13 bags of 80 lb concrete.

At the lumber yard I bought 12 posts (one spare), 25 rails (one spare per good habit), 125 pickets, and 14 bags of concrete. The spare rail and couple extra pickets cost me an extra $18 and saved me a second trip when two boards turned out to have bad knots.

Practical notes

Gate placement matters more than people think

Put the gate on the highest point of your yard if the grade slopes — water drains away from the gate gap rather than pooling under it. If you’re building a fence around a pool, local codes often require the gate to be self-closing and self-latching; that affects what hardware you’ll need beyond what this calculator covers.

Corner posts and end posts take extra concrete

I treat corner posts the same as gate posts: 2 bags each. They carry tension from two directions and are the first to pull if the concrete is under-spec. If you’re cutting corners on concrete anywhere in the project, don’t let it be here.

Round up, then add 5-10%

The calculator already rounds up pickets and rails. I still recommend buying 5% extra on pickets for a shorter run (under 80 ft) and 10% on a long run, because natural wood has a real defect rate — splits, checks, bad knots — that a box store return policy doesn’t fully solve on a same-day project.

Check your local setback rules before you dig

Most municipalities require a fence to sit 2 to 3 feet inside the property line, or require a permit for anything over 6 feet. A quick call to your local building department takes 10 minutes and prevents a neighbor dispute or a tear-down order. The calculator gives you material quantities; it can’t tell you where the fence is allowed to go.

Post spacing on a sloped yard

On a slope, fence sections are still 8 feet on-center measured horizontally, not along the slope. The posts will be different heights. I measure the horizontal run and let the posts “stair-step” down the hill. A racked (continuous) fence that follows the slope is harder to frame but looks better on gentle grades. Either way, the post count from this calculator is correct; only the individual post lengths change.

Frequently asked questions

How many posts do I need for a 100-foot fence?

A 100-foot fence with standard 8-foot post spacing needs 13 sections (100 / 8 = 12.5, round up to 13) plus 1 end post, so 14 posts. If you add one 4-foot gate, you replace 2 of those line posts with gate posts, keeping the total at 14 but upgrading 2 of them to heavier gate posts.

How deep should fence post holes be?

The standard rule is one-third of the total post length below ground. For a 6-foot above-ground fence, that means at least a 2-foot-deep hole (so you’d buy an 8-foot post). In areas with hard winters, your hole must reach below the frost line — typically 36 to 48 inches in cold climates — whichever depth is greater. Check your local building code or ask at the lumber yard; they know the local frost depth cold.

How much concrete do I need per fence post?

For a standard 4×4 post in a 10-inch diameter hole about 24 inches deep, one 80 lb bag of fast-setting concrete is enough. Corner posts and gate posts carry more lateral force, so I use 2 bags each. Quikrete and Sakrete both publish bag-per-hole tables on their websites if you want to verify for non-standard hole sizes.

How many pickets do I need for a 6-foot privacy fence?

Divide your fence run in inches by the board width (5.5 inches for a standard “6-inch” dog-eared board with no gap). A 100-foot run = 1200 inches. 1200 / 5.5 = 218.2, round up to 219 pickets. Add 5-10% for defects and cuts, so plan on 230 to 240.

What size rails do I need for a wood fence?

Standard fence rails are 2×4 lumber, cut or bought in 8-foot lengths to match post spacing. You’ll need 2 rails per 8-foot section for a 4-foot fence, 3 rails for a 6-foot fence, and 4 rails for an 8-foot fence. Cedar and pressure-treated pine are the common choices; cedar is lighter and naturally rot-resistant, pressure-treated is cheaper and widely available.

Built and maintained by Sam Walsh. Last updated July 2026. These figures are estimates for planning purposes — always confirm your local material costs, setback rules, and post-depth requirements before buying.

For the concrete to set your posts, see the concrete calculator. If you’re also adding a gravel or stone path alongside the fence, the gravel calculator handles that. And if you need to measure your yard accurately first, start with how to measure a room — the same principles apply outdoors.