Fence Calculator: Posts & Rails
Count posts and nominal rail pieces from measured, connected fence runs.
Your quantity estimate
Enter a run and your maximum spacing, then calculate. Add a run for each straight section; choose whether adjacent runs share a straight post, a corner post or a gate opening.
This is preliminary counting, not an installation plan or a complete material order.
Count positions, then check your components
This is an original planning model for an open path, not a manufacturer's bill of materials. Each run has ceil(length ÷ maximum spacing) spans and one fewer interior posts. Add one post for each shared straight or corner join, two outer terminal posts, and two more posts for an internal gate. Nominal rail pieces equal total spans × your rails-per-span assumption.
A connected-corner example
Two 12 ft runs at an 8 ft maximum have 2 + 2 spans. Each run has one interior post. Adding one shared corner and two outer terminal posts gives 2 + 1 + 2 = 5 posts. At two rails per span, that is eight nominal rail pieces. Replacing the shared corner with a 4 ft gate opening gives 2 + 0 + 2 + 2 = 6 posts and the same eight rail pieces.
Measure the fence, not the opening
Run lengths exclude gate openings. A gate's width is shown separately and added only to the project-line display. Do not subtract it from already measured fence-only runs. Removing a middle run clears the new neighboring join so you can explicitly choose how the remaining runs connect.
Limits and safety
Use 1–8 straight runs, at most 500 ft per run and 2,000 ft total, one internal gate up to 30 ft, a positive maximum spacing up to 16 ft, and 1–4 rail rows. These are this calculator's input limits, not approved construction dimensions. No waste, cost, footing, load, slope, permit or product-compatibility conclusion is provided. Verify your chosen manufacturer's instructions and local requirements. Contact 811 before digging.
Your measurements stay in this tab
The calculation, clipboard copy and TXT download run in your browser. This page does not save measurements or results, put them in the page address, or send them in analytics. Once the page's required static assets have loaded, you can calculate new projects without a network connection. Reset clears the current project; it does not remove a worksheet you previously copied or downloaded.
Frequently asked questions
Why do two connected fence runs share a post?
At a shared straight or corner join, one post ends the first run and starts the next. Two 12 ft runs at an 8 ft maximum spacing have four spans and five posts, not six. The ledger counts each run's interior posts, the shared join and the two outer terminals separately.
How does a gate change the post count?
An internal gate opening replaces one shared join with two distinct gate posts. The same two 12 ft runs with a 4 ft opening therefore need six posts in this model. Fence-only run length remains 24 ft; the project line including the opening is 28 ft. There are no rails across the opening, and its width is not subtracted again.
Why is the number of spans rounded up?
Each run is divided by your maximum post-center spacing and rounded up so a nominal evenly spaced span does not exceed that input. For 30 ft at 8 ft, ceil(30 ÷ 8) is four spans, each nominally 7.5 ft. An exact 16 ft run at 8 ft needs two spans. These are counting assumptions, not a spacing recommendation.
Can this calculator order manufactured fence panels?
No. It counts one cut-to-fit rail piece per span per rail row. Manufactured panels, actual component lengths, brackets, fasteners and stock cutting plans can change what you need. Check the chosen product's current instructions before ordering.
Does it estimate concrete, pickets, cost or safe post depth?
No. The calculation deliberately excludes concrete, footing depth, pickets, gate hardware, prices and structural or permit advice. Those depend on product and local conditions. Verify the manufacturer's instructions and local requirements, and contact 811 before digging.
Can I enter a closed perimeter or multiple gates?
This version supports one open ordered path of up to eight straight runs and at most one internal gate. It does not validate a closed loop, slope, wall connection or disconnected projects. For a perimeter with a gate, you may enter the measured fence path between its end posts, but this does not prove that the perimeter physically closes.
Will changing feet to meters alter the counts?
No. Valid measurements are retained as exact integer micrometers when the display unit changes. Conversion uses the international foot: 1 ft equals 0.3048 m exactly. Converted values can display extra digits so small lengths are not hidden; editing in feet accepts up to two decimal places, and editing in meters up to six. Calculate again after a change.