Fence Calculator
Count posts, rails, and pickets for a wood privacy or picket fence from the total run length and post spacing.
Estimates are for planning. Confirm quantities against your measured site and product packaging before ordering, and follow local building codes.
How to measure the run
Walk the fence line with a 100 foot tape or a measuring wheel and record each straight stretch separately. A typical backyard isn’t one run, it’s three or four: back line, two sides, maybe a return to the house. The calculator works per run, so keep them separate. Corners get their own post, and so does each end where the fence meets the house or an existing structure.
If your property line wanders, break the curve into short straight segments and treat each as its own run. For an L-shaped or irregular yard, sketch it on paper, split it into straight legs, and measure each leg. Add the legs together for total material but remember each corner adds a post.
Mark every gate location now and subtract its width from the run. A standard walk gate is 36 to 48 inches; a double drive gate for mower or vehicle access runs 8 to 12 feet. Also call 811 before you dig. It’s free, it’s the law in every state, and utility locates take a few business days.
The formula and what it assumes
The math is straightforward. Sections is your run length divided by post spacing, rounded up to the next whole number. Posts is sections plus one, because a run of 5 sections needs 6 posts (one at each end plus the shared posts between). Rails is sections times rails per section: 2 rails for a 4 foot fence, 3 for a 6 foot fence, since taller pickets need a third rail to stay straight. Pickets is the run length converted to inches, divided by picket width plus the gap between pickets, rounded up.
The assumptions worth knowing. Post spacing defaults to 8 feet on center, the standard because rails come in 8 foot lengths. The picket count assumes a uniform gap; a board-on-board or shadowbox fence overlaps pickets and needs roughly 30 to 50 percent more of them. Gates aren’t included, count those separately with their own posts and hardware. And the post count assumes posts long enough to bury about one third of their length, with the hole bottom below your local frost line. In the upper Midwest that can mean 42 to 48 inches deep, so a 6 foot fence there wants a 9 or 10 foot post, not the 8 footer that works in Georgia.
Buying tips
A 6 foot wood privacy fence in pressure-treated pine runs roughly $15 to $30 per linear foot installed, or $8 to $15 in materials if you build it yourself. The standard shopping list per 8 foot section: one 4x4x8 post (about $10 to $18), three 2x4x8 rails ($4 to $8 each), and about 16 dog-ear pickets at 5.5 inches wide ($2 to $5 each in treated pine, double that in cedar). Each post takes one to two 50 lb bags of concrete mix, about $5 to $7 a bag; fast-setting mix costs a bit more and skips the bracing wait.
Pre-built panels (around $50 to $90 for an 8 foot treated panel) beat stick-built pricing on flat ground, but the pickets are usually thinner, and panels can’t follow a slope. On grades, pros stack the fence down the hill in steps with panels, or rack a stick-built fence so the rails follow the slope and the pickets stay plumb. Racking looks better and leaves no triangular gaps under the fence.
Buy 5 to 10 percent extra pickets. You’ll split a few nailing near the ends, and lumber yards always have some warped boards in the stack. Pull pickets from the middle of the pile, sight down each one, and reject anything with a twist. Treated lumber also shrinks as it dries, so if you want a true privacy fence with no gaps, butt the pickets tight at install; the shrinkage will open up an eighth-inch gap on its own over the first summer.
Frequently asked questions
How far apart should fence posts be?
8 feet on center is the standard for wood privacy fences, because rails come in 8 and 16 foot lengths. Drop to 6 feet in high-wind areas or for heavy panels. Chain link can stretch to 10 feet between line posts.
How deep do fence posts need to go?
About one third of the post's total length should be in the ground, and the hole must reach below your local frost line so freeze-thaw cycles don't heave the post. For a 6 foot fence that means an 8 foot post set roughly 2 feet deep, or deeper where frost lines run 30 to 48 inches.
Do gates count toward my picket and rail totals?
No. Count gates separately. Each gate opening removes a short stretch of fence run but adds its own hardware, a frame kit or prebuilt gate, and usually beefier posts (a 4x6 or steel post on the hinge side resists sag).
Should I use 8 foot pre-built panels or stick-build?
Panels go up faster and cost less per foot, but they only work on flat or gently sloped ground. Stick-building (setting posts, then rails, then pickets) follows slopes cleanly and lets you rack the fence. Most pros stick-build anything with real grade changes.