Toolzent

Fence Calculator

Estimate the posts, sections, rails and pickets you need for a straight fence run from its length and your post spacing, with a posts-by-length reference table.

Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser

What is a fence calculator?

A fence calculator estimates the materials for a straight fence run — the posts, sections, rails and pickets — from the fence length and your chosen post spacing. It turns a single tape-measure reading into a usable shopping list so you can price the job and avoid a second trip to the lumber yard.

This tool models one continuous straight run. Real yards have corners, ends and gates, so treat the output as a per-run baseline and add a little for each turn and opening (see the tips below).

How are fence materials calculated?

The calculator uses four exact formulas, the same ones the widget runs:

  • Sections = ceil(length ÷ spacing) — round the result up to the next whole number.
  • Posts = sections + 1 — every run needs one extra post to close the last bay.
  • Rails = sections × rails per section.
  • Pickets = ceil((length × 12) ÷ (picket width + gap)) — length is converted to inches, then divided by the combined board-plus-gap width.

The rounding-up (the ceil step) is the key detail. A 100 ft fence at 8 ft spacing is mathematically 12.5 bays, but you cannot build half a bay, so it becomes 13 sections — and one of those bays is simply shorter than 8 ft.

Can you show a worked example?

Yes. For a 100 ft fence at 8 ft spacing with 3 rails and 5.5 in pickets, you need 14 posts, 13 sections, 39 rails and 219 pickets. Here is the math step by step:

  1. Sections = ceil(100 ÷ 8) = ceil(12.5) = 13
  2. Posts = 13 + 1 = 14
  3. Rails = 13 × 3 = 39
  4. Pickets = ceil((100 × 12) ÷ 5.5) = ceil(1200 ÷ 5.5) = ceil(218.18) = 219

Second example — a 120 ft privacy fence at 6 ft spacing with 2 rails and 6 in pickets:

  1. Sections = ceil(120 ÷ 6) = ceil(20) = 20
  2. Posts = 20 + 1 = 21
  3. Rails = 20 × 2 = 40
  4. Pickets = ceil((120 × 12) ÷ 6) = ceil(1440 ÷ 6) = 240

Both results match the widget exactly, so you can reproduce them by hand to sanity-check any job.

How many posts for common fence lengths?

The table below shows posts (sections + 1) for typical run lengths at 6, 7 and 8 ft spacing. Closer spacing always needs more posts but yields a stiffer fence.

Fence lengthPosts at 6 ftPosts at 7 ftPosts at 8 ft
50 ft1098
100 ft181614
150 ft262320
200 ft353026
250 ft433733

For example, a 200 ft run drops from 35 posts at 6 ft spacing to 26 posts at 8 ft spacing — nine fewer post holes to dig and nine fewer bags of concrete to buy.

When should you use this fence calculator?

It is built for anyone scoping a fencing project before buying materials:

  • DIY homeowners pricing a backyard wood or vinyl fence and wanting a parts count.
  • Contractors producing a fast per-run estimate during a site visit.
  • Pickets and panels — quickly checking how board width and gap change the picket count.
  • Material budgeting — multiply the post and picket counts by unit prices for a rough total.

For other parts of the build, pair this with the concrete block calculator for footings or piers, and browse more estimators on the construction tools page.

Tips and common mistakes

A few details separate a clean estimate from a short order:

  • Add posts for every corner, end and gate. The formula assumes one straight line; each direction change or opening usually needs its own post.
  • Enter picket width plus gap as one number. If you have a 3.5 in board with a 2 in gap, enter 5.5, not 3.5. Using the board width alone overstates the picket count.
  • Round spacing to reality. Posts rarely land on perfect 8 ft centres; the calculator handles this by rounding sections up, leaving one shorter bay.
  • Buy a 5–10% overage on pickets to cover cuts, knots and warped boards.
  • Match rails to height. Fences up to about 4 ft typically use 2 rails; 6 ft fences use 3 rails for stiffness.

Slope, wind and accuracy notes

Quantities are estimates for planning and budgeting, not engineered specifications. Always confirm post depth, spacing and bracing against local building codes, frost-line depth and your manufacturer’s instructions.

On a slope, your true fence length follows the ground, which is longer than the flat (horizontal) distance — measure along the grade or step the fence and add a small allowance. In high-wind areas or for solid privacy panels that act like a sail, reduce spacing to 6 ft or less and deepen the posts; wider 8 ft bays are best kept for light, open-style fencing. Soil type, post material and panel weight all affect how far apart posts can safely go, so use the calculator’s count as a starting point and adjust for your site.

If your terrain is steep enough to need extra material along the grade, a quick way to convert a slope reading is with the square root calculator using the run and rise as the two short sides of a right triangle.

Frequently asked questions

How many fence posts do I need?+

Divide the fence length by your post spacing and round up to get the number of sections, then add one post for the closing end. At 8 ft spacing a 100 ft fence needs 13 sections and 14 posts.

What spacing should fence posts be?+

6 to 8 feet on center is standard for wood and vinyl fences. Use closer spacing (6 ft or less) on slopes, in high wind, or for heavy panels; 8 ft is the practical maximum for most residential fencing.

How many pickets do I need?+

Divide the fence length in inches by the combined width of one picket plus its gap. A 100 ft run with 5.5 in pickets-plus-gap needs about 219 pickets. Wider boards or tighter gaps change the count.

How do I calculate rails for a fence?+

Multiply the number of sections by the rails per section. Most fences use 2 rails under 4 ft tall and 3 rails for 6 ft tall. A 13-section fence with 3 rails each needs 39 rails.

How many bags of concrete per fence post?+

This calculator counts posts, not concrete. As a rule of thumb, plan one to two 50 lb bags of fast-setting concrete per 4x4 post in a 8 to 10 in wide, 2 ft deep hole. Corner and gate posts often need more.

Does the calculator account for gates and corners?+

No. It estimates a single straight run. Add posts manually for each corner, end and gate, and remember a gate opening replaces pickets and rails over its width.

How far apart should pickets be?+

A common picket-and-gap is a 3.5 in board with a roughly 2 in gap, or a 5.5 in board butted with a thin gap. Enter the board width plus the gap as a single number so the spacing matches your real layout.

Is 6 ft or 8 ft spacing cheaper?+

8 ft spacing uses fewer posts and less concrete, so it is usually cheaper, but it puts more load on each rail and panel. On exposed or sloped sites the strength of 6 ft spacing is often worth the extra posts.