Fence Calculator

3
Posts Needed14
Rails Needed39
Pickets Needed221

Pricing a fence starts with knowing how many posts, rails, and pickets the run actually needs. This calculator divides your total fence length into equal post sections, counts the rails per section, and works out how many pickets fit across each section given the picket width and the gap you leave between boards. It is built for straight-run wood or composite fences and gives you a clean bill of materials to take to the lumber yard.

Formula

posts = ⌈length ÷ spacing⌉ + 1; sections = posts − 1; rails = sections × railsPerSection; pickets = sections × ⌊(spacing×12) ÷ (width + gap)⌋

length
Total fence length in feet
spacing
Distance between posts in feet
railsPerSection
Number of horizontal rails per fence section
width / gap
Picket face width and the gap left between pickets, in inches

How it works

  1. Enter the total fence length and the spacing between posts (commonly 6 or 8 feet); the tool divides length by spacing, rounds up, and adds one for the closing post.
  2. The number of sections is one fewer than the posts. Multiply sections by the rails per section to get total rails.
  3. For pickets, it converts the post spacing to inches, divides by the picket width plus gap to get pickets per section, and multiplies by the number of sections.

Worked example

A 100 ft fence with 8 ft post spacing, 2 rails per section, 5.5 in pickets, and a 0.25 in gap.

  1. Posts = ⌈100 ÷ 8⌉ + 1 = 13 + 1 = 14; sections = 14 − 1 = 13.
  2. Rails = 13 sections × 2 = 26.
  3. Pickets per section = ⌊(8 × 12) ÷ (5.5 + 0.25)⌋ = ⌊96 ÷ 5.75⌋ = 16; total = 13 × 16 = 208.

14 posts, 26 rails, and 208 pickets.

Frequently asked questions

Why is there one more post than sections?
A fence run needs a post at both ends plus one between each pair of sections, so the count is always sections + 1. The calculator rounds the length-over-spacing division up and adds that closing post automatically.
How does the picket gap affect the count?
Each picket effectively occupies its own width plus the gap beside it, so a wider gap means fewer pickets per section. The tool divides the section width in inches by (picket width + gap) and rounds down to whole pickets.
Does this handle corners and gates?
It assumes straight runs with evenly spaced posts. For corners, add a post at each turn, and for gates subtract the gate opening from a section and order hardware separately, since gates use their own framing.
Should I buy extra material?
Yes. This gives the exact theoretical count, but real projects waste pickets on cuts, splits, and uneven terrain, so adding about 5-10% to the picket and rail totals is a sensible buffer.