How this calculator works
Enter the total fence length, the maximum spacing you want between posts, and either your picket width and gap (for a board-by-board picket fence) or just leave the picket fields at their defaults if you're planning to use pre-made fence panels instead — the panel count is calculated automatically as one panel per post span. Add how many horizontal rail rows your fence design uses (2 for a shorter fence, 3 for a typical 6 foot privacy fence) to get the total rail pieces needed.
The post count uses the classic 'fencepost problem': a straight fence line always needs one more post than it has spans between posts, a detail that's easy to undercount by one if you just divide length by spacing. This calculator fits as many equal, evenly spaced spans as possible within your maximum spacing and adds the final post automatically.
The formula
Spans = floor(fence length ÷ max post spacing), minimum 1Posts = spans + 1Pickets = ceiling(fence length ÷ (picket width + gap)); rails = rail rows × spansWhen the fence length isn't an exact multiple of your spacing, the actual on-site gap between posts works out slightly different from the spacing you entered once it's distributed evenly across the whole spans — plan for the final spacing to be adjusted a little on site.
Worked example: a 100 ft fence, 8 ft post spacing, 3 rail rows
- Spans: floor(100 ÷ 8) = 12.
- Posts: 12 + 1 = 13.
- Pickets, at a 3.5 in picket width plus a 2.5 in gap (6 in total pitch): 100 ft = 1,200 in, so 1,200 ÷ 6 = 200 pickets.
- Rails: 3 rows × 12 spans = 36 rail pieces.
Frequently asked questions
Why is the post count 13 and not 12 for a 100 ft fence at 8 ft spacing?
Picture a short fence with just one span between two posts — that's 1 span but 2 posts, not 1. Every additional span adds one more post, so a fence with N equal spans always needs N + 1 posts. It's a classic off-by-one trap if you just divide length by spacing.
Do gates need extra posts?
Yes. Each gate needs its own posts sized to the gate's width and hardware, which usually doesn't match your regular fence-post spacing. Plan gate locations first, treat each gate opening as its own separate segment, and run the remaining fence-line length through this calculator without the gate width included.
How do I choose between rail rows?
2 rail rows (top and bottom) are common for a shorter, 3 to 4 foot fence. Taller fences — 6 feet and up, especially privacy or wind-load-exposed fences — commonly use 3 rows for added rigidity.
What if my fence has corners?
Calculate each straight run separately and add the results together, since the post-spacing math assumes one continuous straight line. Corner posts typically need to be counted once, not twice, if a corner is shared between two runs you calculated separately.
Why give a picket width and gap instead of just a panel width?
Picket width and gap let the calculator work out an individual picket count for board-by-board picket fences. If you're using pre-made panels instead, the panel count (one per post span) doesn't depend on picket sizing at all — just use the posts and panels figures and ignore the picket count.