Fence Calculator
Posts, panels or pickets, and rails for a fence of any length.
The whole run, gates included.
Distance from one post to the next. For panels, use the panel width.
To see how long each post must be.
Examples: ,
Enter fence length, fence height and post spacing to see what your fence needs.
Short answer
Divide the fence length by the post spacing and round up to get the sections. A fence has one more post than it has sections, and each gate adds one more.
On this page
How do I use the fence calculator?
- Pick Panels for ready-made panels, or Pickets and rails to build the fence board by board.
- Enter the length of the run, the height and the distance from one post to the next. For panels, that distance is the panel width.
- Add the gates and the width of each one. For pickets, add the picket width, the gap and the rails per section.
- Read the posts, then the panels or the pickets and rails. Type the depth of your post holes to see how long each post must be.
How is the count worked out?
The calculator only counts. It uses no size of its own: the spacing, the picket and the rails are the ones you enter.
- Fence without gatesRun = L − n × w
- Sections between postsSections = round up (Run ÷ s)
- PostsPosts = Sections + 1 + n
- PicketsPickets = round up (Run ÷ (p + g) × (1 + x ÷ 100))
- RailsRails = round up (Sections × r × (1 + x ÷ 100))
Round up means to the next whole number. Pickets and rails apply to the Pickets and rails fence only.
| Symbol | Meaning | Unit |
|---|---|---|
| L | Length of the whole run | ft (m) |
| n | Number of gates | count |
| w | Width of one gate | ft (m) |
| s | Post spacing (the panel width for panels) | ft (m) |
| p | Width of one picket | in (mm) |
| g | Gap between pickets | in (mm) |
| r | Rails per section | count |
| x | Extra for cuts, on pickets and rails only | % |
A known limit
Sections are counted over the whole fence, not run by run between gates, so with many gates on a short fence the count can come out low. Take 10 ft of fence with posts 8 ft apart and two 3 ft gates: the calculator counts 1 section and 4 posts. If both gates sit inside the fence, they split it into three runs, and each run needs at least one section. For a layout like that, count each run on its own.
Worked example
A picket fence built board by board, with one gate and the default 10% extra for cuts.
| Shape | Pickets and rails |
|---|---|
| Fence length | 100' 0" |
| Fence height | 6' 0" |
| Post spacing | 8' 0" |
| Gates | 1 |
| Gate width (each) | 4' 0" |
| Picket width | 5½" |
| Gap between pickets (optional) | 0½" |
| Rails per section | 3 |
| Extra for waste | 10% |
| Posts needed | 14 |
|---|---|
| Pickets | 212 |
| Rails | 40 |
| Sections between posts | 12 |
A common mistake
Forgetting the end posts. A fence with 12 sections has 13 posts, not 12, and each gate adds one more. The calculator adds them for you, so check its count against your layout before you buy.
How far apart should the posts be?
The calculator does not pick the spacing for you, and neither does this guide. For a panel fence, it is the width of the panel. For pickets and rails, it is set by the length of your rails and by your plan. Your local code, your homeowners association or your fence maker may also set a limit, so ask before you buy.
What the spacing does is easy to see. Closer posts mean more posts and more holes to dig. Posts farther apart mean fewer of them, but longer sections. The table counts 100 ft of fence with no gates for the two spacings the calculator offers as examples, 6 ft and 8 ft.
When the length is not a whole number of sections, the calculator rounds up, so the last section is shorter than the rest. Measure it before you cut panels or rails.
| Post spacing | Sections | Posts |
|---|---|---|
| 6 ft (1.83 m) | 17 | 18 |
| 8 ft (2.44 m) | 13 | 14 |
How long should a fence post be?
The part of the post below ground holds the fence up, so the post is taller than the fence. Quikrete says to dig the hole about 3 times the diameter of the post, with a depth of one third of the post height, and to put 6 inches of dry concrete mix in the bottom. That leaves two thirds of the post above ground.
Type the depth of your own hole into the calculator to see the length of the post.
| Fence height | Post length | Hole depth |
|---|---|---|
| 4 ft (1.22 m) | 6 ft (1.83 m) | 2 ft (0.61 m) |
| 5 ft (1.52 m) | 7.5 ft (2.29 m) | 2.5 ft (0.76 m) |
| 6 ft (1.83 m) | 9 ft (2.74 m) | 3 ft (0.91 m) |
| 8 ft (2.44 m) | 12 ft (3.66 m) | 4 ft (1.22 m) |
Check your local code
Frost depth and soil change what is right for your yard, so check your local building code before you dig.
How much concrete do the posts need?
The concrete calculator has a Column shape for this. Enter the diameter of the hole, its depth and the number of holes, and it gives the cubic yards and the bags. The result fills the whole hole, so the space the post takes up works as part of your extra.
Frequently asked questions
How far apart should fence posts be?
It depends on the fence. For panels, it is the width of the panel. For pickets and rails, it is set by your design and the length of your rails. This calculator makes you choose the spacing, because the right value comes from your plan or your local code. The post spacing section above shows how the post count changes between 6 ft and 8 ft.
Why does a gate add a post?
A gate splits the fence into two runs, and each run needs its own end post. The posts on either side of the gate hold the hinges and the latch, so they carry more load than the others.
How much extra should I buy for pickets and rails?
The calculator adds 10% by default for cuts and mistakes. That is our default, not a standard, so change it to fit your plan. Posts and panels get no extra.
Related calculators
- Concrete CalculatorCubic yards and bags for slabs, footings and columns.
- Deck CalculatorDeck boards and joists for a deck of any size.
- Square Footage CalculatorArea of a rectangle, circle, triangle or trapezoid, in square feet, yards and meters.
- Mulch CalculatorCubic yards and bags of mulch for beds, borders and tree rings.