Fence Calculator
Fence materials: sections = ⌈length ÷ post spacing⌉, posts = sections + 1, pickets = length × 12 ÷ (picket width + gap). A 100 ft fence with 8 ft spacing has 13 sections and 14 posts, 26 rails at two per section, and 230 pickets of 5.5 in with 5% waste.
A wood fence is a repeating pattern of posts, rails and pickets. Once you know the run length and the spacing between posts, the rest follows. This calculator counts all three and lets you set the gap between pickets for privacy or spaced styles.
The formula
Sections = ⌈fence length ÷ post spacing⌉; posts = sections + 1
Rails = sections × rails per section
Pickets = ⌈length × 12 ÷ (picket width + gap) × (1 + waste %)⌉
Coverage and yield assumptions
A dog-ear cedar or pine picket is usually 5.5 in actual width (a "1×6"). Posts are commonly spaced 8 ft on center, which matches 8 ft rails and pre-built panels; 6 ft spacing is stiffer for tall fences or windy sites. Fences up to 4 ft typically use two rails, 6 ft fences three.
Layout and corners
Mark the corners and ends first, run a string line between them and space line posts evenly. Each corner and end is a post, and each gate needs two sturdy posts, often 6×6 or set deeper. If the run has corners, calculate each straight run separately and subtract the shared corner posts. Check property lines and any HOA rules before setting posts.
Setting posts
Set posts 1/3 of their above-ground height into the ground, at least 24 in, and below frost depth in cold regions. Use our post hole concrete calculator to estimate bags. Pressure-treated posts should be rated for ground contact (UC4A or higher).
Picket styles
Privacy fences butt pickets tight (gap 0) or use a board-on-board pattern that overlaps by about 1 in, which needs roughly 20% more pickets. Spaced picket fences use gaps of 2–3 in. Shadowbox fences alternate pickets on each side of the rails. Horizontal slat fences replace pickets with long boards fastened to posts; estimate slats like deck boards.
Hardware
- Use galvanized or stainless ring-shank nails or screws to avoid stains.
- Plan two fasteners per picket per rail.
- Rail brackets or toe-screws attach rails to posts.
- Gates need a hinge set, latch and anti-sag kit.
Common mistakes to avoid
- Forgetting gate posts and corner posts.
- Setting posts too shallow for tall privacy fences.
- Using posts not rated for ground contact.
- Ignoring property lines and HOA rules.
- Fastening pickets with uncoated nails that rust and stain.
Waste factor
5% covers split and cupped pickets. Use 10% for board-on-board or stepped fences on slopes where pickets are trimmed, and when buying lower-grade lumber with more culls.
Imperial and metric
Switch the toggle above the inputs to enter ft ↔ m, in ↔ cm. The page converts metric entries to imperial before calculating, using NIST factors (1 ft = 0.3048 m, 1 in = 2.54 cm), and shows key results in both systems.
Worked examples
Backyard privacy fence 100 ft
Inputs: fence length 100 ft; post spacing 8 ft; rails per section 2; picket width 5.5 in; gap between pickets 0 in; waste factor 5%.
Result: You need 14 posts, 26 rails and 230 pickets.
- Units to buy (rounded up): 230 pickets
- Sections: 13
6 ft privacy, 3 rails
Inputs: fence length 150 ft; post spacing 8 ft; rails per section 3; picket width 5.5 in; gap between pickets 0 in; waste factor 5%; cost per unit $3.6.
Result: You need 20 posts, 57 rails and 344 pickets.
- Units to buy (rounded up): 344 pickets
- Sections: 19
- Estimated material cost: $1,238.40
Front picket fence, 2.5 in gaps
Inputs: fence length 60 ft; post spacing 6 ft; rails per section 2; picket width 3.5 in; gap between pickets 2.5 in; waste factor 5%.
Result: You need 11 posts, 20 rails and 126 pickets.
- Units to buy (rounded up): 126 pickets
- Sections: 10
Quick reference for common sizes
The table repeats the first worked example at smaller and larger sizes, keeping every other setting the same, so you can see how the fence calculator result scales.
| Inputs | Result |
|---|---|
| fence length 50.0 ft; post spacing 4.0 ft; rails per section 2; picket width 5.5 in; gap between pickets 0 in; waste factor 5% | You need 14 posts, 26 rails and 115 pickets |
| fence length 75.0 ft; post spacing 6.0 ft; rails per section 2; picket width 5.5 in; gap between pickets 0 in; waste factor 5% | You need 14 posts, 26 rails and 172 pickets |
| fence length 150.0 ft; post spacing 12.0 ft; rails per section 2; picket width 5.5 in; gap between pickets 0 in; waste factor 5% | You need 14 posts, 26 rails and 344 pickets |
| fence length 200 ft; post spacing 16 ft; rails per section 2; picket width 5.5 in; gap between pickets 0 in; waste factor 5% | You need 14 posts, 26 rails and 459 pickets |
| fence length 300 ft; post spacing 24 ft; rails per section 2; picket width 5.5 in; gap between pickets 0 in; waste factor 5% | You need 14 posts, 26 rails and 688 pickets |
Limitations
Counts are for a straight run. Gates, corners and slopes change post and picket counts. Concrete and hardware are estimated separately.
Frequently asked questions
How many posts for a 100 ft fence?
With 8 ft spacing, 14 posts: 13 sections plus one.
How far apart should fence posts be?
Usually 6–8 ft on center; 8 ft is common for wood privacy fences.
How many pickets per 8 ft section?
About 18 pickets of 5.5 in with no gap.
How many rails do I need?
Two rails for fences up to about 4 ft, three for 6 ft fences.
Do I need a permit for a fence?
Often for fences over 6 ft or in front yards. Check with your city and HOA.
Sources
- American Wood Council. Span tables and Prescriptive Residential Wood Deck Construction Guide (DCA 6). https://awc.org/
- USDA Forest Products Laboratory. Wood Handbook: Wood as an Engineering Material (FPL-GTR-282). https://www.fpl.fs.usda.gov/documnts/fplgtr/fpl_gtr282.pdf
- Common Ground Alliance. Call 811 before you dig. https://call811.com/
Method details: how we calculate.