1. Home
  2. Roofing, Decks & Lumber
  3. Fence Calculator
Roofing, Decks & Lumber

Fence Calculator

Enter the fence length and choose pickets or panels. You get the posts, rails, pickets or panels and fasteners to buy, with gate openings taken out and the post length to look for.

  • No sign-up
  • No personal info
  • Imperial & metric
  • Formulas shown
Fence Calculator illustration

Your project

Quick start
Fence type

Gates

Result

Quick answer

Posts = sections + 1, where sections = fence length ÷ post spacing, rounded up. A 100 ft privacy fence with posts every 8 ft needs 14 posts, 39 rails (3 per section) and 219 pickets of 5½ in set tight together. For a 6 ft fence, use 8 ft posts so 2 ft goes in the ground.

How to use the fence calculator

  1. Measure the fence line. Add up every side, including the gate openings. Check your property lines and local height limits first.
  2. Pick the fence type. Pickets on rails is a stick-built fence. Pre-built panels counts one panel per section.
  3. Set the post spacing. 8 ft is standard for wood; 6 ft is stronger in wind. Panels set the spacing: use the panel width.
  4. Add gates. Their width is taken out of the pickets and rails, and each gate adds a post.

Fence material formulas

Fence to build = total length − gates × gate width Sections = fence to build ÷ post spacing, rounded up Posts = sections + 1 + number of gates Rails = sections × rails per section Pickets = fence to build ÷ (picket width + gap), rounded up Fasteners = pickets × rails × 2

Example: 100 ft ÷ 8 ft = 12.5, so 13 sections and 14 posts. Three rails per section is 39 rails. 100 ft is 1,200 in, and 1,200 ÷ 5.5 = 218.2, so 219 pickets.

Fence materials by length

Fence lengthSectionsPostsRails (3 per section)5½ in picketsNails or screws
50 ft7821110660
75 ft101130164984
100 ft1314392191,314
150 ft1920573281,968
200 ft2526754372,622
300 ft38391146553,930
500 ft63641891,0916,546

Posts 8 ft apart, pickets with no gap, no gates.

Post length, depth and concrete

  • Post length: bury about one third of the post, and at least 2 ft (60 cm). A 6 ft fence uses 8 ft posts; a 4 ft fence uses 6 ft posts. Go deeper than the frost line in cold climates.
  • Corner, end and gate posts carry more load. Many builders use 6×6 posts or deeper holes for gates.
  • Concrete: use the fence post concrete calculator with the post count from this page.
  • Rails: 2×4 rails span between posts, so 8 ft spacing uses 8 ft rails.

Before you dig, have underground utilities marked (call 811 in the United States).

Sources, assumptions and limits

What the calculator assumes

  • Sections are equal to the post spacing; the last section is usually shorter and is still counted as a full one.
  • Each gate removes its width from pickets and rails and adds one post. Gate hardware and gate frames are not included.
  • Fasteners are two per picket at each rail.

Where the numbers come from

Checked by the DIY Calc team against the sources above. Products and local rules vary, so treat every result as an estimate. Found an error? Email [email protected].

Frequently asked questions

How many pickets do I need for a 100 ft fence?
219 pickets of 5½ in (1×6) set tight for privacy, or 343 pickets of 3½ in (1×4). Add about 5% for splits and cuts.
How many fence posts do I need?
One more than the number of sections, plus one for each gate. A 100 ft fence with posts 8 ft apart needs 14 posts; 200 ft needs 26.
How far apart should fence posts be?
Usually 8 ft for wood fences, or 6 ft for extra strength in windy areas and for heavier fences. Pre-built panels set the spacing.
How many rails does a 6 ft fence need?
Three rails (top, middle and bottom) for a 6 ft privacy fence. Fences up to about 4 ft use two.
How long should fence posts be for a 6 ft fence?
8 ft, so that about 2 ft is in the ground. Use longer posts where the frost line is deeper.

Last reviewed . Estimates only: see the disclaimer.

Embed this calculator

Free for blogs, schools and contractors. Paste this code into your page. The small “Powered by” line is optional, and we appreciate it if you keep it.