Fence Calculator
Enter your fence length, post spacing, and rail rows — the post count and rail length update as you type, and the link in your address bar always reflects your numbers.
How this calculator works
Post spacing is 6-8 ft for most wood fences, sometimes up to 10 ft for certain styles, and it sets how many gaps fit along your fence: we divide length by spacing and round up, since a partial gap still needs a post at its far end. The number of posts is always one more than the number of gaps — with 3 gaps you need 4 posts, because every gap has a post at each end and adjacent gaps share their middle post. Skipping that +1 is the single most common mistake in fence material estimates. Rail rows are typically 3 for a classic 3-rail or picket fence, though the number varies by style; each row of rail runs the full length of the fence, so total rail length is simply length × rows.
Worked example
A 100 ft fence with posts every 8 ft and 3 rail rows: 100 ÷ 8 = 12.5, rounded up to 13 gaps. Add the final post and that's 14 posts — not 13, which is the wrong answer you'd get by stopping at length ÷ spacing and forgetting the closing end post. Rail length is 100 × 3 = 300 ft of rail total, since each of the 3 rows runs the full 100 ft.
Frequently asked questions
Why do I need one more post than length ÷ spacing?
This is the classic "fencepost counting error," and it trips up almost everyone the first time. Length ÷ spacing tells you how many gaps (spaces) fit along your fence line, not how many posts you need — and every gap has a post on both ends. Try it with small numbers: a 24 ft fence run with posts every 8 ft has 24 ÷ 8 = 3 gaps, but walk it off and you'll count 4 posts (start, two in the middle, and the end). That's gaps + 1, always — this calculator rounds your gap count up to a whole number and then adds that final post automatically.
How deep should fence posts be set?
A common rule of thumb is to set a post about one-third of its above-ground height into the ground, in concrete. For example, a post standing 6 ft above ground is often set roughly 2 ft deep. Frost depth, soil type, and local building code can all affect the right depth for your specific site, so treat this as a starting-point ratio rather than a guarantee for your yard.
Does this include gate posts?
No. Gate openings typically need heavier, more securely set posts than a standard line post, and the spacing on either side of a gate is usually planned around the gate's width rather than your regular post spacing. Plan gate posts separately from the numbers this calculator gives you.
What about corner posts?
Corner posts are real posts too, and a corner is shared between the two fence runs that meet there. If your layout has corners, the simplest accurate approach is to treat each straight run as its own separate calculation — measure and calculate one fence line at a time, from corner to corner, and this tool's post count and rail length still apply to each run.