Fence calculator

Fence Calculator

A fence calculator that turns your fence length, post spacing and rails per section into a post, section and rail count you can shop from. Miss a post and the run sags; order too many and the extras sit in the yard. Plan corners, gates and concrete from the same numbers, so the materials arrive in one trip and the build starts on time.

  • Free to use
  • No sign-up
  • Formula and sources shown
Fence Calculator

Got the number? Save it before it gets lost.

A result on a screen is easy to lose. Save this estimate in the app and it stays with the project, ready when you order.

Save this estimate in the app

8 ft is standard for wood/vinyl privacy fencing.

Posts needed

14

Fence sections

13

Rails needed

26

Turn this result into a priced plan

Save it to a project, add the rest of your materials, and send a client-ready quote. No retyping, no spreadsheet, no lost numbers.

Open this calculator in the app

Formula

Sections = ceil(Length ÷ Spacing); Posts = Sections + 1; Rails = Sections × Rails/Section

Worked example. A 100 ft fence with posts every 8 ft: 100 ÷ 8 = 12.5, rounded up to 13 sections, so 14 posts. At 2 rails per section, that's 26 rails.

Start with the posts, because every section hangs on them. Divide the fence length by the post spacing, round up to get the number of sections, and add one. A 100 ft fence with posts every 8 ft has 13 sections and needs 14 posts. At 2 rails per section that is 26 rails, and the same count sets up your corners, gates and concrete.

Key takeaways

  • •Posts = sections + 1 for a straight run, and posts = sections for a closed loop such as a fully fenced yard, because the last section meets the first post.
  • •Sections = ceil(length ÷ spacing). Always round up, because a partial section still needs a post at the end.
  • •8 ft is the standard post spacing for wood and vinyl privacy fences, 6 ft is used for heavier or taller fences, and 10 ft is common for chain link.
  • •Rails are counted per section: 2 for lower fences and often 3 for 6 ft privacy fences.
  • •Gates need their own posts and hardware. Count them with the gate planner calculator.

How to use the fence calculator

  1. Measure the total length of fence in feet along the line where the posts will go. Use a string line or measuring wheel for long runs.
  2. Enter the total fence length.
  3. Choose the post spacing: 6 ft, 8 ft or 10 ft. Use 8 ft for a standard wood or vinyl privacy fence.
  4. Choose the number of rails per section. Check your fence style or panel specification.
  5. Read the posts, sections and rails.
  6. For a fence with a gate, enter the fence length without the gate opening, then add the gate posts separately.
  7. Add concrete with the fence post concrete calculator and pickets with the fence picket calculator.

Fence formulas

Sections = ceil[ Fence length ÷ Post spacing ]

Posts = Sections + 1 (straight run) | Posts = Sections (closed loop)

Rails = Sections × Rails per section

Actual spacing = Fence length ÷ Sections

The calculator rounds up to whole sections. The last section is then slightly shorter than the others, so the real spacing is a little less than the figure you entered. Dividing the length by the number of sections gives the spacing to mark out so all sections are equal.

Fence calculator examples

Example 1: 100 ft fence, 8 ft spacing, 2 rails

  • Sections = 100 ÷ 8 = 12.5, rounded up = 13
  • Posts = 13 + 1 = 14; rails = 13 × 2 = 26
  • Equal spacing = 100 ÷ 13 = 7.69 ft

Example 2: 120 ft fence, 6 ft spacing, 3 rails

  • Sections = 20; posts = 21; rails = 60

Example 3: 250 ft fence, 8 ft spacing, 2 rails

  • Sections = 250 ÷ 8 = 31.25, rounded up = 32
  • Posts = 33; rails = 64

Example 4: 80 ft fence, 8 ft spacing

  • Sections = 10 exactly; posts = 11; rails = 20 with 2 rails per section

Example 5: a closed yard of 40 ft × 30 ft (140 ft perimeter), 8 ft spacing

  • Each 40 ft side = 5 sections; each 30 ft side = 3.75, rounded up = 4 sections
  • Sections = 2 × (5 + 4) = 18; posts for a closed loop = 18 (not 19)

Example 6: 100 ft run with a 4 ft gate

  • Fence without the gate opening = 96 ft; sections = 12; posts = 13
  • Add 2 gate posts from the gate planner: at most 15 posts, fewer if the gate shares posts with the run

Post spacing by fence type

Fence typeTypical post spacingNotes
Wood privacy fence8 ftMatches common 8 ft rails and panels
Heavy or tall wood fence6 ftLess rail sag and wind load per section
Vinyl fence6 to 8 ftFollow the maker's section length
Chain link10 ft or lessSee the chain link fence calculator
Split rail8 to 10 ftRails often span one section
Wire or livestock fence8 to 16 ft or moreDepends on the wire and posts

