Skip to main content
construction

Fence Calculator

Calculate the number of posts, rails, and pickets needed for a fence based on length and spacing.

Reviewed by Christopher FloiedPublished Updated

This free online fence calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.

Minimum: 0

Total length of the fence line

Distance between posts (6-8 ft typical)

Horizontal rails per section (2 or 3)

Minimum: 0

Width of each picket in inches

Space between pickets

Results

Posts

13

Rails

24

Pickets

229

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the Fence Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.

2

Review your inputs

Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The Fence Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

Formula Reference

Fence Calculator Formula

See calculator inputs for the governing equation

Variables: All variables and their units are labeled in the calculator interface above. Input fields accept values in multiple unit systems — select your preferred unit from the dropdown next to each field.

When to Use This Calculator

  • Use the Fence Calculator when you need accurate results quickly without the risk of manual computation errors or unit conversion mistakes.
  • Use it to verify calculations made by hand or in spreadsheets — an independent check can catch errors before they lead to costly decisions.
  • Use it to explore how changing input parameters affects the output — a quick way to develop intuition and identify the most influential variables.
  • Use it when collaborating with others to ensure everyone is working from the same numbers and applying the same assumptions.

About This Calculator

The Fence Calculator is a free, browser-based calculation tool for engineers, students, and technical professionals. Calculate the number of posts, rails, and pickets needed for a fence based on length and spacing. It implements standard formulas and supports both metric (SI) and imperial unit systems with automatic unit conversion. All calculations are performed instantly in your browser with no data sent to a server. Use this calculator as a quick reference and sanity-check tool during design, analysis, and learning. Always verify results against primary engineering references and applicable standards for any safety-critical application.

About Fence Calculator

Building a fence requires careful planning to determine the number of posts, rails, and pickets. Post spacing depends on the fence style and wind load -- 6 to 8 feet is standard for most residential fences. Rails connect the posts horizontally, and pickets (or boards) are attached vertically to the rails. This calculator provides a material list based on your fence length, post spacing, and picket dimensions. Whether you are building a privacy fence, a picket fence, or a ranch-style fence, getting accurate counts ensures you make one trip to the lumber yard instead of three.

The Math Behind It

Fence construction begins with laying out the post positions. End posts and corner posts carry more load and are typically set in concrete footings 24 to 36 inches deep (below the frost line in cold climates). Line posts between them can sometimes use compacted gravel backfill. The post spacing determines how many sections the fence has, and each section gets horizontal rails (2 rails for fences under 5 feet, 3 rails for taller fences). Picket fences use narrow boards with gaps between them, while privacy fences use wider boards with no gaps or overlapping boards. The picket count is calculated by dividing the total fence length (in inches) by the sum of picket width and gap width. For privacy fences with no gap, the gap is zero and you simply divide the length by the board width. Common post sizes are 4x4 for fences up to 6 feet and 6x6 for taller or structural fences. Rails are typically 2x4 lumber. Pressure-treated or naturally rot-resistant wood (cedar, redwood) is essential for longevity. Gate openings require additional posts and hardware, and should be subtracted from the fence length before calculating material.

Formula Reference

Posts

Posts = floor(Length / Spacing) + 1

Variables: Length and spacing in feet

Pickets

Pickets = Fence Length (in) / (Picket Width + Gap)

Variables: All in inches

Worked Examples

Example 1: 100 ft privacy fence, 8 ft post spacing

Length = 100 ft, Spacing = 8 ft, Rails = 3, Picket = 5.5 in, Gap = 0 in

Step 1:Posts = floor(100 / 8) + 1 = 13 posts
Step 2:Sections = 13 - 1 = 12
Step 3:Rails = 12 x 3 = 36 rails
Step 4:Pickets = ceil(1200 / 5.5) = 219 pickets

You need 13 posts, 36 rails, and 219 fence boards.

Common Mistakes & Tips

  • !Forgetting the +1 for the end post (a 100 ft fence with 10 ft spacing needs 11 posts, not 10).
  • !Not accounting for gate openings which require wider spacing and additional hardware.
  • !Using untreated lumber for in-ground posts, leading to premature rot.
  • !Setting posts too shallow in cold climates where frost heave is a concern.

Related Concepts

Used in These Calculators

Calculators that build on or apply the concepts from this page:

Frequently Asked Questions

How deep should fence posts be set?

As a rule of thumb, bury one-third of the total post length. For a 6-foot fence with 8-foot posts, set them 24-30 inches deep, or deeper if below the frost line in your area.

What post spacing should I use?

Most residential fences use 6 to 8 foot spacing. Use 6 feet for areas with high winds or for tall fences, and 8 feet for standard conditions with shorter fences.