Last reviewed:

Fence Calculator

Use this fence calculator to find how many posts, rails and pickets a fence needs from its length and post spacing.

  • Instant answer as you type
  • Nothing you type is sent anywhere
  • Worked example with clear steps
ft
Total run, all sides, gates included. The limit of 100,000 ft is ours.
ft
Posts your plan adds for gates and corners. The limit of 1,000 is ours.
Calculated live
Fence posts 13 sections, 8 ft apart
14 posts
Pickets or boards 5.5 in wide with 0.5 in gaps
200
Sections between posts
13
Rails 2 per section
26

Based on NIST PS 20 NIST SP 811 City of Mansfield Full list of sources

Assumptions and constants

You can change

The limits on the other boxes, such as the largest size you can enter, are ours, not from a source.

Distance between posts

ft
Same as the box in the form above

The starting 8 ft is the most that one city's standard allows between posts of a wood privacy fence (City of Mansfield, Texas). It is not a national standard: follow your fence maker's instructions and your local rules.

Allowed range: 2 to 20 ft. The limits are ours.

Rails between each pair of posts Typical value

rails
One city's standard requires 3 rails for a 6 ft fence and 4 for an 8 ft fence (City of Mansfield, Texas). Enter the number on your plan.

Typical value, not a standard. One city's standard requires 3 rails for a 6 ft fence and 4 for an 8 ft fence (City of Mansfield, Texas). Enter the number on your plan.

Allowed range: 1 to 8 rails. The limits are ours.

Width of one picket or board (actual)

in
Fractions are fine, e.g. 5 1/2

A nominal 6 inch board is dressed to at least 5 1/2 inches when dry, under the American Softwood Lumber Standard. Enter the width of your own boards.

Allowed range: 1 to 12 in. The limits are ours.

Gap between pickets Typical value

in
Fractions are fine, e.g. 1/2

Typical value, not a standard. Use 0 for boards that touch.

Allowed range: 0 to 12 in. The limits are ours.

Fixed values (exact definitions and references)

These are exact definitions and cannot be edited.

Inches in a foot Reference [2]

12 in per ft

The foot is 0.3048 m and the inch is 0.0254 m, both exact, so 12 inches make a foot.

How to use the fence calculator

  1. Enter the Fence length: the total run in feet, all sides, gates included.
  2. Enter the Distance between posts. Add Extra posts for gates and corners that need an added post.
  3. Open Assumptions and constants to set Rails between each pair of posts, Width of one picket or board (actual) and Gap between pickets.
  4. Read Fence posts and Pickets or boards. Rails and Sections are listed below them.
  5. Use Copy result or Print, and confirm the counts with your fence supplier.

How the fence calculator works

Sections = the fence length / the distance between posts, rounded up. Posts = sections + 1, plus any extra posts for gates and corners. Rails = sections x the rails in each section. Pickets = the fence length in inches (12 inches in a foot) [2] / (picket width + gap), rounded up. The picket width is the width it is dressed to: a nominal 6 inch board is dressed to at least 5 1/2 inches when dry. [1]

Worked example

A 100 ft fence with posts 8 ft apart: 100 / 8 = 12.50, rounded up to 13 sections. Posts = 13 + 1 = 14. At 2 rails per section that is 26 rails. Pickets 5.5 in wide with 0.5 in gaps take 6 in each: 100 x 12 / 6 = 200 pickets, exactly.

Fence from the front: length 100 ft, posts 8 ft apart A front view of a fence with four posts, two rails between each pair of posts, and pickets between the first two posts. The distance between two posts, 8 ft, is marked under the first section. The length of the whole fence, 100 ft, is marked along the top. From the front Length 100 ft Posts 8 ft apart
Not to scale: four posts are drawn to show the parts, and the real fence has more. The number of sections is the length divided by the post spacing, rounded up.

How far apart should fence posts be?

We found no national standard for the distance between posts on a residential fence. For a wood privacy fence, one city's standard (City of Mansfield, Texas, dated 2/11/2020) calls for galvanized steel pipe posts of at least 2 3/8 inches outside diameter, spaced no more than eight feet on center and set in concrete footings. [3]

This calculator starts at 8 ft, the figure in that one city's standard, and you can change it under Assumptions and constants. Your local rules apply: ask your building authority or follow your fence maker's instructions.

