Fence Calculator — Posts, Pickets & Panels

The whole fence run in one calculation: total length in — post count, spacing and picket estimates out.

Fence Calculator

Paste it on your own page or wiki — no signup, no tracking script.

What this fence calculator counts

A fence is ordered in three separate units — posts, pickets and rails — and they are not derived the same way. This calculator does the first and most important one: it turns a measured fence run (the total linear feet of fence line) plus a post spacing into a post count and the spacing you will actually set. Feed it the run and the spacing and it returns the number of posts; change either and the other line updates.

Everything downstream — pickets, rails, post-hole concrete, stain — is driven by that run and that post layout, so getting the posts right first is what keeps the rest of the order from drifting. A single miscounted post is a second trip to the yard; a miscounted batch is a fence that runs long or short at the last bay.

Posts sit on centre, not in the gap

Fence posts are almost always laid out on centre (often written “on center”): you measure from the centre of one post to the centre of the next. That centre-to-centre distance is what the calculator asks for and what its spacing dropdown defaults to. The distinction matters because a 4×4 post is about 3½ inches wide once it is dressed, so a “6-foot spacing” quoted on centre leaves a clear gap nearer 5 ft 8 in, while a true 6-foot clear gap would need a centre-to-centre distance closer to 6 ft 4 in. Confusing the two is one of the most common fence layout mistakes, and it compounds down a long run.

The post mode of this calculator always works on the on-centre reading — the one the dropdown label names. If you have paced out a clear gap instead, convert it before you type it in: on centre = clear gap + one post width.

The post-count formula

Two lines do the whole job:

posts = floor( run in inches ÷ spacing in inches ) + 1
actual spacing = run ÷ ( posts − 1 )

The run is converted to inches so it shares a unit with the spacing. Dividing and rounding down counts the whole intervals that fit end to end; the +1 turns intervals into posts, because the last post has no interval after it. Run it straight through for a 100-foot run at 8-foot (96-inch) spacing:

posts = floor( 1,200 ÷ 96 ) + 1 = floor( 12.5 ) + 1 = 12 + 1 = 13 posts

1,200 ÷ 96 is 12.5, and the leftover half-interval is dropped by the floor. That is the calculator being deliberately conservative: it never stretches the spacing past your number just to fill the run. The price is a slightly shorter last bay, and the second line reports it — 100 ÷ (13 − 1) = 8.33 feet on centre. Your posts end up a touch tighter than the 8 feet you typed, and the fence still lands on a post rather than running long.

Three worked examples

Three runs, three answers. Read the actual spacing line before you cut anything — it is the number that decides where the last post really falls.

Example 1 — a 100 ft back-yard run at 8 ft on centre

Enter 100 for the run and 96 for the spacing (8 feet in inches). The calculator returns 13 posts at an actual spacing of 8.33 feet. The half-interval it dropped makes the last bay roughly 8 inches shorter than the rest — invisible on a solid privacy fence, and it keeps the run from over-running the property line.

Example 2 — a 150 ft property line at 6 ft on centre

Enter 150 and 72 (6 feet in inches). The result is 26 posts at an actual spacing of exactly 6 ft. Here 150 × 12 = 1,800 in divides evenly by 72, so nothing is dropped: floor(25) + 1 = 26, and the actual spacing lands on the number you typed. When the run happens to be a whole multiple of the spacing, both lines agree.

Example 3 — a 240 ft pasture line at 8 ft on centre

Enter 240 and 96. The calculator returns 31 posts at an actual spacing of exactly 8 ft. 240 × 12 = 2,880 in ÷ 96 = 30 exactly, so again the spacing is true. A long agricultural run like this is where the count carries real money — 30 posts and 31 posts are different orders once you add posts, concrete and labour — and it is the divide that decides which.

ExampleRunSpacing (on centre)PostsActual spacing
Back-yard run100 ft8 ft (96 in)138.33 ft
Property line150 ft6 ft (72 in)266.00 ft
Pasture line240 ft8 ft (96 in)318.00 ft

Corners, gates and end posts

The count above is for a straight run. Real fences turn corners and have openings, and each one changes the order:

A practical rule for a typical suburban lot: take the straight-run count, then add one post per corner, two per gate opening, and one for each end that meets a structure. That total — not the raw line count — is what you buy.

Pickets and rails follow the posts

Post count is only the frame. Picket count per section follows the section width and the board:

pickets = floor( ( section width + gap ) ÷ ( board width + gap ) )

