Fence Calculator

Turn fence length and post spacing into posts, rails, pickets and footing concrete.

Supports metric, imperial and mixed feet–inch units, with cuboid or round posts.

Updated October 29, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Loading calculator…

Introduction

This page turns a fence run into a shopping list. You give it the length of the fence line, the distance between posts and the size of the pickets; it returns how many posts and sections the run breaks into, how many rails and pickets to buy, how long each post has to be, and how much concrete the post footings take.

Every count comes back as a whole item, because a part post or a part picket is still something you have to buy and cut. That makes the totals directly usable at the timber yard. It also explains a habit worth knowing before you start typing: the post, section and picket totals are read-backs, not boxes you can overwrite. Rounding up throws away the exact length that produced the count, so the page will not rebuild your measurements from an integer.

Metric, imperial and mixed feet–inch entries all work, and the post cross-section can be sawn or round — each shape has its own footing formula. It suits a homeowner planning a garden or privacy run before ordering timber, and a contractor turning a client’s boundary line into the same list.

13 posts

A straight 30 m run at 2.5 m spacing

1.5 × height

Post length, with a third of it underground

0.08 m³ each

Concrete for a 10 × 10 cm post, 3 m long

Quick start

Six entries cover the whole page. It opens with the post space already at 2.5 m and 2 rails per section, so the run length is the first thing you actually measure.

1

Measure the fence line

Measure along the finished fence line from the first post to the last, and include the closing post in the figure. On a run with corners, measure each straight side rather than the diagonal shortcut across the plot. If you know the plot’s dimensions but not the boundary length, the rectangle fence perimeter calculator gives you the length to start from.

2

Set the space between posts

This is the distance from post to post, not the number of posts you would like. Most garden and privacy runs sit somewhere in the 6–8 ft (roughly 2–3 m) band; the page starts you at 2.5 m. This one box drives the post, section and rail totals at once, so it is the number to be sure about.

3

Read posts and sections

Two totals appear: the number of posts to buy and the number of sections between them. They are always one apart — a run of 13 posts has 12 sections.

4

Enter the fence height

Height is measured from the soil line to the top of the pickets. The post length then appears at 1.5 times the height, because a third of every post stays underground. If you already own posts of a fixed length, type that length instead and the height solves around it.

5

Describe the pickets

Picket width is the face width across one board; picket spacing is the gap beside it. A gap of zero is allowed and gives you the butted count for a solid screen.

6

Choose the post shape and its dimension

Cuboid asks for a width and a thickness, cylindrical asks for a diameter. With the post length already known, the concrete volume for all the footings appears. If you have a volume in hand — a delivered load, or a figure you already worked out — leave one post dimension empty, type the volume, and that empty box fills with the size the volume fits.

The 30 m run, worked end to end

A straight 30 m boundary, posts every 2.5 m, a 2 m high picket fence, 10 cm pickets with 5 cm gaps, and 10 × 10 cm sawn posts. The whole answer fits in six lines:

Posts to buyNpostsN_{\mathrm{posts}}=⌈302.5⌉+1= \left\lceil \tfrac{30}{2.5} \right\rceil + 1=13= 13
SectionsNsectionsN_{\mathrm{sections}}=⌈302.5⌉= \left\lceil \tfrac{30}{2.5} \right\rceil=12= 12
RailsNrailsN_{\mathrm{rails}}=2×12= 2 \times 12=24= 24
PicketsNpicketsN_{\mathrm{pickets}}=⌈300.10+0.05⌉= \left\lceil \tfrac{30}{0.10 + 0.05} \right\rceil=200= 200
Post lengthLpostL_{\mathrm{post}}=1.5×2= 1.5 \times 2=3 m= 3\ \mathrm{m}
ConcreteVV=83×0.10×0.10= \tfrac{8}{3} \times 0.10 \times 0.10×3×13\times 3 \times 13=1.04 m3= 1.04\ \mathrm{m^3}

Read it as an order: 13 posts, 24 rails, 200 pickets, and about 1.04 m³ of concrete for the footings. Nothing in that list needs rounding again.

