Fence Calculator
This free fence calculator shows how many posts, panels, and rails you need. Enter the fence length, post spacing, and rails per section to get the material counts.
How many posts, panels & rails?
How the fence calculator works
The fence calculator divides the fence length by the post spacing and rounds up to get the number of sections, then adds one post to close an open run – so posts equal sections plus one. Rails are the sections multiplied by the rails per section, which is usually two for a 4-foot fence and three for a 6-foot privacy fence. The core rule is posts = (length ÷ spacing) + 1.
Eight feet on center is the standard spacing for wood and vinyl fences. Drop to 6 feet in high-wind areas or for heavy privacy panels, and chain link can stretch to 10 feet. Closer spacing costs more but stiffens the fence and reduces sagging over time, so match the spacing to your fence type and local conditions.

Worked example
A straight 100-foot fence at 8-foot spacing needs 100 ÷ 8 = 12.5, rounded up to 13 sections, so 14 posts. A 6-foot privacy fence with three rails per section needs 13 × 3 = 39 rails. Add one post at each corner and two per gate, and order about 10% extra pickets, which ship in bundles.
Post depth, corners, and gates
A fence is only as strong as its posts. Bury at least one-third of the total post length – so a 6-foot fence uses an 8-foot post set about 2 feet deep – and in cold climates dig at least 6 inches below the frost line to prevent frost heave from lifting posts. Set gate and corner posts deeper and in concrete, since they carry the most stress.
University extension programs give research-based guidance on fence layout and post setting: the University of Georgia Extension covers corner and brace assemblies, and the University of Wisconsin Extension explains how soil type affects setting posts.
Measuring tips
Walk and measure the full perimeter, marking corners and gate openings, and subtract gate widths before counting rails and pickets. Adjust the last section rather than forcing an exact multiple of the spacing, and always call 811 a few days before digging so utility lines are located and marked – hitting a buried line is costly and dangerous.
Frequently asked questions
How many fence posts do I need?
Enter the fence length and post spacing. The calculator divides length by spacing, rounds up for sections, and adds one post to close the run. A 100-foot fence at 8-foot spacing needs 14 posts.
How far apart should fence posts be?
Eight feet on center is standard for wood and vinyl fences. Use 6 feet in high-wind areas or for heavy privacy panels, while chain link can span up to 10 feet.
How many rails does a fence need?
Use two rails per section for fences up to about 4 feet and three for 6-foot privacy fences. Multiply the number of sections by the rails per section for the total.
How deep should fence posts be?
Bury at least one-third of the total post length, so a 6-foot fence uses an 8-foot post about 2 feet deep. In cold climates, dig 6 inches below the frost line to avoid frost heave.
Do I need extra posts for gates and corners?
Yes. Add one post at every corner and two per gate opening. Gate and corner posts should be larger, set deeper, and anchored in concrete because they bear the most load.