These are common practices, not rules. Panel and rail lengths, wind and local code can change the spacing. Follow your fence maker's instructions.

Rails per section and post length

Fence heightRails per section (common)Post above groundPost in ground
3 to 4 ft23 to 4 ft1.5 to 2 ft or more
5 ft2 to 35 ftAbout 2.5 ft
6 ft36 ftAbout 3 ft
8 ft3 to 48 ftAbout 4 ft or more

A common rule is to set the post about one-half the above-ground height in the ground, which is one third of the post's total length. Below the frost line is better in cold climates. Check local practice.

Posts, panels, pickets and rails: what to count

ItemHow to estimateCalculator
Line postsSections + 1 (or sections in a loop)This page
Concrete for postsHole volume per postFence post concrete calculator
Pickets or boardsFence length ÷ (board width + gap)Fence picket calculator
Pre-made panelsFence length ÷ panel widthFence panel calculator
Gates, hinges, latchesTwo posts and two or three hinges per gateGate planner calculator
Stain or sealerOne face area ÷ coverage per gallonFence stain calculator

Corners, ends and gates

  • •A straight line of fence has an end post at each end, so posts = sections + 1.
  • •A closed shape has no free ends, so the number of posts equals the number of sections.
  • •Every corner and every gate needs a strong post. Use a larger post or extra bracing at corners, ends and gates, because they carry the pull of the fence.
  • •Measure each straight side separately for a yard with corners, round each side up to whole sections, and add the sides.
  • •Subtract each gate opening from the run, then add the gate posts and hardware.

Planning the fence line

  • •Confirm the property line with a survey or boundary markers before you set a single post.
  • •Check local rules on fence height, setbacks, materials and permits. Many places limit front-yard fences to a lower height than back-yard fences, and homeowner associations can add rules.
  • •Call 811 (in the United States) a few days before you dig, so buried utility lines are marked.
  • •Mark every post location with stakes and string before digging, and adjust the spacing so all sections are equal.
  • •Plan for slopes. On a slope, posts are set plumb and the rails step or rake. Measure along the ground for the length, then check how your fence style handles slope.

Estimating fence cost

Cost = Posts × Post price + Rails × Rail price + Pickets or panels + Concrete + Hardware + Labor

Example only: 14 posts at $20 and 26 rails at $8 come to about $488 before pickets, concrete, hardware, gates and labor. Pickets or panels are usually the biggest material cost.

Troubleshooting common fence problems

ProblemLikely causeWhat to do
Leaning postsShallow holes, loose backfill or weak concreteSet posts deeper and plumb; brace until the concrete cures
Sagging railsSpacing too wide or rails too smallUse closer posts, a third rail or stronger rails
Rotting post basesWood not rated for ground contact or water sitting at the postUse ground-contact lumber; slope the concrete away from the post
Uneven section lengthsSpacing not divided evenlyDivide the length by the number of sections and mark all posts first
Fence line off the property lineNo surveyConfirm the line before building

Terms explained

TermMeaning
Line postA post between the ends and corners of a run
Terminal postAn end, corner or gate post that takes the pull of the fence
SectionThe span between two posts
RailThe horizontal board that pickets or panels fasten to
Post spacingThe distance from the center of one post to the next
Frost lineThe depth that the ground freezes in winter
On center (o.c.)Measured from center to center

Common fence calculator mistakes

  • •Forgetting the extra post at the end of a straight run.
  • •Adding an extra post to a closed loop that does not need it.
  • •Rounding down the number of sections, which leaves the last section without a post.
  • •Leaving out the gate posts and hardware.
  • •Measuring the fence on a slope along a level line instead of along the ground.
  • •Setting posts before checking the property line and local rules.

Metric conversions

FromTo
100 feet30.48 metres
8 feet2.44 metres
6 feet1.83 metres
2 × 4 inch rail (nominal)About 38 × 89 millimetres

Wood vs vinyl vs chain link: which fence is cheapest?

Chain link is the cheapest fence to buy, wood sits in the middle, and vinyl and metal cost the most up front. But the cheapest fence to buy is rarely the cheapest fence to own: wood needs stain or sealer every 2 to 4 years and occasional board replacement, while vinyl and metal need little more than a wash. Over 20 years, the upkeep on a wood fence can close much of the gap with vinyl. Compare all five types on the same measurements before you choose, and price them with local quotes, because costs vary by region and supplier.

