Yard & Slab — Home Improvement Material Calculators
How much material do you actually need? Estimate it before you buy it.

Fence Calculator

For a wood picket fence: enter the fence length, post spacing, how many rails each section carries, and your picket width and gap — and get the posts, rails and pickets to put on the lumber order.

Quick answer: A 48 ft fence at 8 ft post spacing takes 6 sections, so 7 posts and 12 rails at 2 rails per section. With pickets of 5.5 in actual width and a ½ in gap it needs 97 pickets — buy about 5% extra for warped or split boards.

Calculate

Advertisement

How to calculate fence posts, rails and pickets — the formula

  1. Count the sections. Divide the fence length by the maximum post spacing and round up: 48 ft at 8 ft spacing is exactly 6 sections.
  2. Posts are sections plus one. Every run needs a post at each end of every section: 6 sections means 7 posts.
  3. Rails are sections × rails per section. 6 sections × 2 rails per section = 12 rails.
  4. Count the pickets on the grid. Divide (fence length in inches + one gap) by (picket width + gap) and round up: (576 + 0.5) ÷ 6 = 97 pickets for 5.5 in pickets with a ½ in gap.
Diagram of a fence section showing posts, two rails and picketsPostPicketsRails run between posts
A fence is built in sections between posts; pickets are counted on the grid like tiles.

A fence is built in sections between posts, so everything starts with the section count: the fence length divided by the maximum post spacing, rounded up. A 48 ft run at 8 ft spacing is exactly 6 sections, and every run needs one more post than it has sections — a post at each end of every section — so 7 posts. Rails are simpler still: sections × rails per section, 12 in this example with two rails. Pickets are counted the way tilers count tiles, in a grid rather than by area. Each picket covers its own width plus one gap — except the last picket in the run, which needs no trailing gap — so the count is (fence length in inches + one gap) ÷ (picket width + gap), rounded up. For that 48 ft fence with 5.5-inch pickets and a ½-inch gap: (576 + 0.5) ÷ 6 = 96.08, so 97 pickets. If your length does not divide evenly by the spacing, the calculator still rounds the sections up; on the ground you would either let the last section come out shorter or, neater, divide the length by the section count and space all the posts evenly at slightly less than the maximum.

Posts, gates and corners

The count above is for one straight run of fence, and real fences are rarely one straight run. Every corner takes its own post (it is already the end post of both runs if you calculate each side separately and share it — just make sure you do not count it twice). A gate changes the picture more: a gate opening needs a post on each side like any other section end, but gate posts carry the swinging weight of the gate and should be heavier stock, set deeper and in concrete, and a wide or double gate may want a 6×6. This calculator also does not count the concrete for setting the posts — a common allowance is roughly one 50 lb bag of post-mix per post in average soil, more in soft ground — nor the gravel for the bottom of each hole — estimate the concrete for setting the posts once you have the post count from this page. Post depth follows the frost rule: a third of the post in the ground is the usual target, and below the local frost line wherever that is deeper. A 6 ft fence therefore wants 8 ft posts, not 6 ft posts, and the post length you buy is a separate decision from the count this page gives you.

Fence material counts by length

Posts, rails and pickets by fence length — 8 ft post spacing, 2 rails per section, 5.5 in pickets, ½ in gap

Fence lengthSectionsPostsRailsPickets
24 ft34649
48 ft671297
96 ft121324193
100 ft131426201
Advertisement

Frequently asked questions

How far apart should fence posts be?

Eight feet is the standard maximum spacing this calculator is built around, and the spacing in its worked example: a 48 ft run at 8 ft spacing is exactly 6 sections. Spacing is measured centre-to-centre. If a length does not divide evenly, the sections round up and the posts can be respaced evenly at slightly less than the maximum.

How many pickets do I need per foot of fence?

About 2 per foot with 5.5 in pickets and a ½ in gap — each picket covers 6 inches of run. Narrower 3.5 in pickets at a ¼ in gap need about 3.2 per foot. The exact count for a 48 ft fence at the standard sizes is 97 pickets.

How many rails does a fence section need?

Two or three, depending on the fence's height and how stiff it needs to be. The count is simply sections × rails per section: the 48 ft example needs 12 rails at 2 per section, or 18 at 3 per section.

How much concrete do I need to set fence posts?

A common allowance is roughly one 50 lb bag of post-mix per post in average soil, and more in soft ground. This calculator counts posts, rails and pickets only — add the post-mix, and gravel for the bottom of each hole, to the order separately.

How deep should fence posts be set?

The usual target is a third of the post in the ground, and below the local frost line wherever that is deeper. A 6 ft fence therefore wants 8 ft posts, not 6 ft posts — the post length you buy is a separate decision from the post count this page gives you.

Should I use the nominal or actual picket width?

The actual width. A picket sold as 6 inches usually measures about 5.5, and pressure-treated pickets shrink across their width as they dry, so a gap set at a tidy ½ inch on green lumber can open up noticeably by the end of the first summer. For a privacy fence, install pickets tight and let shrinkage create the hairline.

Sources and references

Common mistakes

Building on the wrong line is the costliest: have the property boundary confirmed and check for easements and underground services before a single hole is dug, because a fence in the wrong place is a fence you move at your own expense. Second is spacing posts by measuring from the edge of the last post instead of centre-to-centre — spacing is a centre-to-centre dimension, and edge measuring drifts by half a post width per section until the last section is noticeably short. Third is trusting nominal picket widths: like deck boards, a picket sold as 6 inches usually measures about 5.5, and pressure-treated pickets shrink across their width as they dry, so a gap set at a tidy ½ inch on green lumber can open up noticeably by the end of the first summer — for a privacy fence, install pickets tight and let shrinkage create the hairline. Finally, buy a few more pickets than the count: some arrive warped or split, and the count assumes every picket is usable. Five percent extra pickets is cheap insurance; posts and rails, being counted in whole sections, need no such cushion beyond one spare post on a long run.

Last updated: December 3, 2026