Fence Calculator
Calculate a full fence material list — posts, rails, pickets, and sections — for a rectangular yard from perimeter, post spacing, and picket width.
How this calculator works
The calculator treats the yard as a rectangle, finds the perimeter, then derives every part: posts spaced along the perimeter, sections between posts, rails per section, and pickets across the full length.
Formula: Perimeter = 2 × (length + width). Posts = ⌊perimeter ÷ spacing⌋ + 1. Sections = ⌈perimeter ÷ spacing⌉. Rails = sections × rails per section. Pickets = ⌈perimeter in ÷ (picket width + gap)⌉.
Worked example
A 40 ft × 30 ft yard, 8-foot post spacing, 2 rails per section, 5.5-inch pickets with a 0.5-inch gap:
- Perimeter: 2 × (40 + 30) = 140 ft
- Posts: ⌊140 ÷ 8⌋ + 1 = 18 posts
- Sections: ⌈140 ÷ 8⌉ = 18 sections
- Rails: 18 × 2 = 36 rails
- Pickets: ⌈(140 × 12) ÷ 6⌉ = 280 pickets
Reference (8 ft spacing, 2 rails)
| Perimeter | Posts | Rails | Pickets (6 in) |
|---|---|---|---|
| 100 ft | 13 | 26 | 200 |
| 140 ft | 18 | 36 | 280 |
| 200 ft | 26 | 50 | 400 |
How to measure
Measure the two sides of the yard you’re enclosing. For a straight single run rather than a full perimeter, enter the run length and set the other side to zero. Pair with the Fence Post Calculator to size concrete per post.
Frequently asked questions
What does this fence calculator include?
It produces the whole material list at once for a rectangular yard: posts, rails, pickets, and the number of sections, plus the total perimeter. It's the fast way to price a full fence rather than counting each part separately.
How far apart should fence posts be?
8 feet is standard for wood and vinyl panel fencing, matching common panel and rail lengths. Never exceed your rail length, and tighten spacing in high-wind areas or for heavy gates.
How many rails per section do I need?
Two rails (top and bottom) is standard for fences up to about 5 feet; taller privacy fences usually add a third middle rail to keep pickets from warping. Set the rails-per-section field to match your design.
How are pickets counted?
Pickets are the perimeter length divided by the picket width plus the gap between pickets. A 5.5-inch picket with a half-inch gap covers 6 inches, so a 140-foot perimeter needs 280 pickets. Set both the picket width and gap for your style — a board-on-board or shadowbox fence uses far more.
Does this cover a gate?
The post, rail, and picket counts cover the fence line; a gate reuses posts already in the count but needs heavier hardware. Subtract the gate opening's pickets if it's a metal or pre-built gate.
Estimates only. Verify quantities with your supplier before purchasing.