Fence Calculator

The number of fence posts is calculated by dividing the fenceable length by the post spacing and adding one (for the end post), plus two additional posts per gate opening. For a 100-foot fence with 8-foot spacing and one gate, that works out to 15 posts, 12 panels, and 36 rails. Enter your fence dimensions below for an instant material count.

Quick Answer

A 100-foot fence with 8-foot post spacing, 8-foot panels, 6-foot height, and one 4-foot gate requires 15 posts, 12 panels, and 36 rails.

Common Examples

Input Result
100 ft, 8 ft spacing, 8 ft panels, 6 ft tall, 1 gate 15 posts, 12 panels, 36 rails
150 ft, 8 ft spacing, 8 ft panels, 6 ft tall, 2 gates 22 posts, 18 panels, 54 rails
200 ft, 8 ft spacing, 6 ft panels, 6 ft tall, 0 gates 26 posts, 34 panels, 102 rails
50 ft, 6 ft spacing, 6 ft panels, 4 ft tall, 1 gate 11 posts, 8 panels, 16 rails
80 ft, 8 ft spacing, 8 ft panels, 6 ft tall, 0 gates 11 posts, 10 panels, 30 rails

How It Works

The Formulas

Fenceable Length = Total Length - (Number of Gates x Gate Width)

Gate openings are subtracted from the total length because those sections are filled by gates, not panels.

Posts = ceil(Fenceable Length / Post Spacing) + 1 + (Gates x 2)

You always need one more post than the number of sections (like how a 3-section fence needs 4 posts). Each gate requires two additional posts (one on each side of the opening).

Panels = ceil(Fenceable Length / Panel Width)

Panels fill the spaces between posts. If the panel width matches the post spacing, the number of panels equals the number of sections.

Rails = Panels x Rails per Section

Horizontal rails run between posts and support the fence boards or panels. Fences up to 4 feet tall typically use 2 rails per section. Fences taller than 4 feet use 3 rails for structural stability.

Post Length

Fence posts are typically buried one-third of their total length in the ground, or at least 2 feet deep. For a 6-foot fence, posts are usually 8 feet long (6 feet above ground plus 2 feet buried). For areas with frost, posts are set below the frost line, which may require 3 feet or more of buried depth.

Materials Overview

Common fence types include wood privacy (dog-ear or flat-top), wood picket, vinyl, chain link, and aluminum. This calculator provides a general material count suitable for wood fence construction. Vinyl and metal fences may use different panel configurations.

Worked Example

For a 150-foot fence with 8-foot post spacing, 8-foot panels, 6-foot height, and 2 gates (4 feet wide each): Fenceable length = 150 - (2 x 4) = 142 feet. Posts = ceil(142 / 8) + 1 + (2 x 2) = 18 + 1 + 4 = 23 posts. Panels = ceil(142 / 8) = 18 panels. Rails per section = 3 (since the fence is 6 feet tall, more than 4 feet). Rails = 18 x 3 = 54 rails.

Related Calculators

Frequently Asked Questions

How far apart should fence posts be?
Standard fence post spacing is 6 to 8 feet on center. Eight feet is the most common for wood privacy fences because it matches standard panel and lumber lengths. For chain link fences, 10-foot spacing is typical. Shorter spacing (6 feet) provides a sturdier fence, especially in areas with high winds.
How deep should fence posts be set?
A general rule is to bury one-third of the total post length. For a 6-foot fence with 8-foot posts, that means 2 feet in the ground. In regions with frost, posts are set below the local frost line, which may be 3 to 4 feet deep. Setting posts in concrete increases stability.
How many rails do I need per fence section?
Fences up to 4 feet tall typically require 2 horizontal rails per section (top and bottom). Fences taller than 4 feet use 3 rails (top, middle, and bottom) for additional structural support. Some decorative fences may use different rail configurations.
How do I account for corners in my fence?
Corner posts count as both the end of one section and the beginning of the next, so they do not add extra posts beyond what the formula calculates. However, corner posts and end posts are often larger (such as 6x6 instead of 4x4) for added strength. Count the number of corners to determine how many larger posts to purchase.
Does this calculator include the gate hardware?
This calculator estimates the structural materials (posts, panels, and rails) for the fence sections. Gate hardware, including hinges, latches, and the gate frame itself, is calculated separately. Each gate opening requires its own gate kit sized to the opening width and fence height.