Fence Calculator

Calculate how many posts, rails, pickets, or pre-built panels you need for your fence project. Enter the total linear feet, post spacing, and fence style.

Perimeter of the area to fence

Materials Needed
Posts
Rails
Pickets
Panels
Gates

Add 5-10% extra for waste and miscalculation. Account for gate openings in your total linear feet if they require separate post pairs.

How to Use

  1. 1

    Choose the fence style - picket/board for individual planks, or panels for pre-assembled 6-8 ft sections

  2. 2

    Measure and enter the total linear feet (perimeter) of your fence run, excluding gate openings

  3. 3

    Select post spacing, number of rails, and (for picket fences) picket width and gap

  4. 4

    Click Calculate to see posts, rails, pickets or panels, and gate count

Formula

Posts = ⌈Linear Feet ÷ Post Spacing⌉ + 1
Rails = Sections × Rails per Section
Pickets = ⌈Linear Feet ÷ (Picket Width + Gap) in ft⌉

The number of fence sections equals linear feet divided by post spacing, rounded up. Posts are one more than sections (a fence with 3 sections needs 4 corner/end posts). Pickets are calculated from their combined face width plus gap, converted to feet.

Examples

Backyard: 120 linear ft, 8 ft post spacing, 3 rails, 3.5 in pickets with 0.5 in gap

Sections = ⌈120/8⌉ = 15 | Posts = 16 | Rails = 45 | Pickets = ⌈120 ÷ (4/12)⌉ = 360

Result: 16 posts, 45 rails, 360 pickets

Side yard panels: 40 linear ft, 8 ft post spacing, 2 rails, 8 ft panels

Sections = ⌈40/8⌉ = 5 | Posts = 6 | Rails = 10 | Panels = ⌈40/8⌉ = 5

Result: 6 posts, 10 rails, 5 panels

Privacy fence: 80 linear ft, 6 ft post spacing, 4 rails, 5.5 in boards (no gap)

Sections = ⌈80/6⌉ = 14 | Posts = 15 | Rails = 56 | Pickets = ⌈80 ÷ (5.5/12)⌉ = 175

Result: 15 posts, 56 rails, 175 boards

FAQ

A general rule is to bury at least 1/3 of the total post length. For a 6-ft tall fence, use 9-ft posts and bury 3 ft. In frost-prone climates, posts must go below the frost line (often 2-4 ft) to prevent heaving.
Many municipalities require a permit for fences above a certain height (commonly 4-6 ft). Check your local building department and HOA rules before starting. Also call 811 (in the US) to have underground utilities located before digging post holes.
Concrete footings are recommended for most fence posts, especially for gate posts and corner posts that experience the most stress. For interior picket posts on level ground, compacted gravel can work but concrete provides better long-term stability.

Pro Tip

Always call 811 before digging to have underground utilities marked. Hitting a buried gas or electrical line is a serious safety hazard. This free service is required by law in the US and most countries have a similar service.

Post Depth Guide

3 ft fence2 ft deep
4 ft fence2 ft deep
6 ft fence3 ft deep
8 ft fence3-4 ft deep