How to Calculate Fence Materials

Work out posts, rails and boards for a straight wood fence run, avoid the classic off-by-one post mistake, and build a shopping list.

Updated · 8 min read

A wood fence is a simple structure: posts set in the ground, horizontal rails between them, and boards or pickets fastened to the rails. Working out how much of each to buy is mostly counting, but there are a few traps. The best known one has its own name, the fence-post error. This guide covers a straight run of board fence and a run of ready-made panels.

1. Plan the layout first

Before counting anything, sketch your fence line and mark every corner, end and gate. Each straight stretch between two of those points is a separate run. Measure each run on its own. Corners and gate openings change where the posts go, so a single total length for the whole fence is not enough.

Before you dig: in the US, call 811 (or use your state's 811 website) a few days before digging post holes so underground utilities can be marked (811 Before You Dig). Also check property lines, permit requirements and any HOA rules on height and style.

2. Choose the post spacing

Fence installation guides commonly set posts no more than 8 ft apart, and closer for a sturdier fence (for example this redwood privacy fence guide). Many prefabricated panels are sold 8 ft wide (nominal), so match your spacing to the actual panel you buy.

3. Count sections and posts

Divide the length of the run by the maximum spacing and round up. That is the number of sections.

sections = run length ÷ max post spacing, rounded up
posts    = sections + 1

This is where the fence-post error comes in: a run with 3 sections needs 4 posts, not 3, because there is a post at both ends. Many people divide the length by the spacing and stop there.

Example

A 50 ft run with 8 ft maximum spacing: 50 ÷ 8 = 6.25, rounded up to 7 sections. That needs 8 posts. Spread evenly, they are 50 ÷ 7 = about 7 ft 2 in apart.

Post length

Each post must be long enough to reach the fence height above ground plus the depth set in the ground. QUIKRETE’s post-setting instructions put about one-third of the post’s total length in the ground, which is half its height above ground, plus about 6 in of gravel below. For a 6 ft fence that means about 3 ft in the ground and a 9 ft post. Frost depth, soil and local code can require more, so check before buying.

4. Count the rails

Rails are the horizontal boards (often 2×4s) running from post to post. Shorter fences commonly use two rails per section, and taller fences use three or more so the boards stay straight. Multiply rails per section by the number of sections.

For the 50 ft example with 3 rails per section: 7 × 3 = 21 rails, each long enough to span one section.

5. Count the boards or pickets

Lumber is named by its nominal size, but the real board is smaller. A 1×6 fence board is about 5½ in wide, and a 1×4 is about 3½ in. Always calculate with the actual width.

Solid privacy fence (no gaps)

boards = run length (in) ÷ board width (in), rounded up

50 ft is 600 in. With 5½ in boards: 600 ÷ 5.5 = 109.1, so 110 boards.

Spaced pickets

With a gap between pickets, each picket covers its width plus one gap, except the last one. The formula accounts for that:

pickets = (run length + gap) ÷ (picket width + gap), rounded up

For the same 600 in with 3½ in pickets and 2½ in gaps: (600 + 2.5) ÷ 6 = 100.4, so 101 pickets.

6. Panel fences

With prefabricated panels, the count is simpler: one panel per section. The thing to check is that your post spacing matches the panel width, measured the way the manufacturer specifies (some list post-center to post-center, others the panel itself). If the run doesn't divide evenly, one panel usually has to be cut down.

7. Add waste and the extras

Some boards arrive split, warped or with knots in the wrong place, and some get cut. Adding around 5–10% to the board and rail count is a common precaution. Then add what the count above leaves out:

  • Concrete or gravel for setting posts, if you use it
  • Screws or nails rated for outdoor use, and any brackets
  • Gate posts, gate hardware and the gate itself
  • Post caps, stain or sealer

Shopping list for the 50 ft example

ItemCountWith 10% extra
Posts, 9 ft (6 ft above ground + 3 ft in ground)88
Rails (3 per section)2124
1×6 boards, 6 ft110121

Waste is not usually added to posts, since each post has a fixed position. Buy a spare if a damaged post would hold up the job.

Let the calculator do it

The Fence Calculator runs all of these steps for one straight run, switches between feet and meters, shows a diagram of the post layout and adds up the cost when you enter your prices. Run it once for each straight run of your fence.