Fence Materials Calculator
Calculates the number of fence posts needed for a given fence length and post spacing. Use it to plan materials and budget for wood, vinyl, or metal fence installations.
About this calculator
The number of fence posts is calculated using: Posts = ⌈fenceLength ÷ postSpacing⌉ + 1, where ⌈ ⌉ denotes rounding up to the next whole number (ceiling function). Adding 1 accounts for the closing post at the far end of the fence line — every section needs a post at both ends, so a fence with N sections always requires N + 1 posts. For example, a 100-foot fence with 8-foot spacing has ⌈100 ÷ 8⌉ = 13 sections, requiring 14 posts. The number of rails is then found by multiplying the number of sections by the rails per section. This calculation is essential for ordering the right quantity of materials and avoiding costly over- or under-purchasing.
How to use
Suppose your fence length is 80 feet and post spacing is 8 feet, with 2 rails per section. Step 1 — calculate posts: ⌈80 ÷ 8⌉ + 1 = 10 + 1 = 11 posts. Step 2 — calculate sections: 11 − 1 = 10 sections. Step 3 — calculate rails: 10 sections × 2 rails = 20 rails. So you need to purchase 11 posts and 20 rails. Always add 5–10% extra for cuts and defects, especially for wood fencing.
Frequently asked questions
Why do fence post calculations always add 1 to the number of sections?
A fence post is required at the start and end of every section. If you have 10 equal sections in a straight fence run, you need a post at the beginning of section 1 and at the end of section 10 — that is 11 posts in total. Forgetting the final post is one of the most common DIY fencing mistakes, resulting in a trip back to the hardware store. The formula ⌈length ÷ spacing⌉ + 1 automatically accounts for this closing post.
How does post spacing affect the strength and cost of a fence?
Closer post spacing (4–6 feet) creates a stronger, more rigid fence that better resists wind and lateral pressure — ideal for tall privacy fences or areas with high winds. Wider spacing (8 feet) uses fewer posts, reducing material and labour costs, but requires thicker or stronger rails to prevent sagging. Most standard residential wood fences use 6–8 foot spacing as a balance between cost and durability. Local building codes may specify maximum post spacing for certain fence types.
What other materials do I need to calculate beyond posts and rails for a wood fence?
Beyond posts and rails, a complete wood fence requires: pickets or panels to fill each section, post caps to protect the tops of posts from moisture, concrete or gravel for setting posts in the ground, screws or nails for fastening, and post-hole depth to factor into post length (typically one-third of total post length should be below grade). For a 6-foot-tall privacy fence, you would typically use 9-foot posts to allow 3 feet of burial. Gate hardware, hinges, and latches are additional items to budget for wherever an opening is required.