Fence Calculator for Irregular Yards

This free fence calculator works out everything you need to fence a yard of any shape: angled lots, L-shaped gardens, pie-shaped corner lots, or runs that stop at the house. Enter the length of each side, add your gates, and choose your post spacing. You’ll get the total fence length, posts, panels or sections, rails, pickets, and post concrete, plus an optional cost estimate, with every step of the math shown.

Enter the length of each side of your fence, in order. If the fence stops at the house or another wall, leave that side out. Tick "Fence goes all the way around" only if it closes back on itself. Not sure how it works? Use the Try an example button.

1. Fence sides

2. Fence details

3. Pickets (optional)

4. Prices (optional)

Fence length (gates removed)
Total boundary length
Panels / sections
Posts (incl. corner, end & gate posts)
Gates
Rails
Pickets
Concrete bags for posts
Estimated cost
Estimates assume each gate sits next to a corner or post. A gate in the middle of a side may need one extra panel.
Show step-by-step working

Why Irregular Yards Need a Different Fence Calculator

Most fence calculators assume a rectangle: give them a length and a width and they double it. Real yards rarely work that way. A lot can be pie-shaped, a side can angle in toward the street, and one side is often the house itself, which needs no fence at all.

Irregular yards also have more corners, and every corner needs a post. If you divide the total length by the post spacing and ignore the corners, you’ll come up short on posts and panels. This calculator works side by side, so every corner and every gate is counted.

How to Use the Fence Calculator

1. Enter the fence sides

  1. Measure each straight run of fence from corner to corner, and enter them in order as Side 1, Side 2, Side 3…
  2. Leave out any side that doesn’t need fencing, such as the wall of the house or an existing fence you’re keeping.
  3. Tick “Fence goes all the way around” only if the fence closes back on itself with no wall in the loop.
  4. Use “+ Add side” for more sides, or × to remove one.

2. Fill in the fence details

  • Post spacing / panel width: the distance from one post to the next. Most wood panels are 8 ft (2.4 m); vinyl panels are often 6 or 8 ft.
  • Gates: how many gates and how wide each one is. Gate openings are removed from the fence length.
  • Rails per section: horizontal rails between posts. Fences up to about 4 ft usually use 2 rails; 6 ft privacy fences usually use 3. Choose “None” for ready-made panels or chain link.
  • Concrete bags per post: many DIY guides use about 2 bags of fast-setting concrete per post. Leave blank to skip.

3. Pickets and prices (optional)

  • Picket width and gap: a common wood picket is 3.5 in wide. For a privacy fence with no gaps, enter a gap of 0.
  • Prices: enter the price per panel, per post, and per gate to see a total cost.

Press Calculate fence to see the totals, then open “Show step-by-step working” to follow every calculation.

The Formulas Behind the Calculator

Step 1: Fence length

Add up all the sides, then take out the gate openings:

Fence length = Σ Sides − ( Gates × Gate width )

Fence length = Sum of all sides − (Number of gates × Gate width)

Step 2: Panels or sections

Each side is divided by the post spacing and rounded up, so a short leftover piece still gets its own panel and every corner lands on a post. Each gate then takes the place of one section:

Panels = max ( Σ SideSpacing − Gates , Fence lengthSpacing )
⌈ ⌉ = round up

Panels = the larger of ( Sum of ⌈Side ÷ Spacing⌉ − Gates ) and ⌈Fence length ÷ Spacing⌉

The second part makes sure that wide gates never leave you with too few panels. (⌈ ⌉ means round up.)

Step 3: Posts

A straight run of fence always needs one more post than it has sections. Each gate breaks the fence into a separate run, and each run needs its own end post:

Posts = Panels + Runs
Open fence: Runs = Gates + 1  Â·  Closed loop: Runs = Gates

Posts = Panels + Number of separate runs

  • Open fence (ends at the house or a wall): runs = gates + 1
  • Closed loop with gates: runs = number of gates
  • Closed loop with no gate: runs = 0, so posts = panels

This count already includes corner posts, end posts, and gate posts.

Step 4: Rails and pickets

Rails = Panels × Rails per section Pickets = Fence length (in) Picket width + Gap (round up)

Rails = Panels × Rails per section

Pickets = ⌈Fence length in inches ÷ (Picket width + Gap)⌉

Worked Example 1: A Backyard That Ends at the House

A backyard is fenced on three sides, 60 ft, 40 ft, and 60 ft, and the house forms the fourth side. There’s one 4-ft gate, posts every 8 ft, 2 rails per section, and 3.5-in pickets with 0.5-in gaps.

  • Total boundary = 60 + 40 + 60 = 160 ft
  • Fence length = 160 − (1 × 4) = 156 ft
  • Sections per side: 60 ÷ 8 = 7.5 → 8, 40 ÷ 8 = 5, 60 ÷ 8 → 8. Total = 21
  • Panels = larger of (21 − 1 = 20) and (156 ÷ 8 = 19.5 → 20) = 20 panels
  • Runs = 1 gate + 1 (open fence) = 2, so posts = 20 + 2 = 22 posts
  • Rails = 20 × 2 = 40 rails (8 ft each)
  • Pickets = 156 × 12 = 1,872 in ÷ (3.5 + 0.5) = 468 pickets
  • Post concrete = 22 × 2 = 44 bags

