Fence Calculator
Estimate the posts, rails or pre-made panels, pickets, gate posts, and concrete needed to build a fence — for privacy, picket, post-and-rail, or panel styles, in feet or meters.
Input
Feet in imperial, meters in metric — includes any gate openings.
Feet in imperial, meters in metric.
Center-to-center distance between line posts. Defaults to 8 ft / 2.4 m if left blank.
Horizontal rails between each pair of posts (e.g. top / mid / bottom).
Always in inches, regardless of the unit system above — boards are conventionally sized that way.
0 for a solid privacy fence; picket-style fences typically use a 1–2 in gap.
Feet in imperial, meters in metric. Defaults to 4 ft / 1.2 m if left blank. Ignored if gates is 0.
Output
| Metric | Value |
|---|---|
| No data yet | |
More ways to use this tool
REST API
curl -X POST https://api.iotools.cloud/v1/tool/fence-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"style": "privacy",
"unitSystem": "imperial",
"length": "100",
"height": "6",
"postSpacing": "8",
"railCount": "3",
"picketWidth": "5.5",
"picketGap": "0",
"numGates": "1",
"gateWidth": "4"
}'Swap in your own key from your account. The tool's fields are the body — no wrapper.
Ask an AI agent
Use the IOTools `fence-calculator` tool (Fence Calculator) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.
Embed widget
<iframe
src="https://iotools.cloud/embed/fence-calculator/"
width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
title="Fence Calculator — iotools.cloud"
sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
allow="clipboard-write"
style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>Drop this into your own page — free, no key required, just a link back.
| Cost per API/MCP call | From 5 credits |
|---|
Also available with
Guides
The Fence Calculator turns a total fence length, height, and post spacing into a shopping list: how many posts (line and gate), rails or pre-made panels, pickets, and bags of concrete to buy — for privacy, picket, post-and-rail, or panel fence styles.
How to use it
- Pick a fence style — privacy (solid boards), picket (spaced boards), post-and-rail, or panel (pre-made sections).
- Choose imperial (ft) or metric (m), then enter the total fence length and height.
- Set the post spacing (or panel width, for panel fences) if you don't want the default. Adjust rails per section, picket width/gap, and any gates as needed.
The materials table and a one-line summary update instantly.
The math
- Effective fence length = total length − (gate width × number of gates) — line posts only span the parts of the fence that aren't a gate opening
- Sections = ⌈effective length ÷ post spacing (or panel width)⌉, so line posts = sections + 1
- Gate posts = 2 per gate — each gate gets its own dedicated pair of posts, not shared with the line-post run
- Rails = sections × rails per section (privacy/picket/post-and-rail only — pre-made panels already include their own rails)
- Pickets = ⌈effective length ÷ (picket width + gap)⌉ (privacy/picket only)
- Post embedment depth = height ÷ 3 — bury about a third of the post, a widely cited framing rule of thumb
- Concrete per post = the volume of a cylindrical hole (diameter = 3× the post's width, another common rule of thumb) at that embedment depth, minus the post's own volume, converted to bags using an 80 lb bag's ~0.6 ft³ published yield (the same figure the Concrete Volume & Bags Calculator uses)
Posts are assumed to be a standard nominal 4×4 (actual 3.5 in / 8.9 cm) regardless of unit system — this is a shopping-list estimator for planning purposes, not a structural design tool, so treat the concrete and picket counts as a starting point and round up for waste.
For example, a 100 ft privacy fence, 6 ft tall, with one 4 ft gate and 8 ft post spacing needs about 15 posts (13 line + 2 gate), 36 rails (3 per section), 210 pickets, and 30 bags of concrete.
Why exclude the gate from post spacing?
A gate needs its own two posts sized to carry the gate's hardware and swing — they aren't part of the regular line-post run. Subtracting the gate width before dividing by post spacing keeps the line-post count accurate to how a real fence gets laid out.
Does it account for corners or multiple runs?
No — this models one continuous straight run (the total length you enter), the same simplification most quick fence estimators use. For an L-shaped or multi-run yard, calculate each straight run separately and add the results together (each shared corner post only needs to be counted once).
For paint/coverage or concrete slab math elsewhere in a build, see the Paint Coverage Calculator and Concrete Volume & Bags Calculator.
Everything runs in your browser; no inputs are sent to a server.