Fence Calculator (Posts, Panels, Rails)
Enter the total length of your fence run, how far apart you want the posts, and the width and spacing of your pickets. The calculator returns the number of sections, posts, rails, and pickets you need — and, if you add per-unit prices, an estimated material total. It is a planning estimate for a straight run; gates, corners, and slopes need small manual adjustments described below.
Fence run
Prices (optional)
Posts
16
15 sections + 1
Pickets
251
5.50 in + 0.25 in gap
Sections
15
Rails
30
Materials detail
Component counts
How it works
Sections are the bays between posts: fence length divided by post spacing, rounded up. Posts are then sections + 1, because a run of N sections is closed by one extra post — three sections in a line, for example, are held up by four posts. Rails (the horizontal stringers) are sections multiplied by the rails per section, typically two for a standard picket fence and three for taller privacy fencing.
Pickets are the total run length converted to inches (× 12) divided by the combined width of one picket plus one gap, rounded up. With 5.5-inch pickets and a 0.25-inch gap, each picket-plus-gap unit occupies 5.75 inches, so a 120-foot run needs ceil(1440 / 5.75) = 251 pickets. Tightening the gap or narrowing the pickets increases the count; a board-on-board or shadowbox style effectively halves the gap and needs roughly double the pickets.
If you enter prices per post, per rail, and per picket, the calculator multiplies each count by its price and sums them for a material subtotal. Counts are always whole numbers and are rounded up, because you cannot buy a fraction of a post. The cost figure covers only these three components — it excludes concrete, fasteners, gates, caps, stain, and labor, which vary too much to estimate generically.
Frequently asked questions
Why is there one more post than sections?+
A fence is a line of sections strung between posts, and a straight line always ends on a post rather than a section — so a run of N sections needs N + 1 posts. Picture a single section: it takes two posts, one at each end. Add a second section and you add one post, not two, because the middle post is shared. That pattern continues, so the post count is always sections + 1. The calculator handles this automatically; the number you see already includes the closing post.
What post spacing should I use?+
For residential wood fencing, 6 to 8 feet on center is the usual range, with 8 feet being the common maximum for standard rail lengths and 6 feet preferred for taller privacy fences or windy, exposed sites where extra rigidity matters. Closer spacing means more posts and rails but a stiffer, longer-lasting fence. Check your local building code and any HOA rules, and match the spacing to the rail stock you plan to buy — pre-cut rails are often sold in 8-foot lengths.
Does this include concrete, gates, or corners?+
No. The concrete or gravel that sets each post is a separate calculation — a common rule of thumb is roughly one to two bags of premix per post depending on hole size, which you can size with a dedicated concrete calculator. Gates and corners also add posts and hardware that a straight-run estimate cannot know about: budget an extra post for each gate opening and each direction change, plus latches, hinges, and gate frames. Add those to the counts here before you buy.