Fence typeUpfront costTypical lifespanUpkeepBest for
Wood privacyModerate15 to 20 yearsStain or seal every 2 to 4 years; replace warped or rotted boardsPrivacy and a natural look
Wood picketLow to moderate15 to 20 yearsStain or paint every 2 to 4 yearsFront yards and curb appeal
Chain linkLow20 to 25 yearsAlmost none; check ties and tension wireLarge areas, pets and a tight budget
Vinyl (PVC)High20 to 30 yearsWash occasionally; no paintingLow maintenance and a clean look
Metal / ornamentalHigh25 years or moreAlmost none; touch up chips to stop rustSecurity and curb appeal

Cost bands are relative, not prices: get local quotes for your length and height. Lifespan depends on climate, soil, installation and maintenance.

Wood is the best value when you want privacy at a moderate price and do not mind maintenance. Vinyl wins when you want to forget about the fence after it is built. Chain link wins on large perimeters, where its low cost per foot matters most. For the stain and sealer a wood fence needs, use the fence stain calculator to work out the gallons, and for chain link use the chain link fence calculator for mesh and top rail.

Fence on a slope: stepped vs racked

A fence on a slope is built in one of two ways. Stepped fences keep each panel level and step down the hill, which works on any grade but leaves triangular gaps under the low end of each panel and uses a little more material. Racked fences tilt each panel to follow the slope, which looks better and leaves no gaps, but only works on gentle slopes and only with panels made to rack. Chain link and wire fences follow slopes easily; pre-assembled vinyl panels handle them worst.

MethodHow it worksWhen to use itWhat it costs you
SteppedEach panel stays level; the next panel starts lowerAny slope, including steep groundA little more material; triangular gaps at the bottom of each step
RackedEach panel tilts to follow the groundGentle slopes with rackable panelsLeast material, but only works where the panel can tilt
Follow the ground (wire / chain link)Mesh and rails follow the slopeSlopes of any gradeNeeds taller posts and more concrete at the low side

Measure the fence length along the ground on a slope, not along a level line, or you will under-order. Add extra waste for cuts on sloped ground: about 5% on flat ground, 10% on a gentle slope and 15% or more on a steep slope. On a slope, set the posts plumb and a little deeper on the downhill side, where the ground falls away from the post.

How much fence do I need for an acre?

One acre is 43,560 sq ft. A square acre has sides of about 208.7 ft and a perimeter of about 835 ft, so a square acre needs roughly 835 linear feet of fence. Real lots are rarely square, so measure your actual boundary, but the table below is a useful starting point for budgeting posts and rails.

Lot sizeSide of a square lotPerimeterPosts at 8 ft spacing (closed loop)
0.5 acre147.6 ft590 ft74
1 acre208.7 ft835 ft105
2 acres295.1 ft1,181 ft148
5 acres466.7 ft1,867 ft234
10 acres660.0 ft2,640 ft330

Posts equal sections for a closed loop. A 1 acre square lot at 8 ft spacing has 105 sections and 105 posts, and a 6 ft privacy fence on it needs 105 x 3 = 315 rails.

Example: fencing 1 acre, 8 ft spacing, 3 rails per section

  • Perimeter = 4 x 208.7 = 834.8 ft, about 835 ft
  • Sections = 835 / 8 = 104.4, rounded up = 105; posts = 105 (closed loop)
  • Rails = 105 x 3 = 315; concrete = 105 post holes

L-shaped and multi-run yards

Most yards are not one straight run. Measure each straight side separately, round each side up to whole sections, and add the sides. Where two runs meet at a corner they share one post, so subtract one post for each shared corner, or you will order a post you do not need.

Example 1: L-shaped yard, 60 ft run + 40 ft run, 8 ft spacing

  • Run A: 60 / 8 = 7.5, rounded up = 8 sections, 9 posts
  • Run B: 40 / 8 = 5 sections, 6 posts
  • Shared corner post: subtract 1, so 9 + 6 - 1 = 14 posts

Example 2: three runs, 50 ft + 30 ft + 50 ft, 8 ft spacing

  • 50 ft runs: 50 / 8 = 6.25, rounded up = 7 sections, 8 posts each
  • 30 ft run: 30 / 8 = 3.75, rounded up = 4 sections, 5 posts
  • Two shared corners: subtract 2, so 8 + 5 + 8 - 2 = 19 posts

DIY vs hiring a fence contractor

