Fence Calculator: Posts, Rails and Pickets

Estimate the posts, sections, rails and pickets for a fence from its length, post spacing, gates and picket size.

Formulas and sources last reviewed November 4, 2026 by Kevin.

Fence line
Rails and pickets

How the calculation works

fenced length = total length − gates × gate width sections = fenced length ÷ post spacing, rounded up posts = sections + 1 + gates rails = sections × rails per section pickets = fenced length (in) ÷ (picket width + gap) × (1 + extra), rounded up

Every gate opening needs a post on each side, which splits the line in two and adds one post in total.

Worked example

A 100 ft fence with one 4 ft gate has 96 ft of fence. At 8 ft between posts that is 12 sections, so 14 posts (12 + 1 + 1 gate) and 24 rails with 2 per section.

With 5½ in pickets and a ½ in gap, each picket takes 6 in: 96 × 12 ÷ 6 = 192 pickets, and 5 % extra makes 202 pickets. Without the gate the same line needs 14 posts and 210 pickets.

Assumptions and limits

Frequently asked questions

How far apart should the posts be?

It depends on the panels or rails you use and the fence style, so this tool does not pick a spacing for you. Use the spacing in your product's instructions, and check local rules, which can also limit fence height and require permits.

How do I handle corners?

Calculate each straight run on its own and add the results. A corner post shared by two runs is counted twice, so subtract one post for every shared corner.

What is not included?

Gate hardware, post caps, concrete or gravel for the post holes, fasteners and any trim. Slopes, steps in the fence and uneven ground can change the lengths you need.

What picket width should I enter?

Enter the real width of the board you will buy. A board sold as "1×6" is usually narrower than 6 inches, often about 5½ in, but it varies, so measure one.

Before I dig?

Know where your property lines and buried utilities are. In the U.S. you can call 811 before digging to have public utilities marked.

Sources

See our editorial policy for how these tools are built and corrected.

Guides that help

More calculators