numvana

Fence Calculator (Posts, Rails & Pickets)

Work out how many posts, rails, and pickets a straight fence run needs from its total length, maximum post spacing, picket size, and rails per section.

Posts needed
10
Actual spacing between posts
2.22 m
Rails needed
18
Pickets needed
200

How it works

A fence run is divided into equal-width sections, each no wider than the maximum post spacing you'd want between posts — rather than using a fixed spacing and leaving a short, mismatched final gap, this calculator spreads the posts evenly: the number of sections is the smallest whole number that keeps every section at or under your maximum spacing, sections = ceil(fenceLength ÷ maxPostSpacing), which needs sections + 1 posts and gives an actual spacing of fenceLength ÷ sections — always at or under what you asked for. Rails scale directly with the number of sections (your chosen rails-per-section count × the number of sections).

Picket count is a standard start-aligned packing calculation: the first picket takes up its own width, and every picket after that adds one gap plus one more picket width, so the number that fit end-to-end along the run is floor((fenceLength − picketWidth) ÷ (picketWidth + picketGap)) + 1.

FAQ

Why does the actual post spacing come out slightly under my maximum?

Because posts are spread evenly across the whole run rather than placed at a fixed distance with a leftover gap at the end. If your fence length isn't an exact multiple of your maximum spacing, evening out the sections gives every gap the same, slightly-tighter-than-maximum width instead of one oddly short final section.

Does this account for corner posts on an L-shaped or rectangular fence?

No — this models a single straight run. A fence with corners needs a dedicated post at each corner regardless of spacing, then this calculator's math applied separately to each straight segment between corners; add the straight segments' totals together for the full job.

Related calculators