Do it yourselfHire a contractor
Time for 100 ftA weekend or more, plus diggingUsually a day or two for a crew
CostMaterials and tool rental onlyMaterials plus labor; as a rough planning rule, labor often costs about as much as the materials again
Tools neededPost hole digger or auger rental, level, string line, sawIncluded
RiskPosts out of line or too shallow are your problem to fixThe contractor warranties the work
Best forStraight runs on flat ground with easy diggingSlopes, rocky soil, long runs, gates and tight deadlines

Costs vary by region and contractor. Get at least two local quotes and compare them against the material list from this calculator.

Whether you build it yourself or hire it out, save the counts from this calculator to your project before you order, so the posts, rails, pickets and concrete stay together in one list. The fence post concrete calculator and the fence picket calculator finish the material list.

Waste allowance and spare materials

ItemSpare to orderWhy
Posts1 to 2 extraA post can split, warp or be cut wrong
Pickets or boards10% extraCuts, warped boards and defects
Pre-made panels1 spare panelA damaged panel stops the job
Rails1 to 2 extraCuts and splits at the ends
Concrete bags1 to 2 extra bagsA hole dug wider than planned eats concrete fast
Screws and brackets10% extraDropped and stripped fasteners

A spare post and a bundle of extra pickets cost far less than a second trip to the lumber yard mid-build.

After the fence is built, the ground along the line usually needs patching. Work out the lawn repair with the sod calculator and any soil you need to bring in with the topsoil calculator.

Privacy fences, vinyl fences and buying at Home Depot

A privacy fence calculator is this calculator with privacy-fence settings: solid boards or panels with no gaps, posts every 8 ft, and 3 rails per section on a 6 ft fence. Privacy is a style, not a different calculation, so the post, section and rail counts come out the same way as for any fence of the same length and spacing.

A vinyl fence calculator works the same way again: vinyl posts go in at the same spacing, and the panel width sets the section length. The difference is that vinyl is bought as pre-made panels, so once you have the section count, use the fence panel calculator for the panel count, and the fence cost calculator for installed pricing, about $28 to $44 per linear foot for vinyl.

Buying at Home Depot changes nothing about the math: the counts are brand-neutral, so buy the posts, rails, pickets or panels this calculator outputs at Home Depot or anywhere else. Pre-made wood and vinyl panels sold in stores are usually 6 or 8 ft wide, which matches the 6 or 8 ft post spacing this calculator uses.

Related fence tools

Assumptions

  • •Assumes one straight, continuous run with equal sections. Posts = sections + 1 for a straight run, and one fewer for a closed loop.
  • •Does not add posts for corners, ends or gates beyond the line count, and does not size or brace them.
  • •Rails per section depend on your fence style. The calculator does not choose pickets, panels, concrete or hardware.

Sources✓ Verified

  • Fence-contractor and manufacturer spacing practice. 8 ft is common for wood and vinyl privacy fences, and chain link often spans up to 10 ft. Confirm against your product's installation guide.
  • QUIKRETE fence post installation guidance. Set the post hole depth at about one-half of the above-ground post height, with the hole about three times the post width.
  • 811, Call Before You Dig. The national number to have underground utilities marked before any digging in the United States.
  • Your local building department and homeowner association. Fence height, setback, material and permit rules.

Formula reviewed November 2026.

Divide the fence length by the post spacing, round up for the number of sections, and add one. A 100 ft fence with posts every 8 ft has 13 sections and needs 14 posts.

With 8 ft spacing you need 14 posts, with 6 ft spacing 18 posts, and with 10 ft spacing 11 posts.

Usually 8 ft center to center for a wood or vinyl privacy fence, 6 ft for a heavier or taller fence, and up to 10 ft for chain link. Follow your fence maker's instructions.

At 8 ft spacing, 200 ÷ 8 = 25 sections, so 26 posts. At 6 ft spacing you need 35 posts.

No. A corner is already one of the posts in the count, but it should be a stronger post with extra bracing. Count each straight side separately and round up each side.

The same as the number of sections. A closed loop has no free ends, so the last section ends at the first post. A 140 ft perimeter at 8 ft spacing has 18 sections and 18 posts.

Multiply the sections by the rails per section. Many fences use 2 rails, and 6 ft privacy fences commonly use 3. A 100 ft fence with 13 sections needs 26 rails at 2 per section or 39 at 3.

A common rule is about half of the above-ground height, which is one third of the post. A 6 ft fence has about 3 ft of post in the ground. In cold climates, set posts below the frost line, and follow local practice.

The above-ground height plus the part in the ground. For a 6 ft fence with 2 to 3 ft in the ground, a post of 8 to 9 ft is typical.

Concrete gives the most holding power, especially for corners, gates and tall fences, and in loose or wet soil. Some builders use compacted gravel for line posts. See the fence post concrete calculator.

