KLM Labs

Fence calculator

Type each run of fence as your tape reads it (42' 6"), then the corners, the gates, the height, the post spacing and the picket. You get the posts (line, corner, end and gate), the sections, the rails and the 8, 10 or 12 foot boards to buy, the pickets and the bags of concrete for every post, each with its sum, and the spacing that divides each run into equal bays: 42' 6" at about 8 ft is 6 bays of 7' 1". The other fence calculators we read take decimal feet or one total length. This one takes runs, and prints the list. 100 feet of 6' privacy fence in three runs with a corner and a 4' gate is 15 posts, 39 rails and 220 pickets; it takes 39 bags of 80 lb concrete. This counts materials, not a price.

Your fence

Type each run of fence the way your tape reads it: 42' 6". One run is a stretch with no corner or gate in it. It starts with 100 feet of fence in three runs, one corner and a 4' gate: change them to yours. This counts the materials. It does not price a fence.

1 · The fence

3 runs, 100' 0" of fence in all

Where two runs meet at one post.

Widths, with commas. Empty = no gate.

Empty = worked out from the runs.

Rounded to equal bays that are never longer.

2 · Pickets

Empty = 2 under 5', 3 for 5' to 7', 4 at 8'.

Inches. 0 or empty = tight.

%

Empty = 10%.

3 · Posts, holes and rails

Inches. A 4x4 is 3-1/2.

Empty = 3 times the post.

Empty = 1/3 of the post length.

Inches. Checks the hole depth.

Rail boards you can buy

Your order list

Posts: 15 posts

40' 0" at "about 8 ft" is 5 bays of 8' 0"

Posts
15 (10 line + 1 corner + 2 end + 2 gate)
Sections
13 (5 + 4 + 4)
Rails
39 (3 × 13); buy 39 × 8'
Pickets
220 (200 + 10%)
Concrete
39 bags of 80 lb (2.58 per post)

Your fence stays in this browser until you clear it. Nothing you type is sent to us unless you ask for the email.

What to buy, with the sums

ItemHow manyThe sum
Line posts105 − 1 + 4 − 1 + 4 − 1
Corner posts1the corners you typed
End posts22 × 3 runs − 2 × 1 corner − 2 × 1 gate
Gate posts21 gate × 2
Posts in all1510 + 1 + 2 + 2
Sections135 + 4 + 4
Rails to cut393 per section × 13
Rail boards to buy39 × 8'39 rails cut from 8' boards, the fewest feet of the lengths you ticked
Pickets that fit20080 + 60 + 60
Pickets to buy220200 + 10% extra, rounded up
Post length9' 0"6' 0" fence + 36" in the ground
Concrete per post2.58 bags of 80 lb1.55 cu ft in a 10-1/2" hole 36" deep
Concrete in all39 bags of 80 lb15 posts × 2.58 = 38.72, rounded up

The actual spacing: equal bays, run by run

Hook the tape on the first end post of the run and mark each line post at the distance shown. The posts divide the run into equal bays, none longer than the spacing you picked. Marks are to the nearest 1/16".

RunLengthBaysBayLine posts at
Run 140' 0"58' 0"8' 0", 16' 0", 24' 0", 32' 0"
Run 230' 0"47' 6"7' 6", 15' 0", 22' 6"
Run 330' 0"47' 6"7' 6", 15' 0", 22' 6"

Rail boards: what each length costs you in feet

BoardTo buyFeetAgainst the best
8'39312fewest feet
10'39390+78 ft more
12'39468+156 ft more

Pickets, run by run

RunLengthWhole picketsLast picketTotal
Run 140' 0"80none80
Run 230' 0"60none60
Run 330' 0"60none60
Run 140' 0": 5 bays of 8' 0"Run 230' 0": 4 bays of 7' 6"Run 330' 0": 4 bays of 7' 6"Gate 1opening 4' 0", between two heavier posts; gate leaf shown dashed

Each run drawn to one scale: heavy bars are the end, corner and gate posts, thin bars the line posts, the horizontal lines the 3 rails. Gates are drawn on their own rows.

  1. Sections: 480" ÷ 96" = 5, rounded up to 5; 360" ÷ 96" = 3.75, rounded up to 4; 360" ÷ 96" = 3.75, rounded up to 4. Total 5 + 4 + 4 = 13
  2. Line posts: 5 − 1 + 4 − 1 + 4 − 1 = 10
  3. Posts: 10 line + 1 corner + 2 end + 2 gate (1 × 2) = 15
  4. Rails: 3 per section × 13 sections = 39 pieces (the usual 3 for a fence 6' 0" tall)
  5. Pickets: 80 + 60 + 60 = 200 fit; with 10% extra, buy 220
  6. Hole: π ÷ 4 × 10.5"² − 3.5"² = 74.34 sq in × 36" deep = 2,676.2 cu in ÷ 1,728 = 1.55 cu ft per post = 2.58 bags of 80 lb
  7. Concrete: 15 posts × 2.58 = 38.72, rounded up to 39 bags of 80 lb

Same exact math as Fraction Feet Inch Calculator

How many fence posts do I need?

Count the posts run by run, not from the total length. A run is a stretch of fence with no corner or gate in it (Hoover Fence Co.). For each run:

  1. Bays = run ÷ the spacing you pick (6 or 8 ft), rounded up.
  2. Bay = run ÷ bays. Every bay is the same size and none is longer than the spacing.
  3. Line posts = bays − 1: the posts between the run’s two end posts.

Then add the posts at the ends. A run has two ends, so a fence of 3 runs has 6 ends. A corner is one post for two ends (a corner post, not an end post): each corner takes two off the end posts. A gate has two posts, and each is the end of a run beside the opening: each gate takes two off as well. So end posts = 2 × runs − 2 × corners − 2 × gates, and posts = line + corner + end + gate.

Here is the fence the calculator starts with: 40', 30' and 30' of fence (100 feet), a corner between the first two runs, and a 4' gate between the last two.

Item How many The sum
Sections 13 5 + 4 + 4 (480" ÷ 96" = 5; 360" ÷ 96" = 3.75, rounded up to 4)
Line posts 10 (5 − 1) + (4 − 1) + (4 − 1)
Corner posts 1 the corner
End posts 2 2 × 3 runs − 2 × 1 corner − 2 × 1 gate
Gate posts 2 1 gate × 2
Posts 15 10 + 1 + 2 + 2

Check it against a single straight run: 100' at 8 ft is 12.5, rounded up to 13 bays, and 13 − 1 = 12 line posts + 2 end posts = 14 posts. FarmFoodFamily’s page gives 14 for 100 ft at 8 ft (its FAQ) and Calcilo’s worked example also gets 13 sections and 14 posts (Calcilo). The three agree on a straight run. They part on a fence with corners and gates. FarmFoodFamily’s formula is ceil(length ÷ spacing) + 1, plus the corners, plus 2 per gate: for the 100 feet above that is 14 + 1 + 2 = 17. On this layout the corner and the posts beside the gate stand where runs end, so adding them on top of the ends counts the same posts twice. We count each post once: 15. We could not run FarmFoodFamily’s calculator in a plain fetch, so this compares the formula it prints.

“Sections = posts − 1”, the rule in Google’s AI Overview, only holds for one straight run. With three runs, a corner and a gate the sections (13) are the sum of the bays, and 15 posts is 13 + 3 runs − 1 corner.

How far apart should fence posts be?

Most wood fence is built with posts 8 feet on center, because most dimensional lumber comes in 8 and 16 foot lengths, and more than 8 feet will likely sag the rails. At 6 feet you can use 12 foot rails (Hoover Fence Co.); Millard Lumber says about 6 to 8 feet (Building Wood Fences). Pick 6 or 8; the calculator turns it into equal bays.

Why equal bays? Step off 8 feet at a time along a 42' 6" run and you finish with five 8' bays and a 2' 6" bay stuck on the end. The calculator divides the run instead:

Run Bays Bay Line posts at, from the first end post
42' 6" 6 7' 1" 7' 1", 14' 2", 21' 3", 28' 4", 35' 5"
40' 5 8' 8', 16', 24', 32'
30' 4 7' 6" 7' 6", 15', 22' 6"

The 40' run gives the full 8'. The 30' run is 3.75 bays at 8 ft, so it becomes four bays of 7' 6": hook the tape on the first end post and mark each distance. Every mark comes from the exact run length and is rounded to 1/16" on its own, so rounding does not add up along the run.

How many rails does a fence need, and what boards do I buy?

The usual rule is by height, not material: 2 rails under 5 feet, 3 for 5 to 7 feet, 4 for 8 feet. Hoover Fence Co. gives it for wood fence and stops at 8 feet (Number of Rails). The calculator uses it when the box is empty, and takes your number if your plan differs. Rails = rails per section × sections: 3 × 13 = 39 for the 6' fence above.

A rail is as long as its bay, so the question is how many boards to buy. The calculator cuts every rail from the lengths you tick and counts the boards, first-fit, longest piece first, then picks the length that buys the fewest feet:

Board To buy Feet Against the best
8' 39 312 fewest feet
10' 39 390 +78 ft more
12' 39 468 +156 ft more

Bays of 8' and 7' 6" fit one rail to an 8' board, and a longer board only adds offcut. Change the spacing and the answer changes: 100' in one run at 6 ft is 17 bays of about 5' 10-9/16", and two rails cut from each 12' board buy 26 boards (312 ft), against 51 8' boards (408 ft). That is Hoover’s “6 foot spacing, 12 foot rails” worked out. Saw kerf is not counted. The bottom rail should be at least 2" off the ground (Millard Lumber).

How many pickets (fence boards) do I need?

A picket and one gap are one pitch. Per run: whole pickets = (run + gap) ÷ (picket + gap), rounded down. What is left over is the space after the last whole picket, one gap not counted. If it is more than a gap, a last picket ripped to fit goes in; if not, the gaps run a hair wide and no extra picket is needed.

Pickets are 5-1/2" wide here (a nominal 6; Hoover says typical pickets are 3-1/2", 5-1/2" or up to 11-1/2", and its red cedar is a full 6") with a 1/2" gap, so a pitch is 6":

Run Length Whole pickets Last picket Total
1 40' 80 none 80
2 30' 60 none 60
3 30' 60 none 60

That is 200 pickets, which is also 1,200" ÷ 6". Add a margin for splits and bad boards: the calculator starts at 10% (AI Overview 10% to 15%; FarmFoodFamily offers 5%, 10% and 15%; Calcilo 5% to 10% extra pickets): 200 + 10% = 220 to buy. A tight fence is a gap of 0: a 100' run of 5-1/2" pickets is 218 whole and a ripped 219th, the same 219 that Calcilo’s page gives for it. The gate is not in the count: you build or buy it as a unit.

How much concrete does each fence post take?

QUIKRETE’s directions for setting posts: the hole is 3 times the post across and 1/3 of the post’s overall length deep, on 6 inches of gravel; a post that supports a structure goes at least 6 inches below the frost line (Setting Posts). Millard Lumber also buries about 1/3 of each post, most of all at corners. Another QUIKRETE page (Setting Posts video notes) says the depth is 1/3 to 1/2 of the post height above ground, at least 2 feet for a 6-foot fence; the 3 feet below is the deep end of that range and the same as the post-length rule.

For a fence that stands 6' high, the post is the fence height plus the part in the ground, and the part in the ground is a third of the whole post, so it is half the fence height: 3' (36") in the ground and a 9' post. For a 4x4 (3-1/2" actual) the hole is 10-1/2" across. The concrete is the hole minus the post:

Step The sum Result
Hole minus post π ÷ 4 × 10.5" × 10.5" − 3.5" × 3.5" = 86.59 − 12.25 74.34 sq in
Per post 74.34 sq in × 36" deep = 2,676.2 cu in ÷ 1,728 1.55 cu ft
Bags per post 1.55 cu ft ÷ 0.60 cu ft per 80 lb bag 2.58 bags
All 15 posts 15 × 2.58 = 38.72, rounded up 39 bags of 80 lb

In 60 lb bags (0.45 cu ft) that is 3.44 per post and 52 in all; in 40 lb bags (0.30 cu ft), 5.16 and 78. The yields are those of QUIKRETE Concrete Mix No. 1101 that the concrete bag chart already uses; a fast-setting mix yields a different amount, so read your bag. The 6 inches of gravel are not in the count.

Frost. Dig below your local frost line and ask your building department what it is: it is local and this page does not guess. Type your frost depth in the box and the calculator warns you when the hole is not 6" below it. Penn State Extension says some soils heave with frost and loosen posts that are not set deep enough, and that the post that holds a gate needs to be set deeply and be larger than the line posts. Type a bigger hole and a deeper one for those posts if you want their concrete counted, or add their extra by hand.

Gates, corners and end posts

  • A gate opening has two posts. Type the width from post to post. Hoover Fence Co. says single swing gates are generally kept to 8 feet (5 feet to avoid problems) and double gates to 16 feet (10 feet to avoid problems), because wide wood gates sag and need bigger posts. The calculator says so when a gate is wider.
  • Hoover also says to avoid a gate post with no fence attached to it and the gate hinged to it, since it sags: set two end posts and a short section of fence so two posts carry the gate. Make the gate’s run a short one in the box and the posts are counted.
  • A corner is a post where two runs meet. A fence that turns at the house or at a neighbour’s wall still has end posts there; type the number if the auto count is not what you build.
  • The gate leaf, hinges and latch are not counted: the calculator gives the posts for the gate.

Panel fence or picket by picket?

This page counts rails and pickets for a fence built board by board. If you buy prefab panels, the sections number is how many panels the fence takes when the panel fits the bay: panels come in set widths, so compare the bay in the spacing table with the panel’s width before you order, and ignore the rail and picket counts.

What do permits and rules say?

Height limits, permits, setbacks, the property line and an HOA’s rules are local. This page gives no limit because there is no one number: ask your building department and your HOA before you order. Call 811 before you dig (Common Ground Alliance).

What do the other fence calculators leave out?

We read the results on 2026-11-19. FarmFoodFamily, first on Google, takes one total length in feet, the height, corners and gates, and gives posts, rails, pickets and concrete (it subtracts the post from the hole, as this page does); we could not run its calculator in a plain fetch, so we read its formulas. Calcilo is a price estimate that sends you to a separate material calculator with one length, one number for extra posts, and picket inches. Omni Calculator, cited by Google’s AI Overview, takes feet and inches in a unit menu and gives posts as length ÷ spacing + 1, with no corners or gates. Hoover Fence Co., also cited, is the one that takes each line of fence separately, with corners, end posts and gates, rails and pickets; its form asks for decimal feet, and we could not run it to read what it returns. America’s Fence Store’s Draw My Fence draws a fence over a map and adds the materials to a cart for a price. The contractor forms in the results ask for a quote.

None of those we could read divides each run into equal bays and shows the marks, counts a corner or gate post once, cuts the rails from 8, 10 and 12 foot boards, gives concrete per post by bag size, or hands you the list on one page. This page does.

What does the order list show?

One US Letter page: your runs, the posts by kind, the equal bays with the marks for the line posts, the rails and the boards to buy, the pickets, the concrete per post and in all, the sums, a drawing of the runs and the gates, and the notes on frost and local rules. Press Email me the order list (PDF) and it comes to your inbox, or Print the order list. Everything is on this page too, so the file is optional.

Do it on your phone with the calculator app

At the fence line you need two sums: the runs added, and a run divided into equal bays. Fraction Feet Inch Calculator does both in feet, inches and fractions, so you can check a bay with no signal. Type:

42' 6" ÷ 6

The answer is 7' 1", the bay. For the runs, add them: 40' + 30' + 30' is 100'. The app adds, subtracts, multiplies and divides feet, inches and fractions exactly, answers to the nearest 1/16", keeps the history of every answer, and works offline. The app has no fence tool: the page does the post, rail, picket and concrete counts, the app does the tape arithmetic.

People also ask

How to calculate how many fence boards you need?

Per run: whole pickets = (run + gap) ÷ (picket width + gap), rounded down, plus one ripped picket if more than a gap is left; add the runs; add 10% for splits. For 100 feet of 5-1/2" pickets with a 1/2" gap in runs of 40', 30' and 30', that is 80 + 60 + 60 = 200, and 220 to buy. The calculator above does it for your runs.

How many fence posts do I need for 100 feet?

One straight run of 100' at 8 ft apart takes 14 posts: 13 bays, 12 line posts and 2 end posts. Corners and gates change it: the 100 feet above, in three runs with a corner and a gate, takes 15.

How many rails does a 6 foot fence need?

Three per section, by the rule Hoover Fence Co. gives (3 rails for 5 to 7 feet). The 100 feet above has 13 sections, so 39 rails.

How much concrete does a fence post need?

For a 4x4 post in a 10-1/2" hole 36" deep, about 1.55 cu ft, or 2.58 bags of 80 lb. The hole is 3 times the post across and 1/3 of the post’s length deep (QUIKRETE), and deeper if your frost line is deeper.

Does the fence calculator give a price?

No. This page counts posts, rails, pickets and concrete. Take the order list to a lumber yard or a fence company and ask them to price it.

All 25 charts and guides

Summarize this page with ChatGPTSummarize this page with ClaudeSummarize this page with Perplexity

Last updated .

Get the PDF by email

We'll email you the file, so check the address.

We'll also send you new templates and charts now and then. Unsubscribe anytime.

How we use your email