Fence calculator
Enter the length of the fence, the gates and the distance between posts to see the posts, rails and pickets or panels to buy. Add your prices to see the cost.
This answer is for the example values in the boxes above. A line of 100 ft with posts 8 ft apart, 1 gate of 4 ft, pickets 5.5 in wide with 0.5 in gaps, 3 rails. Change the boxes to see your own answer.
Each gate adds a post, and a fence that closes on itself has as many posts as sections. A line that does not divide evenly can need one more post.
How it works
The calculator takes the width of the gates out of the line and divides the rest into sections as long as the space between posts, rounding up. An open line has a post at both ends of every section, so it has one more post than sections. Each gate splits the line, so it adds one post. A fence that closes on itself has no ends, so it has as many posts as sections, plus one for each gate.
For a fence of pickets it counts the rails as the sections times the rails in a section. The pickets are the length of the fence in inches plus one gap, divided by the width of a picket plus one gap, rounded up. For ready-made panels, a panel is as wide as the space between posts, so there is one for each section.
A worked example
A line of 100 feet with one gate of 4 feet leaves 96 feet of fence. With posts 8 feet apart that is 12 sections and 14 posts: 12, plus 1 for the open end, plus 1 for the gate. At 3 rails to a section there are 36 rails. Pickets of 5.5 inches with gaps of 0.5 inch need 1,152.5 divided by 6, which is 192.08, so 193. Ready-made panels would be 12.
A fence around a yard of 200 feet with no gate has 25 sections and 25 posts. Two gates of 4 feet change that to 24 sections and 26 posts.
The width of a board
A board called 1 by 6 is 3/4 inch thick and 5 1/2 inches wide, so 5.5 is the number to type for one. The picket width is the board itself, without the gap.
The cost
Type a price for a post, a picket or a panel, a rail and a gate to see the cost of the parts. At $30 a post, $2.50 a picket, $9 a rail and $120 a gate, the first fence costs $1,346.50. The page gives no prices of its own.
What it leaves out
The count is by length. It does not model corners or slopes, and a line that does not divide evenly can need one more post. It does not work out the concrete for the posts: the concrete calculator does that for post holes.
Sources
- Southern Pine Inspection Bureau, Nominal vs. actual lumber sizes, read on 2026-11-02.
Questions
How many fence posts do I need?
Divide the length of the fence by the space between posts and round up to get the sections, then add one post for an open line. 96 feet at 8 feet is 12 sections and 13 posts, and a gate adds one more.
How many pickets do I need?
Divide the length of the fence in inches, plus one gap, by the width of a picket plus one gap, and round up. 96 feet of pickets 5 1/2 inches wide with 1/2 inch gaps is 193.
How many posts does a fence around a yard need?
As many as it has sections, because a fence that closes on itself has no end posts. 200 feet with posts 8 feet apart is 25 sections and 25 posts.
How many rails go in each section?
The count is yours to choose, and the calculator starts at 3. Type the number your plan uses and it multiplies by the sections.
Do gates count in the length of the line?
Yes. Type the whole line, then the number and the width of the gates. The calculator takes their width out of the fence and adds a post for each gate.
Published .