Often, yes, or at least you must follow local rules on height, materials and placement. Check with your local building department and any homeowner association before you build.

Confirm the property line and call 811 (in the United States) to have buried utilities marked. Mark each post location with stakes and string.

It varies widely by material, height, region and labor. Use the counts from this calculator to price posts, rails, pickets or panels, concrete and hardware, and compare local quotes.

Subtract the gate opening from the fence length, calculate the rest, then add two gate posts and the hinges and latch from the gate planner calculator.

It gives posts and sections for any straight run. For chain link, use the chain link fence calculator, which also gives mesh and top rail.

A square acre has a perimeter of about 835 ft. At 8 ft post spacing that is 105 sections and 105 posts in a closed loop, and 315 rails at 3 per section for a 6 ft privacy fence. Real lots are rarely square, so measure your actual boundary.

Use stepped panels, which stay level and step down the hill, or racked panels, which tilt to follow the ground on gentle slopes. Measure along the ground, not along a level line, and add about 10% waste on a gentle slope and 15% or more on a steep slope.

Vinyl costs more up front, but wood needs stain or sealer every 2 to 4 years plus occasional board replacement. Over 20 years the upkeep on a wood fence can close much of the gap, while vinyl and metal need little more than a wash. Compare both on the same length with local quotes.

100 ft is 1,200 in. With 5.5 in pickets and no gap, 1,200 / 5.5 = 218.2, so 219 pickets, or about 241 with 10% waste. If you allow a small gap, about 209 pickets cover 100 ft before waste. Use the fence picket calculator for your exact board width and gap.

Yes. A privacy fence is a style, not a different count: the posts, sections and rails are calculated the same way. Use 8 ft post spacing and 3 rails per section for a standard 6 ft privacy fence, and count the pickets or panels with the fence picket calculator or the fence panel calculator.

Yes. The counts are brand-neutral, so take the posts, rails and pickets this calculator gives you and buy them at Home Depot or any other supplier. If you are buying pre-made panels instead of loose pickets, use the fence panel calculator for the panel count.

Yes, for the posts and sections: vinyl privacy fences use the same 8 ft spacing and the same post count as wood. Vinyl panels are pre-made, so count the panels themselves with the fence panel calculator. For installed cost, vinyl runs about $28 to $44 per linear foot; price it with the fence cost calculator.

Converters to use with the Fence Calculator

Switch units, compare bulk and bagged quantities, or check coverage, without leaving BuildCova.

Browse all converters

More fence calculators

Fence Post Concrete CalculatorFenceFence Post Concrete CalculatorA fence post concrete calculator that works out how much concrete your posts need, in cubic feet, cubic yards and 60 lb bags, from the post count and the size of each hole. Too little concrete and posts lean within a season; too much and you pay for bags you never open. Enter your hole size and buy the count the job actually takes.Fence Panel CalculatorFenceFence Panel CalculatorA fence panel calculator that turns your total fence length and the width of one panel into the number of pre-made panels to buy, how much length they cover and how many posts you need. Panels come in fixed widths, so a rough count leaves a gap at the end of the run or a panel you cannot use. Enter the length and get a panel count that fits.Fence Picket CalculatorFenceFence Picket CalculatorA fence picket calculator that turns your fence length, the width of one picket and the gap between pickets into the number of pickets or fence boards you need. Count by the picket instead of the foot and the last board lands short, leaving a gap you cannot hide. Enter the real widths and get a count that closes the run.Fence Cost CalculatorFenceFence Cost CalculatorA fence cost calculator that shows the installed cost per linear foot and the total, split into materials and labour, with gates, old-fence removal and a permit as separate line items. Enter the fence length, height and material, then compare all five fence materials side by side. A fence priced on a guess can run short on posts and panels, so price the whole job first.Chain Link Fence CalculatorFenceChain Link Fence CalculatorA chain link fence calculator that turns your fence length and post spacing into the post count, the mesh length and the top rail length you need, then helps you plan the terminal posts, concrete, gates and ties. Mesh and rail run the full length, so a short measure leaves a gap in the run. Enter the length and spacing and get the full materials list.Fence Stain CalculatorFenceFence Stain CalculatorA fence stain calculator that turns your fence length, height and number of coats into the gallons of stain or sealer you need for one face of the fence, then helps you adjust for both sides and your product's coverage. Rough wood drinks stain, so a guess leaves the last section bare. Enter the fence size and coats and get the gallon count.

Material requirements can vary based on product specifications and job conditions. Verify quantities with your supplier before ordering.