Home / Fence Calculator

Fence Calculator

150 feet of fence line at 8 foot post spacing needs 20 posts, 57 rails at 3 per section, and 315 pickets. Subtract a gate's width from the total length first, then add two extra posts for the gate frame, since the calculator below assumes a solid run.

Fence line

Materials list

Pickets0
Posts0
Rails0
Sections0

Assumes a solid run. Subtract gate width before entering length, then add posts for the gate frame.

Plan the property line before you plan the fence

A fence estimate that starts with just a total length skips the two things most likely to throw off a materials order: where the gate goes and where the corners fall. Walk the line first, mark the gate location and every corner, then measure each straight run between those points separately. Run each straight section through the calculator on its own, since post spacing and rail counts are a per-section math problem, not a single number for a property with more than one straight stretch.

Formula: sections = ceil(length / post spacing). Posts = sections + 1. Rails = sections x rails per section. Pickets = ceil((length in inches) / (picket width + gap)).

Gates change the post count, not just the length

A gate opening is not a picket section, it is a frame with its own hardware and, usually, two dedicated posts sized heavier than the line posts on either side to carry the swinging weight. Subtract the gate's width from your total fence length before entering it above, then add those two gate posts by hand to whatever the calculator returns. Skipping this step is the most common reason a fence materials order comes up two posts short.

Fence featureWhat to add beyond the base calculation
Single walk gate (3 to 4 ft)2 heavier posts, gate hardware kit
Double drive gate (10 to 12 ft)2 heavier posts, hinges rated for the gate weight, a drop rod or center catch
Corner1 heavier, often braced post per corner
Slope or grade changeExtra rail and picket length to follow the contour rather than a straight line

A worked example with a gate

Take a 158 foot property line with a single 8 foot walk gate partway along it. Subtract the gate: 150 feet of fence remains, which at 8 foot spacing gives 19 sections, 20 posts, and (at 3 rails per section) 57 rails. Add 2 posts for the gate frame itself for 22 posts total. Pickets run off the 150 feet of solid fencing only, since the gate has its own panel, giving roughly 315 pickets at 5.5 inch width with a quarter inch gap.

Terrain and corners the calculator does not see

This tool assumes a straight, level run. A property line that steps down a slope needs the fence to either step in level sections or rack (angle) to follow the grade, both of which use more picket length per linear foot of ground than a flat run of the same distance measured on a tape. Corners need a post rated to carry load from two directions, typically larger or additionally braced compared with the line posts the calculator counts. Measure and price each straight segment, corner, and slope section as its own small project rather than one flat total.

Before you dig

Related calculators

Good to know

Fence project questions

How do I account for a gate in the post and picket count?

Subtract the gate's width from the total fence length before running the calculator, since a gate opening does not get pickets or the same rail structure as a solid section. Add two posts for the gate itself, one on each side, on top of what the calculator returns for the remaining run.

Should corner posts be counted differently than line posts?

Yes for materials, not for this calculator's count. A corner post carries load from two directions and is usually set larger or braced differently than a straight line post, so budget a heavier post and extra concrete for each corner even though the total post count here treats them the same.

Does sloped ground change how much fencing I need?

Sloped or stepped fence lines usually need more linear feet of top rail and more pickets than a flat run of the same straight-line distance, because the fence has to step or rack to follow the grade. Measure along the actual ground contour, not a straight tape line across the yard, for a sloped section.

How close to the property line can I build a fence?

This varies by city and county, and most require a permit plus a survey or property pin verification before you dig. Check local zoning rules and, ideally, have the property line staked before setting posts, since a fence built even a few inches over the line can force a costly rebuild.

How many bags of concrete does one fence post need?

It depends on the post hole diameter and depth, which vary by fence height and local frost line requirements, so check your post size against the concrete bag's coverage chart rather than assuming a fixed number per post. Deeper, wider holes for taller fences and corner posts need more bags than a shallow line-post hole.