A board-and-gap layout — the small gap that lets boards dry without cupping — is what a privacy fence uses. Run the same spacing engine with a 5½-inch picket and a 1½-inch gap across an 8-foot section and it returns 13 pickets; the calculator adds a 10% cut allowance and suggests buying 15. Close the gap to ¼ inch and the count rises to 16 per section. That is three extra boards per section on the gap alone, so the spacing you pick is worth real money on a long fence. Multiply per-section pickets by the number of sections (posts − 1) for the total.

Rails run horizontally and their count is a rule, not a formula: two rails for a 4–6 ft fence and three rails above that. A 6-foot fence with 12 sections therefore needs 24 rail pieces before waste. Rails are cut from the same stock as the pickets and are usually the first part to rot when a fence fails, which is why a pressure-treated rail on a metal bracket outlasts a nailed one by years.

Choosing a spacing — and when to tighten it

Six to eight feet on centre is the working range for a wood privacy fence built from 2×4 rails and 3½-inch posts. Wider spacing saves posts but puts more span on every rail, and rails sag first. Three situations push you toward the tight end of the range:

On a short decorative or garden run, the opposite applies — 8 ft is fine, and the post count drops fast. The formula does not care which you choose; it just turns your choice into a count.

Where the estimate usually goes wrong

Once the post count is settled, size the post-hole concrete with the post-hole concrete calculator, price the boards with the vinyl fence calculator for a no-rot alternative, and work out the finish with the fence stain calculator.

Sources and standards

Where these figures come from

Every formula on this page is implemented from the published reference material below, and every worked example was produced by running this calculator rather than by hand. Post spacing is a design choice, so the calculator lets you set it rather than assuming one jurisdiction’s code.

Figures, formulas and reference tables last checked: 13 October 2026.

FAQ

How many posts do I need for a 100 ft fence at 8 ft spacing?

Enter 100 ft and 96 in (8 ft) on centre and the calculator returns 13 posts at an actual spacing of 8.33 ft. The maths is floor(1,200 ÷ 96) + 1 = 13, and 100 ÷ 12 bays = 8.33 ft real spacing.

Is fence post spacing measured on centre or clear gap?

On centre — from the middle of one post to the middle of the next. The calculator asks for that figure. A 4×4 post is about 3½ in wide, so an 8 ft on-centre spacing leaves a clear gap of about 7 ft 8½ in, not 8 ft. If you measured a clear gap, add one post width to convert it.

How many posts for a 150 ft fence at 6 ft on centre?

26 posts at an actual spacing of exactly 6 ft. 150 × 12 = 1,800 in, and 1,800 ÷ 72 = 25 intervals, so floor(25) + 1 = 26. The run is a whole multiple of the spacing, so no bay is short.

Why did my post count round down and not up?

The formula uses the floor (round down) on purpose: it never stretches the spacing past your number to fill the run. The leftover fraction becomes one shorter final bay, and the calculator reports the real spacing — for a 100 ft run at 8 ft that is 8.33 ft, not 8 ft.

How many posts for a 240 ft fence at 8 ft on centre?

31 posts at an actual spacing of exactly 8 ft. 240 × 12 = 2,880 in ÷ 96 = 30 intervals, so 30 + 1 = 31 posts. On a long run the difference between 30 and 31 posts is a visible line item once posts, concrete and labour are added.

How many pickets per 8 ft section?

With a 5½ in picket and a 1½ in gap, an 8 ft section takes 13 pickets, and the calculator suggests buying 15 with its 10% cut allowance. Close the gap to ¼ in and it rises to 16 per section — three extra boards on the gap alone.

How many rails does a fence need?

Two rails for a fence 4–6 ft tall and three rails above that. Rails run horizontally between posts, so a 6 ft fence with 12 sections needs 24 rail pieces before waste. Use pressure-treated rails on metal brackets where the fence has to last.

Do I add extra posts for corners and gates?

Yes. The straight-run count is the frame only. Add one heavier post per corner, two heavier posts per gate opening, and one post wherever a line meets a building. Subtract the gate width from the run you enter so the pickets do not double-count the opening.

How deep should fence posts be set?

Bury about one-third of the post’s above-ground height — roughly 2 ft for a 6 ft fence on an 8 ft post. In frost country the footing must reach below the local frost line (often 36–48 in), so use a 9–10 ft post there. Dig the hole about three times the post width.

What spacing should I use for a tall or windy fence?

Drop toward 6 ft on centre. A fence over 6 ft tall, or one on an exposed corner, sees much more wind load per post, and closer spacing spreads that load over more posts and puts less span on each rail.

More project calculators

Have a suggestion?

Missing a feature or found something off? Tell us — user suggestions decide what we build next.