Posts, sections, rails and pickets

Four counts come out of these boxes, and each one is a single division rounded up to a whole item. Posts, sections and rails turn on the fence length and the post spacing; the picket count adds the picket’s own step.

Posts and sections

The number of sections is the run divided by the post spacing, rounded up to a whole section. The number of posts is one more than that, because the closing post has no section after it.

Nsections=⌈Ls⌉N_{\mathrm{sections}} = \left\lceil \frac{L}{s} \right\rceilNposts=⌈Ls⌉+1N_{\mathrm{posts}} = \left\lceil \frac{L}{s} \right\rceil + 1

Rounding up is the whole point of the ceiling here: a run that does not divide evenly still needs a post at the far end. So 20 m at 2.4 m spacing gives 9 sections and 10 posts, with the final section about 0.8 m long rather than the full 2.4 m.

Rails

A rail spans one section, from post to post, so the rail total is the rails per section multiplied by the number of sections. Two rails per section is the usual picket fence layout and is already in the box.

Nrails=r×NsectionsN_{\mathrm{rails}} = r \times N_{\mathrm{sections}}

This is the one count pair that solves in both directions. If a quote or a stock list states a rail total, type it in and the rails per section box works back to r=Nrails/Nsections\ r = N_{\mathrm{rails}} / N_{\mathrm{sections}}. Rails per section has to land on a whole number, which is exactly the check that catches an order that does not fit the sections you measured.

Pickets

One picket plus one gap is the repeating step, so the picket count is the run divided by that step, rounded up.

Npickets=⌈Lwp+g⌉N_{\mathrm{pickets}} = \left\lceil \frac{L}{w_{\mathrm{p}} + g} \right\rceil

The ceiling matters more here than anywhere else on the page, because the last picket is the one that gets trimmed. In the 30 m example the 200 pickets take up 200×0.10+199×0.05=29.95 m\ 200 \times 0.10 + 199 \times 0.05 = 29.95\ \mathrm{m}, so the closing 5 cm is the one gap of slack — leave it at one end, or split it between the two ends to centre the run between its posts.

Which boxes you can type into

BoxWhat it does
Fence length, post spaceYour own measurements. Nothing on the page rewrites them, so they stay valid while the results move around them.
Picket width, picket spacingYour own measurements, and the two that move the picket count most.
Number of posts, sections, picketsRead-back totals, rounded up. Retyping them is not offered, because an integer cannot recover the length behind it.
Rails per section, number of railsBoth editable, and they solve each other.
Fence height, post lengthBoth editable. Enter a height and the post follows, or enter the post you own and the height follows.
Post dimensions, concrete volumeAll editable. Leave one dimension empty and type a volume; that empty box fills with the size the volume fits.

Post shape is the switch between the sawn and round footing formulas; it is not a measurement.

Post length and footing concrete

A post has to stand its full height above ground and keep a third of its length in the ground, which makes the post 1.5 times the fence height and puts the buried depth at half the height.

Lpost=1.5 HL_{\mathrm{post}} = 1.5\,Hdburied=Lpost3=0.5 Hd_{\mathrm{buried}} = \frac{L_{\mathrm{post}}}{3} = 0.5\,H

So a 2 m fence stands on 3 m posts with 1 m underground. The same rule sets the footing depth used by the concrete formula, which is why the concrete box only needs the post length as an input.

Hole minus buried post

The volume is the hole with the buried post subtracted from it, counted once per post. The model takes the hole as a footprint three times the post’s own size in each direction, and buries a third of the post:

VcuboidV_{\mathrm{cuboid}}=3w⋅3t⋅L3= 3w \cdot 3t \cdot \tfrac{L}{3}−w⋅t⋅L3- w \cdot t \cdot \tfrac{L}{3}=83 w t L= \tfrac{8}{3}\,w\,t\,L
Vcylindrical=23 π d2 LV_{\mathrm{cylindrical}} = \tfrac{2}{3}\,\pi\,d^{2}\,LVtotal=Vper post×NpostsV_{\mathrm{total}} = V_{\mathrm{per\ post}} \times N_{\mathrm{posts}}

