Fence Post Calculator

Enter the total length of the fence, the largest spacing allowed between posts, the number of corners and gates, and whether the fence ends or closes on itself. The calculator counts line, corner, end and gate posts, and adds the height above ground to the depth in the ground for the post length.

Example values are filled in. Replace them with your own measurements.

The total length along the fence line, gates included. Mixed units work: 100 ft or 30 m.

The largest center-to-center distance allowed. Use the figure from your fence or panel maker; Great Railing’s privacy fence guide, for example, sets a maximum of 8 ft on center.

Fence shape

Every change of direction needs its own post. Enter 0 for a straight fence.

Each gate opening gets a post on both sides. A double gate is one opening.

The width of each gate opening, post to post. It is taken off the fence length.

Optional. How tall the posts stand above the ground.

Optional. How deep each post is set. It depends on frost depth, soil and your local code – check with your building department and the fence maker.

Material needed

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
Not calculated
  • Line posts are the most this fence can need when every straight stretch between corners, ends and gates is spaced on its own. Stretches that divide exactly by the spacing need fewer.
  • Enter the depth in the ground to get the post length. It depends on frost depth, soil and local code, so this calculator does not suggest one.
  • Posts only. Rails, panels or pickets, concrete and hardware are not included.

per post

Optional. Enter your supplier’s price – we never fill in prices for you.

Estimates only. Actual material requirements may vary – verify manufacturer specifications before you buy.

17 pieces to buy

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

Method reviewed November 4, 2026

Privacy choices

Choose whether this site may use analytics cookies to measure which calculators are used. Your calculator inputs are never sent.