Fence Calculator
This fence calculator works out the posts, rails and pickets for a straight run of wood fence, including gates, and how deep to set the posts. Enter the fence length and layout, add prices if you have them, and press Calculate.
Fence Calculator
How to calculate fence materials
Sections = (fence length − gate widths) ÷ post spacing, rounded up Posts = sections + 1 + 1 per gate Rails = sections × rails per section Pickets = fenced length (in) ÷ (picket width + gap), rounded upExample: 100 ft of 6 ft fence with one 4 ft gate, posts every 8 ft, 3 rails and 5½ inch pickets with no gap.
- Sections: 100 − 4 for the gate = 96 ft of fence. 96 ÷ 8 = 12 sections.
- Posts: 12 sections + 1 = 13, + 1 for the gate = 14 posts.
- Rails: 12 sections × 3 = 36 rails.
- Pickets: 96 ft × 12 = 1,152 in ÷ 5.5 = 209.5, rounded up to 210 pickets.
This assumes each stretch of fence between gates divides evenly into sections. If a gate splits the fence into runs that don't, each extra part-section needs one more post. Add 5–10% extra pickets for split or warped boards. Gates are usually bought or built as a kit with their own hardware.
Post depth
Set posts at least one-third of the fence height into the ground, and never less than 2 feet. A 6 ft fence needs posts about 2 ft deep, so buy 8 ft posts. In places where the ground freezes, the hole should go below the frost line, or frost can push the posts up over the winter. Your local building department can tell you that depth. Put a few inches of gravel in the bottom for drainage, and use the round column tab of the concrete calculator to work out concrete for each hole.
| Fence height | Minimum post depth | Post length to buy |
|---|---|---|
| 3 ft | 2 ft | 6 ft |
| 4 ft | 2 ft | 6 ft |
| 5 ft | 2 ft | 8 ft |
| 6 ft | 2 ft | 8 ft |
| 8 ft | 2 ft 8 in | 12 ft |
Before you dig, call 811 (in the US) to have underground utility lines marked. It's free. Check property lines and any HOA or city rules on fence height too.
Frequently asked questions
How many fence posts do I need?
Take away the gate openings, divide the rest by the post spacing, round up, and add one for the end post. Then add one post for each gate and each corner. 100 feet with a 4-foot gate leaves 96 feet: at 8-foot spacing that is 12 sections, so 13 posts, plus 1 for the gate = 14.
How deep should fence posts be?
A common rule is to bury at least one-third of the fence height, and at least 2 feet. A 6 ft fence needs posts about 2 ft deep, so an 8 ft post. In cold climates, set posts below the frost line to stop frost heave. Your local building department can tell you the depth.
How far apart should fence posts be?
6 to 8 feet is standard for wood fences. 8 feet suits common 8 ft rails. Use closer spacing for tall fences, windy sites or heavy boards.
How many rails does a fence need?
Two rails per section for fences up to about 4 ft tall, and three for 5–6 ft fences, so the pickets don't warp in the middle.
How much concrete per fence post?
For a 4×4 post in a 10-inch hole 2–3 feet deep, about 0.9–1.4 cubic feet once the post is subtracted. That's roughly 3 to 4 bags of 50 lb fast-setting mix, at about 0.375 cubic feet per bag. Check the yield printed on the bag. Use the concrete calculator's round column tab for other hole sizes.
See also
- Concrete Calculator: Cubic yards and bag counts for slabs, footings and columns.
- Board Foot Calculator: Board feet and cost for one board or a lumber list.
- Square Footage Calculator: Area of rooms and odd-shaped spaces, plus a cost estimate.
- Cubic Yard Calculator: Cubic yards of any bulk material from length, width and depth.
Last updated: November 23, 2026