For a round post the hole is a circle three diameters across, so a 10 cm post sits in a 30 cm round hole. The final multiplication by the post count is what turns a per-post volume into the total for the whole run.

Working backwards from a volume

Concrete is usually the last thing bought, after the posts are chosen, but a delivered load or a fixed budget can flip the question around. Rearranged, the same formulas give the post dimension that a volume implies:

w=3V8 t L Nw = \frac{3V}{8\,t\,L\,N}d=3V2π L Nd = \sqrt{\frac{3V}{2\pi\,L\,N}}L=3V8 w t NL = \frac{3V}{8\,w\,t\,N}

To run one of these, clear the box you want answered and then type the volume: the empty post dimension is the one that fills. Leave every dimension filled instead and the page has no empty box to answer with, so it has to give up one of the sizes you entered to honour the volume you just typed — which is rarely what you meant.

LLFence length, measured along the fence line
ssSpace between posts
rrRails per section
wpw_{\mathrm{p}}Picket width
ggGap between neighbouring pickets
NNNumber of posts, sections, rails or pickets, per the formula above
HHFence height above ground
w, tw,\ tWidth and thickness of a sawn post
ddDiameter of a round post
VVConcrete for all the post footings
Round post footingVV=23 π×0.102= \tfrac{2}{3}\,\pi \times 0.10^{2}×3×13\times 3 \times 13=0.26π≈0.82 m3= 0.26\pi \approx 0.82\ \mathrm{m^3}
Per post0.82/130.82 / 13≈0.063 m3\approx 0.063\ \mathrm{m^3}

The same 13 posts that take 1.04 m³ as 10 × 10 cm sawn posts take about 0.82 m³ as 10 cm round posts, because a circular post leaves less of the hole filled with timber. If you want that volume as bags, weight or a delivered price, the concrete calculator takes it from there.

If your ground needs a deeper footing

This page fixes the buried share of the post at a third. Some ground, and some local practice, calls for burying a post to a different ratio; the fence post depth calculator keeps the ratio as a box you can change, and reports the resulting buried depth and total post length. Use it when the depth is the open question, and come back here with the post length it gives you.

Worked examples

Two cases that need different parts of the page: an imperial run where the mixed feet–inch entry does the work, and a volume-first case where the answer runs backwards.

1

A 60 ft boundary in imperial sizes

Situation: A back boundary 60 ft long, posts every 8 ft, a 4 ft high picket fence with 5½ in pickets and 1½ in gaps, and 4 × 4 in posts.

What goes in

Fence length60 ft
Post space8 ft
Fence height4 ft
Picket width / gap5.5 in / 1.5 in
Post4 × 4 in, 6 ft long

What comes out

Posts⌈60/8⌉+1\left\lceil 60/8 \right\rceil + 1=9= 9
Sections60/860/8=8= 8
Rails2×82 \times 8=16= 16
Pickets⌈720/(5.5+1.5)⌉\left\lceil 720 / (5.5 + 1.5) \right\rceil=103= 103
Post length1.5×41.5 \times 4=6 ft= 6\ \mathrm{ft}
Concrete83×0.10162\tfrac{8}{3} \times 0.1016^{2}×1.8288×9\times 1.8288 \times 9≈0.45 m3\approx 0.45\ \mathrm{m^3}

The picket line works in inches because the step is a whole 7 in: 720 in of fence split at 7 in each comes to 102.9 steps, and the ceiling buys the 103rd picket. The concrete total lands on 16 cu ft — about 0.59 cu yd — for the nine footings.

2

What a delivered volume says about the post size

Situation: A load of 1.2 m³ of concrete arrives for the same 30 m run: 13 posts, 3 m long, sawn boards 10 cm thick. The width box is left empty on purpose, so it is the one the volume answers.

What goes in

Concrete volume1.2 m³
Fence length / post space30 m / 2.5 m
Post length3 m
Post thickness10 cm
Post widthleft empty

What comes out

