How it works
The calculator counts the posts that corners, ends and gates need, and fills the rest of the fence with line posts at no more than the spacing you enter.
Fenced length = Fence length − Gates × Gate width
Line posts = ⌈ Fenced length ÷ Spacing ⌉ − 1
Corner and end posts = Corners + 2 (open fence) or Corners (closed fence)
Gate posts = 2 × Gates
Posts = Line + Corner and end + Gate posts
Post length = Height above ground + Depth in the ground
⌈ ⌉ means rounding up to a whole number of bays. For a single straight run this is the familiar ⌈ Length ÷ Spacing ⌉ + 1 – the same count the fence picket calculator gives. A 100 ft fence with 2 corners and a 4 ft gate, posts at most 8 ft apart: 96 ÷ 8 = 12 bays → 11 line posts, plus 2 corners, 2 ends and 2 gate posts = 17 posts. Units are converted internally, so feet, inches and meters all work together.
Worked example
Inputs
- Fence length
- 100 ft
- Maximum post spacing
- 8 ft
- Fence shape
- Open – the fence has two ends
- Corners
- 2
- Gates
- 1
- Gate opening width
- 4 ft
- Height above ground
- 6 ft
- Depth in the ground
- 24 in
Result
- Posts in total
- 17
- Line posts
- 11
- Corner and end posts
- 4
- Gate posts
- 2
- Sections between posts
- 15
- Fence length without gates
- 96 ft
- Post length
- 8 ft (96 in)
Common mistakes
- Spacing posts by the panel width alone. Panels are measured between posts, so the center-to-center spacing is the panel width plus one post width – follow the maker’s figure.
- Forgetting the second gate post. A gate needs a post on both sides of the opening, and gate posts are often heavier than line posts.
- Counting a corner as a line post. Each corner needs its own post, braced for the pull from two directions.
- Buying posts as long as the fence is high. The part in the ground has to be added, so a 6 ft fence needs a longer post.
- Assuming one spacing fits every side. Lay out each straight side on its own so the posts are evenly spaced.
Assumptions and limits
- Each straight stretch between corner, end and gate posts is divided into equal bays no wider than the maximum spacing. The line post count covers the least favorable lengths, so it is never short.
- An open fence has two end posts; a closed fence has none. A closed fence with no corners or gates (a round pen) gets one post where the layout starts, counted as an end post.
- Every gate is a separate opening with two posts of its own. Gate widths are taken off the length that needs line posts.
- Post length is the height above ground plus the depth in the ground, both as you enter them. Sizes of posts, footings and depths are set by your local code and the fence maker, not by this calculator.
Frequently asked questions
How many fence posts do I need for 100 feet?
For one straight run with posts at most 8 ft apart, 100 ÷ 8 = 12.5, so 13 bays and 14 posts. Each corner adds a post that also ends a run, and each gate adds two gate posts – a 100 ft fence with 2 corners and a 4 ft gate needs about 17.
How far apart should fence posts be?
It depends on the fence type and the rails or panels you buy. Use the fence maker’s maximum; Great Railing’s privacy fence guide, for example, says the maximum distance between posts is 8 feet on center. Wind, soil and local code can call for closer spacing.
How do I calculate the number of fence posts?
For a straight fence, divide the length by the maximum spacing, round up to whole bays and add one. For a fence with corners and gates, count the posts each corner, end and gate needs, then add the line posts in between.
How long should my fence posts be?
The height above ground plus the depth in the ground. For a 6 ft fence with posts set 2 ft deep, buy 8 ft posts. The depth depends on frost depth, soil and local code, so ask your building department or follow the fence maker’s guide.
How many posts does a fence gate need?
Two – one on the hinge side and one on the latch side. A double gate across a driveway is one opening with two posts.
Sources
- Privacy Fence Installation Guide — Great Railing. "Maximum distance between posts is 8 feet on center"; dig below the frost line and check the local building department for its depth.
- NIST Handbook 44, Appendix C – General Tables of Units of Measurement — National Institute of Standards and Technology. Exact unit definitions: 1 in = 2.54 cm, 1 yd³ = 27 ft³, 1 US gal = 231 in³, 1 lb = 0.45359237 kg.
Method reviewed November 4, 2026