Fence Calculator
Enter the length of your fence run and the spacing between posts to get the number of posts and sections you need — with the off-by-one extra post handled for you.
Posts and sections at once
Enter the fence length and the post spacing and the calculator returns the number of sections (the gaps) and the posts (the uprights) together.
One straight run
The maths assumes a single straight run with even spacing — add a post for each gate or corner separately.
What does the fence calculator do?
Posts, sections, and the extra one
The fence calculator turns two measurements — the total length of a straight fence run and the spacing you want between posts — into the two numbers you actually order: how many fence sections (the gaps between posts) the run breaks into and how many posts you need to support them. The catch that trips up most first-time builders is the extra post: because a run is bounded by an upright at each end, you always need one more post than sections. Enter 30 m at 2.5 m spacing and you get 12 sections but 13 posts, not 12.
Enter a fence length in metres and a post spacing in metres to get the number of posts and sections instantly.
The number of sections is the length divided by the spacing, rounded up, and the number of posts is one more than that.
posts = ⌈length ÷ spacing⌉ + 1Sections are rounded up because a partial gap still needs its own full section and a post to close it — you can never have a fraction of a section in the real world. The posts then follow directly: count the sections and add one for the far end of the run. Use metres for both the length and the spacing and the counts come back as whole numbers.
Suppose you are building a 30 m straight fence and want the posts about 2.5 m apart.
Divide length by spacing
30 ÷ 2.5 = 12 — the number of gaps the run breaks into.
Round up to whole sections
⌈12⌉ = 12 sections. (If it were 31 m, ⌈12.4⌉ = 13 sections instead.)
Add one post
12 + 1 = 13 posts — one upright between each pair of sections plus one to close the far end.
The two outputs answer two different questions. The sections (12 for the run above) tell you how many panels, rails, or stretches of wire you need to fill the gaps between posts, and they directly track your material list for the in-fill. The posts (13) tell you how many holes to dig and how many uprights, post caps, and bags of concrete to buy. The single most important thing to remember is the extra post: it is not a rounding quirk but a real upright that closes the far end of the run, so ordering 12 posts for 12 sections leaves you one short. Whenever the length does not divide evenly into the spacing, the calculator rounds the sections up — a 31 m run at 2.5 m spacing becomes 13 sections, because that last 1 m still needs its own section and a post to anchor it. Closer spacing means more posts and a stronger, more wind-resistant fence; wider spacing saves posts but leans on sturdier panels and firm ground.
The counting is exact, but a couple of practical points are worth keeping in mind.
Straight run, even spacing, no gates or corners
This calculator counts the posts and sections for a single straight run with evenly spaced posts. It does not add posts for gates, corners, or changes of direction — each of those needs its own dedicated post, so add one per corner and treat every straight segment between corners as its own run. It also assumes the spacing you enter divides the run into equal sections; in practice the last section is often slightly shorter once you round up.