Fence Calculator
Calculate posts, rails, and pickets for your fence; enter length, post spacing, and picket dimensions.
Fence Length
Enter your fence dimensions and click Calculate.
How Does the Formula Work?
The fence calculator counts the posts, rails and pickets for one straight run of fence. Enter the length of the run, the spacing between posts, how many horizontal rails each section carries, and the width of one picket and of the gap beside it. Work in metres with pickets in centimetres, or switch to feet with pickets in inches.
Sections = Posts − 1
Rails = Sections × Rails per Section
Pickets = ⌈Fence Length ÷ (Picket Width + Gap)⌉
Example: 100 ft run, 8 ft spacing, 2 rails, 3.5 in pickets with 1.75 in gaps → 14 posts, 13 sections, 26 rails, 229 pickets
How the Counts Are Rounded
Both divisions round up, because a part-section still needs a post at its far end and a part-picket is still a whole board to buy. A 100 ft run at 8 ft spacing is 12.5 spacings, so it gets 13 sections and 14 posts. When the length divides exactly there is nothing to round: 24 ft at 8 ft spacing gives 3 sections and 4 posts. There is always one post more than there are sections, because the run needs a post at each end.
What the Picket Count Assumes
Pickets are counted as the run length divided by one picket plus one gap, which leaves a gap after every picket, the last one included. The width of the posts is not taken off the run. With 3.5 in pickets and 1.75 in gaps that comes to about 2.3 pickets per foot of fence, and to about 3.4 per foot with no gap at all.
Corners, Gates and Longer Layouts
The calculator handles one straight line. For an L-shaped or enclosed fence, work out each straight run on its own and add the results; where two runs meet at a corner they share a post, so take one post off the total for every shared corner. A gate opening needs no pickets, so enter the fence on each side of the gate as a separate run.
Permits in the United States
In the United States, building permits are handled locally. The International Residential Code is a model code that jurisdictions adopt with their own amendments, and section R105.2 of its 2024 edition lists fences up to 7 feet (2134 mm) tall among the work that needs no building permit. The same section says the exemption does not allow work that breaks the code or any other local law or ordinance, so zoning rules on height and setbacks, and any homeowners' association rules, still apply. Check with the local building department before you dig.
Tips & Recommendations
Take the length along the line where the fence will stand, not from a plan or a map.
Posts and pickets are rounded up to whole pieces. A part-section still needs a post at its end.
Work out each straight run on its own and take one post off for every shared corner.
Permits and height limits are set locally. Ask the building department before you dig.
Frequently Asked Questions
How many posts does a 100 ft fence need?
At 8 ft spacing, 100 ÷ 8 is 12.5, which rounds up to 13 sections, so the run takes 14 posts and 13 sections of rails.
Why is there one more post than sections?
Each section sits between two posts and the run needs a post at both ends, so a straight fence always has one post more than it has sections.
How many pickets per foot?
With 3.5 in pickets and 1.75 in gaps, about 2.3 pickets per foot. With no gap, about 3.4 per foot.
Do I need a permit for a fence?
It depends on where you live. Section R105.2 of the 2024 International Residential Code lists fences up to 7 feet tall as work that needs no building permit, but each jurisdiction adopts the code with its own amendments, and zoning and other local rules still apply.
Should I buy extra materials?
The counts are exact for the sizes you enter. They leave nothing for split or knotted boards, cutting mistakes or angled sections, so add your own allowance for those.
Recent Calculations
No calculations yet