Calculators · Fence Calculator
Fencing & decksFence Calculator
Enter your fence runs, gates and post spacing to count the posts, rails and pickets or panels you need, with the math shown.
Fence posts needed
—
How to calculate fence posts, rails and pickets
A straight fence run is a row of equal sections. Divide the length by the post spacing and round up to get the number of sections. A run of n sections needs n + 1 posts, because the last section also has a post at its far end. That is the classic mistake: 100 feet with posts 8 feet apart is 100 ÷ 8 = 12.5, which rounds up to 13 sections, and 13 sections need 14 posts, not 13. With 3 rails per section the same run needs 13 × 3 = 39 rails.
| Item | Formula | Example |
|---|---|---|
| Net length | run length − gates × gate width | 100 − 1 × 4 = 96 ft |
| Sections | net length ÷ spacing, rounded up | 96 ÷ 8 = 12 sections |
| Posts in a run | sections + 1 + number of gates | 12 + 1 + 1 = 14 posts |
| Posts at a corner | two runs share one post, so take 1 off per corner | A 40 × 30 ft yard (4 runs, 4 corners) needs 18 posts |
| Rails | sections × rails per section | 12 × 3 = 36 rails |
| Pickets | (net length + gap) ÷ (width + gap), rounded up | (1,152 + 0.5) ÷ 6 = 192.08, so 193 |
| Concrete per hole | π × (diameter ÷ 2)² × depth | π × 0.4167² × 3 = 1.64 ft³ |
Because sections are rounded up, the real spacing comes out a little under the number you typed. The 13 sections of the 100 foot run are 7.69 feet apart, not 8. The calculator shows that actual spacing in the result.
Example: 100 feet of picket fence with one gate
One straight run of 100 feet has a 4 foot gate. The posts are 8 feet apart, the fence has 3 rails per section and 5.5 inch pickets with 0.5 inch gaps. It stands 6 feet above ground, the holes are 10 inches wide, and you add 10% waste. These are the figures you get if you type the same values into the calculator.
| Step | Operation | Result |
|---|---|---|
| Net length | 100 − 1 × 4 | 96 ft |
| Sections | 96 ÷ 8 | 12 sections |
| Posts | 12 + 1 + 1 gate (10 line, 2 end, 2 gate posts) | 14 posts |
| Rails | 12 × 3 = 36, plus 10% = 39.6, rounded up | 40 rails |
| Pickets | (1,152 + 0.5) ÷ 6 = 192.08, rounded up to 193, plus 10% = 212.3, rounded up | 213 pickets |
| Post length | 6 ÷ (1 − 1/3), with 1/3 buried | 9 ft, 3 ft in the ground |
| Concrete per hole | π × (10 ÷ 12 ÷ 2)² × 3 | 1.636 ft³ |
| Concrete for 14 holes | 1.636 × 14 | 22.91 ft³ = 0.848 yd³ |
How far apart should fence posts be?
Millard Lumber, a lumber retailer, says to set fence posts about 6 to 8 feet apart, and that the right figure depends on the type of fence, the terrain and the purpose. Family Handyman, an informational site, gives 8 feet as the standard spacing for wood fences and warns that rails sag when posts are too far apart. Both were checked in October 2026. Tighter spacing means more posts, as this 100 foot run shows.
| Post spacing | Sections | Posts | Rails (3 per section) |
|---|---|---|---|
| 6 ft | 17 | 18 | 51 |
| 7 ft | 15 | 16 | 45 |
| 8 ft | 13 | 14 | 39 |
Posts and rails by fence length
This table assumes one straight run, no gates, posts 8 feet apart and 3 rails per section.
| Fence length | Sections | Posts | Rails |
|---|---|---|---|
| 50 ft | 7 | 8 | 21 |
| 100 ft | 13 | 14 | 39 |
| 150 ft | 19 | 20 | 57 |
| 200 ft | 25 | 26 | 75 |
| 250 ft | 32 | 33 | 96 |
Gates, corners and fence ends
- Gates. Enter the whole line, gate openings included, and the number of gates in each run. The calculator subtracts the gates, counts the sections of the rest and gives every gate two gate posts. A gate splits its run in two, so it adds one post to the count. It also assumes there is fence on both sides of each gate.
- Corners. Enter every straight stretch as its own run. Where two runs meet they share one post, so the calculator takes one post off per corner. A fence that closes into a loop needs at least 3 runs and has as many corners as runs.
- Short pieces. The sections come from the total net length of each run. If a gate sits close to one end, that short piece may need its own section. Count it as a separate run.
- Ends. The two far ends of an open run each get a post. A run that is not joined to another at either end has 2 end posts.
- Panels. The Outdoor Essentials panel worksheet counts 1 post per panel, plus 1 to end the run and 1 for each gate, and subtracts the gates from the length. Its example turns 120 feet of panels 8 feet wide into 15 panels and 17 posts. The calculator gives the same 15 panels and 17 posts for a 124 foot run with one 4 foot gate. The worksheet says panels are typically 6 or 8 feet wide.
For horse fences, Penn State Extension says a typical line post is set 36 inches deep, while corner and gate posts, which handle greater loads, are about 25 percent larger in diameter and set deeper, often to 48 inches. That guide is about horse fences, so it is not a rule for a backyard. The hole depth box lets you type your own figure.
How many pickets or boards do you need?
Every picket takes its own width plus one gap, except the last one, which has no gap after it. So n pickets cover n × width + (n − 1) × gap. The calculator finds the smallest n that covers the net length of each run. A common shortcut divides the length by (width + gap). For 96 feet with 5.5 inch pickets and 0.5 inch gaps that gives exactly 192, but 192 pickets cover only 1,151.5 inches of the 1,152 needed, so 193 is the right count. The widths below are examples for the arithmetic, so measure your own pickets.
| Picket width | Pickets, no gap | Pickets, 0.5 in gap |
|---|---|---|
| 3.5 in | 330 | 289 |
| 5.5 in | 210 | 193 |
| 7.5 in | 154 | 145 |
How deep should fence posts be, and how much concrete?
Millard Lumber says to set wood posts with about one third of their total length buried, and that this matters most for corner posts and posts that carry heavy loads or wind. If one third is underground, two thirds stand above it, so the hole depth is half the height above ground and the post is 1.5 times that height. The same guide also says to keep the bottom rail at least 2 inches off the ground.
| Height above ground | Post length | Hole depth | Concrete per 10 in hole |
|---|---|---|---|
| 4 ft | 6 ft | 2 ft | 1.09 ft³ |
| 5 ft | 7.5 ft | 2.5 ft | 1.36 ft³ |
| 6 ft | 9 ft | 3 ft | 1.64 ft³ |
The calculator treats each hole as a cylinder. It does not subtract the volume of the post, so the figure is a ceiling. To turn cubic feet into bags, open the concrete calculator, choose the “Round column” tab, type the hole diameter and depth, and set “Number of identical pieces” to the number of posts. That calculator offers 40, 60 and 80 lb bags. For a 50 lb bag, QUIKRETE gives a yield of 0.375 cubic feet, so divide the cubic feet by 0.375.
Check local rules before you build
This calculator counts materials. It does not know the fence height your city allows, how far from the property line you must build, or what your homeowners association requires. Those rules change by city, county and HOA, so ask the building department and your HOA before you buy. The Millard Lumber guide gives the same advice and also says to know exactly where your property line is before you start. The calculator shows no prices, which change by store and region.
Frequently asked questions
How many fence posts do I need?
Divide the fence length by the post spacing and round up to get the number of sections. Then add 1 post to close the run. For 100 feet with posts 8 feet apart, 100 ÷ 8 = 12.5, which rounds up to 13 sections and needs 14 posts. Gates and corners change the count, and the calculator handles both.
How far apart should fence posts be?
Millard Lumber says to set wood fence posts about 6 to 8 feet apart, depending on the type of fence, the terrain and the purpose. Family Handyman gives 8 feet as the standard spacing for wood fences and warns that rails sag when posts are set too far apart. The calculator starts at 8 feet and you can change it.
How many fence pickets do I need?
Pickets and gaps share the length of the fence. The smallest number of pickets that covers it is (length + gap) ÷ (picket width + gap), rounded up, with all three measurements in the same unit. For 96 feet of fence with 5.5 inch pickets and 0.5 inch gaps, that is (1,152 + 0.5) ÷ 6 = 192.08, so 193 pickets.
How many rails do I need per section?
The Millard Lumber guide builds its fence styles on a top, a center and a bottom rail, so the calculator starts at 3 rails per section. Type 2 if your design uses two. Prefab panels come with their own rails, so the calculator does not count rails for them.
How deep should fence posts be and is 2 feet deep enough?
Millard Lumber says to bury about one third of the total length of a wood post. A 6 foot post would go 2 feet down and leave 4 feet above ground, while a fence that stands 6 feet above ground needs a 9 foot post with 3 feet buried. Frost, soil and local rules can ask for more, so check them before you dig.
How many bags of concrete do I need for a fence post?
Find the volume of the hole first. A hole 10 inches wide and 3 feet deep holds π × (10 ÷ 12 ÷ 2)² × 3 = 1.64 cubic feet. A 50 lb bag of QUIKRETE Concrete Mix yields about 0.375 cubic feet, so a full hole takes up to 4.36 bags, which is 5 bags. The post takes up part of the hole, so the real need is a little lower. Other brands yield differently, so read your bag. The concrete calculator uses 40, 60 and 80 lb bags. A 50 lb bag yields 0.375 cubic feet per QUIKRETE, so divide the cubic feet by 0.375 for that size.
Do gate openings count in the fence length?
Measure the whole line, gate openings included, and enter the number of gates and their width. The calculator subtracts the gates before it counts sections. The Outdoor Essentials panel worksheet says the same thing: subtract the footage for gates.
More calculators
- Concrete Calculator Find how many cubic yards of concrete or how many bags you need for a slab, footing, wall or column.
- Square Footage Calculator Add rooms, circles or triangles and get the total in sq ft, sq yd, m² and acres.
- Gravel Calculator Calculate the cubic yards and tons of gravel for a driveway, path or base.