What this calculator does
Find out how many posts, rails, pickets and bags of concrete you need for your fence. A typical wood fence is built in sections. There's a post at each end, two or three crosswise rails between the posts, and pickets fastened to the rails. Your fence length and post spacing tell you how many sections you need. That sets the number of posts and rails. The picket width and gap set the number of pickets. Posts are usually set in concrete, so the hole size decides how many bags to buy.
This calculator builds that shopping list for one straight run of fence. It counts sections, posts and rails. It counts pickets for a privacy or spaced-picket style, and the concrete needed around each post. It shows a rule-of-thumb hole depth for your fence height, and totals the cost if you enter prices. All of it is an estimate for planning a purchase. Post depth, footings and height limits are set by local building codes, frost depth and any homeowners' association rules. Check those before you dig.
Where it's used
Why this math matters outside the classroom:
- Post count. A 100 ft fence with posts every 8 ft needs 13 sections (12.5 rounded up) and 14 posts.
- Picket count. A 72 in section with 3.5 in pickets and 1.5 in gaps fits about 72 ÷ 5 ≈ 14.4 pickets, so builders plan on 15.
- Post depth. A common rule of thumb sets posts about one-third of their above-ground height into the ground, so a 6 ft fence uses 2 ft holes.
- Concrete per hole. Fence installers find the concrete for each hole as the volume of a cylinder minus the square post standing in it.
- Material budgets. Homeowners compare wood and vinyl fencing by multiplying each count of posts, rails and pickets by its price.
How to use it
- Enter the total length of fence, the post spacing and the fence height.
- Choose the style and the number of rails per section. For pickets, enter their width. For spaced pickets, enter the gap too.
- Add any extra posts for corners and gates. Then enter the post size, hole diameter, hole depth and concrete bag size.
- If you want a cost, enter prices. Then read the posts, rails, pickets, concrete and total.
What the inputs mean
- Post spacing (on center)
- Spacing is measured from the center of one post to the center of the next. Wider spacing saves posts but lets rails sag. 8 ft suits standard 8 ft rails.
- Rails per section
- Fences over about 5 ft usually get 3 rails.
- Picket width
- The real, measured width. A picket sold as 6 in is actually about 5.5 in wide.
- Gap between pickets
- Many spaced picket fences use a gap about the picket width or less. Pool fences and some local rules limit the size of the opening, so check them first.
- Extra posts for corners, ends and gates
- The count assumes one straight run. A corner that falls between regular posts needs an extra post. Gates usually need their own post on each side.
- Post size (square, actual)
- A 4×4 post is about 3.5 in square.
- Post hole diameter
- A common guide is about three times the post width: 10–12 in for a 4×4 post, and 14–18 in for a 6×6.
- Post hole depth
- A common rule of thumb is to bury one third to one half of the above-ground height, never less than about 24 in. In cold climates, the bottom of the hole should sit below the frost line. That's the depth the ground freezes to, and local building departments publish it.
- Price per post
- Optional. An example price; enter your supplier's, or leave blank.
- Price per rail
- Optional. An example price; enter your supplier's, or leave blank.
- Price per picket
- Optional. An example price; enter your supplier's, or leave blank.
- Price per bag of concrete
- Optional. An example price; enter your supplier's, or leave blank.
Formula and method
sections = length ÷ post spacing, rounded up; posts = sections + 1 + extra posts rails = sections × rails per section pickets = length (in) ÷ (picket width + gap) × (1 + waste ÷ 100), rounded up concrete per post (ft³) = (π × (hole diameter ÷ 2)² − post width²) × depth ÷ 1,728 bags = concrete per post × posts ÷ bag yield, rounded up cost = Σ count × price
In the formulas, π (pi) is about 3.14159 and Σ means "add them all up". A fence divided into n sections needs n + 1 posts. Pickets cover the full length, and a privacy style has no gap. The concrete fills the round hole, minus the space the post takes up. There are 1,728 cubic inches in a cubic foot, so dividing by 1,728 converts the units.
Bag yield is how much concrete one bag makes. The figures are the rough ones printed on pre-mixed bags: about 0.30 ft³ for 40 lb, 0.375 for 50 lb, 0.45 for 60 lb and 0.60 for 80 lb. Bags are added up across all posts and rounded up once, since a part bag carries over to the next hole.
Worked example
A 100 ft privacy fence is 6 ft tall, with posts 8 ft apart and 3 rails per section. It uses 5.5 in pickets with 5% extra. The 4×4 posts (3.5 in) go in 10 in holes 30 in deep, using 80 lb bags. Example prices: $15 per post, $6 per rail, $3 per picket, $7 per bag.
- Sections: 100 ÷ 8 = 12.5, rounded up to 13; posts: 13 + 1 = 14; rails: 13 × 3 = 39.
- Pickets: 1,200 ÷ 5.5 = 218.18; with 5%: 229.09, rounded up to 230.
- Concrete per post: (π × 5² − 3.5²) × 30 ÷ 1,728 = 1.1509 ft³, which is 1.92 bags of 80 lb.
- Total bags: 1.1509 × 14 ÷ 0.6 = 26.85, rounded up to 27.
- Cost: 14 × $15 + 39 × $6 + 230 × $3 + 27 × $7 = $1,323.00, or $13.23 per foot.
Result: 14 posts, 39 rails, 230 pickets and 27 bags of concrete, about $1,323 in materials. The rule-of-thumb hole depth for a 6 ft fence is 24–36 in.
Understanding the result
The counts are what to buy for a straight run. Posts must be long enough for the height above ground plus the depth in the ground. The post length result shows this. Round up to the next length the store sells.
The cost covers only the items you price. Fasteners, gate hardware, post caps, gravel for drainage and stain or sealer add to the total.
Assumptions and limitations
- It's one continuous run with evenly spaced posts. The last section may be shorter than the others.
- Pickets run the full length of the fence, and each rail spans one section.
- Every post sits in the same size of concrete-filled hole.
- Gates, corners and slopes need extra posts and adjustments that a single straight run doesn't cover. Add extra posts yourself.
- Board-on-board, shadowbox and panel fences use different picket and rail counts.
- The depth rule of thumb isn't a building code requirement. Frost depth, soil, wind and local rules decide the real depth. Find out where buried utility lines are before you dig.
Frequently asked questions
How deep should fence posts be?
A widely used rule of thumb is one third to one half of the fence's above-ground height, with a minimum of about 24 in. For a 6 ft fence, that means 24 to 36 in. In freezing climates, the hole should reach below the frost line, so frozen ground doesn't push the posts up (heaving). Check your local frost depth.
How many bags of concrete per fence post?
It depends on the hole. A 4×4 post in a 10 in hole 30 in deep needs about 1.15 ft³. That's just under two 80 lb bags. Wider or deeper holes need more, which is why the calculator works from the hole size you enter.
Should a fence have two or three rails?
Fences up to about 4 or 5 ft are often built with two rails. Taller fences, such as 6 ft privacy fences, usually get three. The third rail keeps pickets flat and reduces warping in the middle.
How do I count pickets for a fence?
Divide the fence length in inches by the picket width plus the gap. A 100 ft privacy fence with 5.5 in pickets and no gap needs about 219 pickets before waste. Adding a few percent covers split or warped boards.
How this calculator is checked
Method: Section counting with ceiling division; picket count from width plus gap; annular concrete volume of a cylindrical hole less a square post; typical pre-mixed bag yields; one-third to one-half above-ground height rule of thumb for depth. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Fence Calculator on your own website or blog for free. Paste this code where you want it to appear: