Fence Calculator

Estimate the materials needed to build a residential fence.

Home Materials Posts · pickets · rails
Rate this calculator · 5.0 (1)

Fence Calculator

Posts, rails, pickets, and panels for any layout

Instructions — Fence Calculator

  1. Choose layout: a single perimeter number, or length × width for a rectangular yard.
  2. Pick fence height (3 to 8 ft). Heights of 6 ft and up use 3 rails per panel instead of 2.
  3. Enter post spacing (typical 6 to 8 ft) and picket on-center spacing in inches (typical 4 in).
  4. Enter the number of gates and average gate width. Gate length is removed from picket and rail totals.

The output covers posts (including extra gate posts), panels, pickets, rails, and the number of 50 lb concrete bags for setting posts.

Formulas

Total perimeter (rectangle):

Perimeter = 2 × (Length + Width)

Posts and panels:

Sections = ceil(Effective length / Post spacing)
Posts = Sections + 1 + 1 per gate

Pickets:

Pickets = ceil(Effective length × 12 / Picket spacing)

Effective length = Perimeter − Total gate width.

Reference

  • Standard post spacing: 6–8 ft for wood, 8–10 ft for chain-link
  • Picket on-center spacing: 4 in typical, 6 in for gap-style
  • Rails per panel: 2 for 3–5 ft, 3 for 6 ft and taller
  • Post hole depth: at least one-third of fence height, minimum 24–30 in
  • Common gate widths: 3–4 ft for walk gates, 8–12 ft for driveway gates
  • Concrete for posts: roughly one 50 lb bag per post for a 4 in diameter hole at 30 in

Article — Fence Calculator

Fence calculator: posts, pickets, and panels for any yard

A fence calculator converts a yard layout into a parts list: number of posts, panels or sections, pickets, rails, and concrete bags. A rectangular yard 60 ft by 40 ft has a 200 ft perimeter. At 8 ft post spacing, that needs 26 posts and 25 panels, plus extra posts at each gate.

The arithmetic is straightforward once you fix three numbers: perimeter, post spacing, and picket on-center spacing. Everything else is rounding and adding a few extras for gates. This article walks through the formulas the calculator uses, plus the codes and rules of thumb that govern residential fencing in the U.S.

What the fence calculator does

Enter a perimeter directly, or enter the length and width of a rectangular yard and let the calculator compute the perimeter. Add the chosen post spacing, picket on-center spacing in inches, and any gates with their widths. The output is a quantity list you can hand to a lumber yard or load into a home-improvement shopping cart.

This is a planning tool, not a structural calculator. Wind load, soil bearing capacity, and frost depth all change the design for a real installation. For anything taller than 6 ft, or in regions with heavy snow or strong wind, consult local fence-installation standards and your building department.

Fence perimeter math

For a rectangle, perimeter is two times the sum of the long and short sides. A 50 ft by 30 ft lot has a 160 ft perimeter. Pentagon-shaped lots, L-shaped yards, and corner lots need the perimeter measured by walking the line; sum the segments and enter the result.

Fence math
Perimeter = 2 × (L + W)
Sections = ceil(Effective length / Spacing)
Pickets = ceil(Length × 12 / Picket spacing)

Effective length is the perimeter minus the combined gate widths, since a gate replaces a fence section rather than adding to it.

Fence post spacing

Standard residential post spacing is 6 to 8 ft for wood and vinyl, 8 to 10 ft for chain-link, and 6 ft for ornamental aluminum. Spacings above 10 ft risk visible sag and post lean, especially with heavy panels and wind loads. The U.S. Department of Agriculture's Wood Handbook recommends slightly tighter spacing in regions prone to heavy snow.

Did you know

Posts set in concrete usually outlast the panels they support. The American Wood Council recommends concrete collars at the base only, with the post itself bedded on gravel for drainage. That avoids the slow rot pattern where moisture wicks up the grain through a fully encased post.

Pickets and rails per panel

A picket fence uses vertical pickets attached to horizontal rails, which are mounted between posts. Pickets are typically 5/8 to 1 in thick and 3.5 to 5.5 in wide. The on-center spacing controls how much gap shows between pickets.

For a 4 in on-center spacing with 3.5 in wide pickets, the visible gap is half an inch. For a closed privacy fence, pickets are usually shiplapped or board-on-board with no visible gap at all. The calculator's picket count is based on on-center spacing because that is what the layout marks measure.

  • 4 in on-center 3 pickets per linear foot, classic picket look
  • 6 in on-center 2 pickets per linear foot, more gap
  • Shadow box alternating sides, doubles picket count
  • Privacy board-to-board with no gap, 3.4 pickets per foot at 3.5 in wide
  • Rails per panel 2 below 6 ft, 3 at 6 ft and taller
  • Cap rail optional horizontal trim along the top, adds 1 linear foot per section

Fence types compared

W
Wood picket
$25–$50 / ft
15–20 year life
V
Vinyl privacy
$50–$100 / ft
30+ year life

Chain-link is cheapest by linear foot but offers no privacy. Vinyl costs more up front but skips repainting and staining, which usually saves money over a 30-year span. Aluminum is popular in coastal areas because it does not rust.

Gates and special fence sections

Each gate consumes a section of fencing and adds two posts (one on each side) that must be stronger than ordinary line posts. For driveway gates 8 ft wide and up, the gate posts are often 6×6 in instead of the 4×4 in used on a line. The calculator subtracts the gate width from the effective length and adds one extra post per gate.

Tip

Place gates where the fence line crosses a flat spot, not on a slope. A gate on a slope must clear the high side as it swings, which forces either a taller arc or a stepped fence panel that looks awkward. Walking the line before staking saves expensive rework.

Fence installation tips

Set posts at least one-third of the fence height below ground, and below the local frost line. For a 6 ft fence in northern climates, that often means a 3 ft hole, sometimes 4 ft. Fast-setting concrete that uses water poured into a dry hole simplifies one-person installs but is more expensive per cubic foot than ready-mixed bags.

Call before you dig

In the U.S., call 811 at least a few business days before digging post holes. Underground gas, electric, and communication lines are surprisingly shallow, sometimes just 18 in deep. The free utility-locator service marks them with paint and flags so you can offset your line.

Fence permits and codes

Most U.S. municipalities require a fence permit for anything over 6 to 7 ft and for any fence in the front yard. Common rules include a maximum height (often 4 ft in front and 6 ft in the side and rear), setback from the property line, and rules about which side of the fence faces out. Homeowner association covenants sometimes add restrictions on color or material.

Check your local code before ordering materials. A fence built two inches over the property line can become an expensive boundary dispute. A licensed surveyor's lot pins are the only reliable reference.

FAQ

At a standard 8 ft post spacing, 100 ft needs 13 posts for a straight run (12 sections + 1 end post). Add one extra post per gate. At 6 ft spacing, that becomes 17 posts plus gate posts.
For wood, vinyl, and aluminum residential fences, 6–8 ft is standard. Chain-link can stretch to 8–10 ft because the fabric carries less load than a panel. Going beyond 10 ft risks sag and post movement.
At 4 in on-center, a 6 ft panel uses 18 pickets (72 in / 4 in). At 6 in on-center, it uses 12. The pickets typically run 5/8 to 1 in thick, so the visible gap is slightly less than the on-center spacing.
At least one-third of the post height above ground, with a minimum of 24 to 30 in. A 6 ft fence usually has posts buried 2 to 3 ft deep, set in concrete and below the local frost line.
Two rails (top and bottom) for fences 3 to 5 ft tall. Three rails for 6 ft and taller, with the third rail in the middle. Privacy fences sometimes use three rails even at 5 ft for extra rigidity.
Most U.S. jurisdictions require a permit for fences over 6 to 7 ft, and many require one for any fence in the front yard. Setback distances and material restrictions are common. Check with your city building department before digging.
Chain-link is the cheapest at roughly $10–$30 per linear foot installed. Wood picket runs $25–$50, vinyl runs $50–$100, and aluminum runs $35–$80. Prices vary by region and quality.
As a rule of thumb, one 50 lb bag of fast-setting concrete per post for a 4 in diameter hole 30 in deep. Larger 4×4 posts or deeper holes (in colder climates) often need 1.5 to 2 bags per post.