🪵 Fence Calculator
By ToolNimba Editorial Team · Updated 2026-06-19
This assumes a single straight run of fence on level ground. Posts are counted as the number of equal sections plus one for the closing end post, so a corner or a second straight run will add posts. The last section is allowed to be shorter than the spacing if the length does not divide evenly. Gates reuse the posts already counted, so each gate is subtracted from the panel total rather than adding posts. Buy a little extra material to allow for cuts, breakage, and terrain.
This fence calculator works out the materials for a straight run of fence: the number of posts, sections (panels), and rails you need. Enter the total length, your post spacing (8 ft is the usual default), and how many rails sit in each section. Add any gates and they are taken off the panel count. You will see the post, section, panel, and rail totals straight away, so you can price the job before you buy.
What is the Fence Calculator?
A fence is built as a series of equal sections strung between posts. The key relationship is simple: if a run is divided into a whole number of sections, it needs one more post than it has sections, because every section has a post at each end and neighbouring sections share a post. So a 80 ft run at 8 ft spacing has 10 sections and 11 posts. The spacing you choose is a trade-off: wider spacing uses fewer posts but needs stronger rails and panels to avoid sagging, while 6 to 8 ft is the common range for timber fences.
The length rarely divides evenly into the spacing, and that is fine. This tool rounds the section count up so the fence always reaches the full length, which means the last section may be a little shorter than the rest. In practice you cut the final panel or rail to fit. If you would rather keep every section identical, adjust the spacing so the length divides cleanly, for example using 7 ft sections for a 84 ft run.
Rails are the horizontal members that the boards or pickets attach to. Most fences use 2 rails for shorter heights and 3 rails for taller fences (around 6 ft) to keep the boards from warping. The rail total here is simply the number of panels times the rails per section. Gates are handled separately: a gate takes the place of a panel but still hangs from posts you have already counted, so each gate is subtracted from the panel total rather than adding posts. Always buy a little extra to allow for cuts, knots, breakage, and uneven ground.
When to use it
- Estimating posts, panels, and rails for a backyard timber or vinyl fence before a trip to the lumber yard.
- Pricing a fencing job by turning a property boundary length into a clean material list.
- Comparing post spacings (6 ft vs 8 ft) to see how the post count and cost change.
- Planning a run that includes one or more gates, so you do not over-order panels.
How to use the Fence Calculator
- Enter the total length of the fence run in feet.
- Set the post spacing (8 ft is a common default for timber fences).
- Enter how many rails each section uses (2 for short fences, 3 for tall ones).
- Add the number of gates, if any, to subtract them from the panel count.
- Read off the posts, sections, panels, and rails you need.
Formula & method
Worked examples
A straight 80 ft fence at 8 ft post spacing, 3 rails per section, no gates.
- sections = round up (80 ÷ 8) = 10
- posts = 10 + 1 = 11
- panels = 10 − 0 = 10
- rails = 10 x 3 = 30
Result: 11 posts, 10 sections, 10 panels, 30 rails
A 100 ft fence at 8 ft spacing, 3 rails per section, with 1 gate.
- sections = round up (100 ÷ 8) = round up (12.5) = 13
- posts = 13 + 1 = 14
- panels = 13 − 1 gate = 12
- rails = 12 x 3 = 36
Result: 14 posts, 13 sections, 12 panels, 36 rails (last section is shorter than 8 ft)
Posts and sections for a straight run at 8 ft post spacing
| Fence length | Sections | Posts |
|---|---|---|
| 24 ft | 3 | 4 |
| 40 ft | 5 | 6 |
| 80 ft | 10 | 11 |
| 100 ft | 13 | 14 |
| 160 ft | 20 | 21 |
Common post spacing guidance for timber and vinyl fences
| Spacing | Typical use |
|---|---|
| 6 ft | Heavier panels, windy sites, or stronger support |
| 8 ft | Standard for most timber and chain-link fences |
| 10 ft | Lighter rail fences and some vinyl systems (check the maker) |
Common mistakes to avoid
- Forgetting the extra end post. A straight run always needs one more post than it has sections, because both ends need a post. Counting one post per section leaves you a post short at the end of the line.
- Ignoring corners and direction changes. This tool counts a single straight run. Each corner or change of direction usually needs its own post, so add one post per corner on top of the result.
- Assuming gates add posts. A gate hangs from posts that are already in the run, so it does not add posts. It does replace a panel, which is why gates are subtracted from the panel count here.
- Buying exactly the calculated amount. Wood splits, boards warp, and ground is rarely level, so order a small surplus of rails and pickets. Most builders add 5% to 10% extra for waste and offcuts.
Glossary
- Post
- A vertical support driven or set into the ground that the rails and panels attach to.
- Section
- The span of fence between two neighbouring posts. The number of gaps in the run.
- Panel
- The pre-built or board-by-board infill that fills one section between posts.
- Rail
- A horizontal member running between posts that the boards or pickets fix to, usually 2 or 3 per section.
- Post spacing
- The on-centre distance between posts, commonly 6 to 8 feet for timber fences.
Frequently asked questions
How many fence posts do I need?
Divide the total length by the post spacing and round up to get the number of sections, then add one for the end post. For example, a 80 ft run at 8 ft spacing has 10 sections and 11 posts. Add an extra post for every corner or change of direction.
How many fence panels do I need?
The number of panels equals the number of sections, which is the length divided by the spacing, rounded up. If your fence includes gates, subtract one panel for each gate, since a gate takes the place of a panel between two existing posts.
What is the standard spacing between fence posts?
8 feet on centre is the common default for timber and chain-link fences, with 6 feet used for heavier panels or windy sites. Always check the panel or rail manufacturer guidance, as some systems specify a maximum span.
How many rails does a fence need?
Shorter fences typically use 2 rails per section, while taller fences around 6 feet use 3 rails to stop the boards warping. This calculator multiplies the number of panels by the rails per section to give the total.
Does the calculator handle gates?
Yes. Enter the number of gates and each one is subtracted from the panel total, because a gate replaces a panel but hangs from posts that are already counted in the run. The post count itself does not change.
What if my fence length does not divide evenly by the spacing?
The tool rounds the section count up so the fence covers the full length, which means the last section can be shorter than the others. You simply cut the final panel or rails to fit, or adjust the spacing so the length divides cleanly.