How to use the fence calculator
Choose imperial or metric first. Fence length, post spacing and gate width are then in feet or metres, while picket width and gap are in inches or centimetres.
Enter the total length of the fence line including any gate openings, the centre-to-centre distance between posts, how many gates you plan and how wide each opening is. Then set the rails per section, the actual width of your pickets or boards, the gap you want between them and a waste allowance.
The formula in words
First the gate openings are subtracted from the total length to get the fenced length. That length is divided by the post spacing and rounded up to give the number of sections (bays); a short final bay still counts as a full section.
Posts = sections + gates + 1. Every bay and every gate opening sits between two posts, and a straight run always needs one more post than it has openings. Rails = sections × rails per section.
Pickets = fenced length (converted to inches or cm) ÷ (picket width + gap), rounded up. The waste percentage is then added and rounded up again to give the number to buy.
Worked example
A 100 ft fence with one 4 ft gate, posts every 8 ft, 2 rails per section and 5.5 in pickets with a 0.25 in gap. The fenced length is 100 − 4 = 96 ft, which is 96 ÷ 8 = 12 sections. Posts = 12 + 1 + 1 = 14, and rails = 12 × 2 = 24.
96 ft is 1,152 in. Each picket plus gap covers 5.75 in, so 1,152 ÷ 5.75 = 200.3, rounded up to 201 pickets. Adding 5% gives 211.05, so buy 212 pickets.
Practical tips
Corners and ends need sturdier posts, and a fence with several corners or separate runs needs one extra post per break in the line, so count each straight run separately if your layout is not a single line. Rails usually come in 8 ft or 2.4 m lengths, so match your post spacing to the rail length to avoid offcuts.
Results are estimates for a level, straight fence. Slopes, stepped panels and gate hardware can change the count, so check your plan before ordering.
Frequently asked questions
How far apart should fence posts be?
Most wooden fences use 6 to 8 ft (1.8 to 2.4 m) between post centres. Use the closer spacing for tall privacy fences, windy sites or heavy panels.
How many pickets do I need per 8 ft section?
With 5.5 in pickets and a 0.25 in gap, each picket covers 5.75 in, so an 8 ft (96 in) section needs about 17 pickets. With no gap it needs 18.
Do gates need extra posts?
Yes. Each gate adds one post compared with a solid fence, because the opening needs a post on both sides. Gate posts should be heavier and set deeper than line posts.
How much extra material should I buy?
A 5 to 10% allowance on pickets covers split, warped or miscut boards. Many people also buy one spare post and rail in case of damage.