How to measure for a fence

Measure along the line the fence will follow, around every side and including the gates, with a tape measure or a measuring wheel, and add the lengths. Note each corner and gate, and enter any extra posts your plan needs in Extra posts. To fence a whole yard, add up the sides.

Picket, privacy and other fence styles

For a picket fence, enter the picket width and the gap. For a privacy fence with boards that touch, set the gap to 0. One city's standard requires 3 horizontal stringers (rails) for a fence six feet high and 4 for a fence eight feet high. [3] Enter the number on your plan in Rails between each pair of posts. For other layouts, such as board-on-board, ask your supplier how many boards you need. This tool counts wood pickets and rails. It does not cover vinyl, metal or masonry fences.

How much fence do I need around an area?

If you know only the area, the side of a square lot is the square root of its area and its perimeter is four times that. Measure the actual sides when you can. If the fence returns to where it started, the first post is also the last, so subtract one from the posts.

Fence around a square lot
Area (ft²) Side (ft) Fence length (ft)
5,000 70.71282.84
10,000 100.00400.00
20,000 141.42565.69

How deep should fence posts go?

In the same city standard, the minimum depth of the concrete footings is 24 inches for a fence six feet high and 36 inches for a fence eight feet high. [3] That is one city's rule for one kind of fence, and we found no second source. Your local frost depth and rules apply: ask your building authority or follow your fence maker's instructions.

How much fence stain or paint do I need?

The area to coat is the fence length times its height, times the number of sides you will coat. Divide it by the coverage printed on the product label. We state no coverage figure.

How much does a fence cost?

We state no price. Ask local suppliers for the price of a post, a rail and a picket, and multiply each by its count above.

Common mistakes and limits

  • Forgetting the extra post. A run needs one more post than sections.
  • Ignoring gates and corners. Enter any extra posts your plan needs in Extra posts.
  • Using the nominal board width. A nominal 6 inch board is dressed to at least 5 1/2 inches when dry. [1] Use the dressed width.
  • Using a post spacing no one gave you. The starting value is a typical value, not a standard. Follow your fence maker's instructions.
  • What this tool does not cover: gates, hardware, post holes and concrete, slopes, and permits.

Common lengths

Fence lengths with the counts the calculator gives. The lengths are examples to show the sum.

Fence for common lengths with posts 8 ft apart and 2 rails
Length Sections Posts Rails Pickets
50 ft 7814100
100 ft 131426200
150 ft 192038300
200 ft 252650400
300 ft 383976600

Frequently asked questions

How many fence posts do I need?

Divide the fence length by the distance between posts and round up to get the sections, then add one post, plus any extra for gates and corners. A 100 ft fence with posts 8 ft apart has 13 sections and needs 14 posts.

How many fence pickets do I need?

Divide the fence length in inches by the picket width plus the gap, and round up. With 5.5 inch pickets and 0.5 inch gaps, 100 ft is 1,200 / 6 = 200 pickets exactly. A nominal 6 inch board is dressed to at least 5 1/2 inches when dry. [1]

How do I measure for a fence?

Measure along the line the fence will follow, around every side and including the gates, with a tape measure or a measuring wheel. Add the lengths. Note each corner and gate, and enter any extra posts your plan needs.

How much fence stain or paint do I need?

Find the area to coat: the fence length times its height, times the number of sides you will coat. Then divide by the coverage printed on the product label. We state no coverage figure.

Sources and references

  1. National Institute of Standards and Technology (NIST). Voluntary Product Standard PS 20-25, American Softwood Lumber Standard (PS 20-25, accessed November 2026). Used for: Nominal and minimum dry dressed lumber sizes, for example a dry 2 by 4 is dressed to at least 1 1/2 by 3 1/2 inches.
  2. National Institute of Standards and Technology (NIST). NIST Guide to the SI, Appendix B.8: Factors for Units Listed Alphabetically (SP 811, accessed November 2026). Used for: the inch and foot relationship (12 inches in a foot).
  3. City of Mansfield, Texas. New or Replacement Wood Privacy Fence Construction Standards (dated 2/11/2020, accessed November 2026). Used for: one city's post spacing, footing depth, number of horizontal stringers and post type for a wood privacy fence.

How we use sources: methodology.

Estimates only. Confirm quantities with your supplier. See the disclaimer. Found a wrong result? Report an error.