These are the numbers behind the “Try an example” button.

Worked Example 2: A Metric Garden With a Full Loop

A garden is fenced all the way around: sides of 12 m, 9 m, 12 m, and 9 m, with one 1-m gate. Posts are every 2.4 m, with 3 rails per section.

  • Total boundary = 12 + 9 + 12 + 9 = 42 m
  • Fence length = 42 − 1 = 41 m
  • Sections per side: 12 ÷ 2.4 = 5, 9 ÷ 2.4 = 3.75 → 4, 5, 4. Total = 18
  • Panels = larger of (18 − 1 = 17) and (41 ÷ 2.4 = 17.08 → 18) = 18 panels
  • Closed loop with 1 gate = 1 run, so posts = 18 + 1 = 19 posts
  • Rails = 18 × 3 = 54 rails (2.4 m each)
  • Post concrete = 19 × 2 = 38 bags

Notice the second rule did the work here: subtracting one section for the gate gave 17, but 41 m of fence still needs 18 panels.

Worked Example 3: Estimating the Cost

Using the backyard from Example 1, say panels cost $65, posts $18, and the gate $120. (These are example prices. Check your local supplier.)

  • Panels: 20 × $65 = $1,300
  • Posts: 22 × $18 = $396
  • Gate: 1 × $120 = $120
  • Total = $1,816, before concrete, screws, hinges, latches, and any labor

Common Post Spacing by Fence Type

Fence typeTypical post spacingTypical rails
Wood privacy (6 ft)6–8 ft (1.8–2.4 m)3
Wood picket (3–4 ft)8 ft (2.4 m)2
Vinyl panels6 or 8 ft, set by the panel widthBuilt into panel
Chain linkUp to 10 ft (3 m)Top rail only
Split rail8–10 ft, set by the rail length2–3

These are general figures. Use the spacing your fence product or local code calls for, especially in windy areas, where closer posts are stronger.

Tips for Measuring an Irregular Yard

  • Measure each straight run separately, from corner post to corner post. Don’t measure diagonally across the yard.
  • Follow the property line, not the lawn edge. Many places require fences to sit a little inside the line. Check with your local office or HOA, and call your local utility-locating service before you dig.
  • Curved boundaries: break a curve into several short straight sides. Each one adds a post, which is how curved fences are actually built.
  • Slopes: measure the horizontal distance, not along the ground. A stepped fence on a slope may need extra posts at each step.
  • Got the map area? Our Map Area Calculator shows the perimeter of any lot, which is a good starting point for total fence length.

Common Mistakes to Avoid

  • Dividing the total length by the spacing: this skips corner posts and leaves you short. Work side by side, as this calculator does.
  • Forgetting the end post: a straight run of 5 sections needs 6 posts, not 5.
  • Counting the gate as fence: the gate opening needs gate hardware, not a panel.
  • Not rounding up: 7.5 panels means you need 8, and you cut the last one to fit.
  • Fencing the house wall: leave out any side that’s already a wall or an existing fence.

Related Calculators

Frequently Asked Questions

Measure each straight side, add them up, and subtract the gate openings. Then divide each side by your post spacing and round up to get sections, and add one post for each separate run of fence. This calculator does every step for you.

For a fence that ends at the house, you need one more post than sections, plus one more for each gate. For a fence that goes all the way around with no gate, posts equal sections.

With 8-ft panels, 100 ÷ 8 = 12.5, so you need 13 panels for one straight 100-ft run, and 14 posts. Corners and gates can change this, so enter each side separately.

With 3.5-in pickets and 0.5-in gaps, each picket takes 4 inches, so there are 3 pickets per foot.

No. The calculator removes the gate openings from the fence length and adds the gates as separate items, including their posts.

Yes. Switch the unit to meters. Spacing and gate width switch to meters, and picket sizes switch to centimeters.

Similar Posts

  • Composite Figures Area Calculator (Add & Subtract Shapes)

    Composite Figures Area Calculator (Add & Subtract Shapes) This composite figures area calculator finds the total area of a shape built from simpler pieces: an L-shaped room, a house front with a gable roof, a running track, or a wall with a door and window cut out. Add each piece that’s part of the figure,…

  • Area Unit Converter

    This free area unit converter changes any area into every common unit at once: square feet, square yards, acres, square miles, square meters, hectares, square kilometers, and more, including marla and kanal for property in South Asia. Type a number, choose its unit, and see all the conversions instantly, along with the exact conversion factor…

  • Irregular Hexagon Area Calculator (6-Sided Shapes)

    Irregular Hexagon Area Calculator (6-Sided Shapes) This irregular hexagon area calculator finds the exact area and perimeter of any 6-sided shape, even when every side and angle is different. Hexagons are more common than you’d think: an L-shaped room, a garden bed with angled corners, a gazebo or deck, or a six-cornered lot. Enter the…

  • Irregular Quadrilateral Area Calculator (4-Sided Shapes)

    This irregular quadrilateral area calculator finds the exact area of any 4-sided shape, even when no sides are equal, nothing is parallel, and there isn’t a single right angle. Enter the four corner coordinates, the four sides plus one diagonal or one angle, or two diagonals and the angle between them. You’ll get the area,…

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *