Fence Calculator
Enter the fence length, the post spacing and the number of gates to see how many posts, rails and pickets to buy. Choose an open line or a closed loop, imperial or metric units, and a picket waste allowance.
Last updated November 3, 2026
Gates included
Extra for cuts and defects
Result
14 posts, 24 rails and 212 pickets
Each gate adds one post beyond the line posts, since it shares one with the run.
| Item | Amount |
|---|---|
| Run after gates | 96 ft |
| Sections | 12 |
| Spacing used | 8 ft |
| Line posts (sections + 1) | 13 |
| Gate posts (1 per gate) | 1 |
| Posts in total | 14 |
| Rails (2 per section) | 24 |
| Pickets before waste | 192 |
| Pickets with 10% waste | 212 |
| Gates | 1 |
Counts are rounded up. Check local building rules and your property line before you build.
Show the work
Formula: run = length - gates x gate width; sections = ceil(run / spacing); posts = sections + 1 (line) or sections (loop), + 1 per gate; rails = sections x rails per section; pickets = ceil(run / (picket + gap)), then x (1 + waste / 100) rounded up
- Run: 100 - 1 x 4 = 96 ft.
- Sections: 96 / 8 = 12, rounded up to 12; spacing used 96 / 12 = 8 ft.
- Posts: 12 + 1 = 13 line posts, plus 1 gate post = 14.
- Rails: 12 x 2 = 24.
- Pickets: 96 ft / (5.5 + 0.5 in) = 192 rounded up; with 10% waste 192 x 1.1 rounded up = 212.
Result: 14 posts, 24 rails and 212 pickets
How the fence materials are counted
run = length − gates × gate width
sections = ⌈run ÷ spacing⌉
posts = sections + 1 (line) or sections (loop), plus 1 per gate
The gates come out of the run first, because a gate replaces a stretch of fence. A 100 ft fence with one 4 ft gate has a run of 100 − 4 = 96 ft. The run is divided by the post spacing and rounded up to a whole number of sections. At 8 ft spacing, 96 ÷ 8 is exactly 12 sections.
Because the section count is rounded up, the posts are spread evenly, so the real spacing is the run divided by the sections and never wider than you entered. At 10 ft spacing, 96 ft gives 9.6 sections, rounded up to 10, with posts 9.6 ft apart.
Rails are the sections times the rails per section, so 12 sections with 2 rails need 24 rails. Pickets are the run divided by the picket width plus the gap, rounded up, and the waste allowance is applied on top and rounded up again. With 5.5 in pickets and 0.5 in gaps, 96 ft is 1,152 in, and 1,152 ÷ 6 is 192 pickets. Ten percent waste makes 192 × 1.10 = 211.2, so 212 pickets.
See how we calculate for the formulas, sources and review schedule behind every calculator.
Also useful alongside this calculator: Length Converter, Square Footage Calculator and Percentage Calculator.
The fence post problem
Counting posts is a classic fencepost problem: a straight run of 3 sections needs 4 posts, because both ends need one. An open line has sections + 1 posts, so dividing the length by the spacing alone leaves you one post short.
Open line or closed loop
An open line has two free ends. A closed loop, such as a fence around a whole yard, ends where it began, so the last section meets the first post and the posts equal the sections.
The same 100 ft fence with one gate has 12 sections as a loop, so 12 line posts plus 1 gate post makes 13, one fewer than the open line.
Gates and corners
A gate hangs between two posts. One is already counted in the line posts, and the other is new, so each gate adds exactly one post. Two gates in the default fence take 8 ft out of the run, leaving 92 ft and 12 sections, and the posts become 13 plus 2, which is 15.
Enter the total length and corners are counted correctly, because a corner post is shared by two sections. Gate hardware is not included.
Choosing the post spacing
Eight feet between posts is common, and 2.4 m is the usual metric match. At 6 ft spacing the 96 ft run has 16 sections and needs 17 line posts plus 1 gate post, 18 in all, against 14 at 8 ft. Confirm the right spacing with your supplier.
How to use the Fence Calculator
- Choose imperial or metric units, and an open line or a closed loop.
- Enter the fence length, post spacing, number of gates and gate width.
- Set the rails per section, the picket width and gap, and a waste percentage.
- Read the posts, rails and pickets, then use Show the work, Copy, Print or Share.
Worked example
A 100 ft fence with one 4 ft gate, posts at 8 ft, 2 rails per section and 5.5 in pickets with 0.5 in gaps has a 96 ft run: 12 sections, 13 line posts plus 1 gate post, 14 posts in all, and 24 rails. The 192 pickets become 212 with 10 percent waste. As a closed loop it needs 13 posts. In metric, 30 m with a 1.2 m gate, 2.4 m spacing and 14 cm pickets with 1 cm gaps gives the same result.
| Fence length | Sections | Posts | Rails | Pickets |
|---|---|---|---|---|
| 40 ft | 5 | 6 | 10 | 80 |
| 80 ft | 10 | 11 | 20 | 160 |
| 100 ft | 13 | 14 | 26 | 200 |
| 120 ft | 15 | 16 | 30 | 240 |
| 200 ft | 25 | 26 | 50 | 400 |
Frequently asked questions
How many posts do I need for a 100 ft fence?
With no gates and 8 ft spacing you need 14 posts: 100 ÷ 8 is 12.5 sections, rounded up to 13, plus one for the end.
Why does a line need one more post than sections?
Neighboring sections share a post, but the two ends of a line each need one, so a line has one more post than sections. A closed loop has no free end.
Does each gate really add a post?
Yes. A gate needs two posts and one of them is shared with the fence run, so each gate adds one post on top of the posts counted for the sections.
How many pickets should I buy?
Divide the run by the picket width plus the gap and round up, then add waste and round up again. The default fence needs 192, or 212 with 10 percent waste.
Does this check local rules or my property line?
No. It only counts materials. Height limits, permits and property lines are yours to check with your local authority before you build.