Implied widthww=3×1.28×0.10×3×13= \frac{3 \times 1.2}{8 \times 0.10 \times 3 \times 13}≈0.115 m\approx 0.115\ \mathrm{m}
Roundedww≈11.5 cm\approx 11.5\ \mathrm{cm}

Read that as a margin rather than a size. The design needed 1.04 m³, so 1.2 m³ is about 15% more: enough for slightly chunkier 11.5 cm boards, or for a deeper or wider hole than the model assumes, or simply 0.16 m³ left over. Which of those it buys you is your call, but the volume you actually pour is not a detail — it is what the post size has to fit.

Tips for measuring and ordering

The formulas are simple; almost every disappointing fence order comes from the two measurements going in, not from the arithmetic.

  • Measure post to post along the finished line, not along the old fence, and keep the run as one figure only while it is actually straight. A single measurement that wanders with the ground gives you a spacing that is right at one end and wrong at the other.
  • On a run with a corner, treat each straight side as its own run and subtract the post the two sides share. A 12 m side and an 8 m side at 2 m spacing gives 7+5−1=11\ 7 + 5 - 1 = 11posts, which is one fewer than adding the 7 and the 5.
  • Expect the last section to be short whenever the run does not divide evenly. It still counts as a section, so it still gets its rails — you cut the final pair down to fit rather than pretend the section is missing.
  • A picket gap of zero is a real choice for a solid privacy screen, and it changes the count completely: the 30 m run above needs 300 butted 10 cm pickets instead of 200.
  • Watch for the two red flags rather than working around them. A post space past 5 m (about 16 ft) leaves a rail unsupported over a span no rail carries, and a post longer than 6 m (about 20 ft) is not standard fence stock — both messages mean re-check the box, and both keep the numbers on screen so you can see what the input produced.
  • Mixed entries are fine: 6 ft 6 in in one field, or 1 m 77 cm in another. Changing the unit shown on a box re-labels the same measurement and never moves a result.

Limitations

This is a material estimate for a straight run of fence on level ground. It answers “how much do I buy”, not “is this fence safe or legal here”.

What the model leaves out

Every count is a minimum, with no waste allowance for breakage, warped boards or mis-cuts, and nothing for fixings: nails, screws, brackets, post caps, postcrete bags, gravel or a base layer under the hole. Gates and openings are not modelled at all — the run is treated as continuous from the first post to the last.

The footing volume assumes a square or round hole three times the post’s own size and a post buried exactly a third of its length. A hole dug wider at the top, a belled base, a gravel drainage layer or a shallower-than-planned post all change the concrete you actually pour, and none of them are in the formula.

Level ground is assumed too. On a slope, the finished height changes from post to post and the rails and pickets have to follow the fall; run the calculation for the tallest and the shortest section to see the range you are buying for.

Fence height limits, boundary setbacks, permitted-development rules and the depth a post footing must reach in frost-prone ground are local questions, and this page does not know them. Check the current rules with your local building department or the relevant authority before you order, especially for a front boundary or a fence over 2 m. The two red warnings are sanity checks on your inputs, not building-code limits.

Frequently asked questions

Q

Why can't I type the number of posts?

Because the count is rounded up and a rounded count cannot give your measurement back. Ten posts could have come from an 18 m run at 2 m spacing or a 22 m one at 2.5 m, so letting you type a post count would force the page to invent a fence length you never measured. The post, section and picket totals are read-backs for that reason; the measured boxes are always yours.

Q

Is the concrete figure for one post or for all of them?

For all of them. The volume box holds the total, with the post count already multiplied in. For a per-post figure divide by the post count — the 30 m example’s 1.04 m³ over 13 posts is 0.08 m³ each, and the round-post version is about 0.063 m³ each.

Q

Why does a typed rail total sometimes come back red?

Because rails per section has to be a whole number, and the run you measured has a fixed number of sections. Twenty rails over 9 sections works out to 20/9=2.22\ 20/9 = 2.22rails per section, which is not a number of rails you can fit. Round the order to a whole multiple — 18 rails for two per section or 27 for three — or trim the rails on site and accept the spare.

Fence Calculator - Posts, Rails, Pickets and Concrete