# Fence Calculator

> Estimate the posts and rails needed for a wood fence run.

Page: https://craftquantities.com/calculators/auto-utility/fence-calculator/ (calculator). This is the page's Markdown copy; the HTML page is the canonical version.

Version 1.1.0, sources checked 2026-10-31, 4 published test vectors.

Estimated fence needed: 14 posts for Fence Length 98 ft, the page's opening figures; on the metric page, 30 m gives 14 posts. Sources are cited below.

## Key facts

- A wood fence takes one post more than its sections: posts = fence length ÷ post spacing + 1, with 6 to 8 ft (1.8 to 2.4 m) the usual spacing for wood fencing. ([Fence post-count rule](https://craftquantities.com/methodology/spacing-pitch-and-count/): Post count = (fence length / post spacing) + 1; typical post spacing is 6-8 ft for wood fencing)
- Wood fence rails per bay: two for a fence under 5 ft (1.5 m), three for 5 to 7 ft (1.5 to 2.1 m), and four for an 8 ft (2.4 m) fence. (source: Fence rails by height: Recommended rails: 2 for fences under 5 ft, 3 for 5-7 ft, 4 for 8 ft fences)
- Concrete in a fence post hole is the hole's cylinder less the post: (π × diameter² ÷ 4 − post face²) × hole depth. (source: Post-hole concrete formula: Picket count = fenced length / (picket width + gap), the Fence Picket Calculator's rule; concrete per post hole = (π d² / 4 − post face²) × hole depth)
- An 80 lb bag of premix concrete yields about 0.6 cu ft (17 L), about 0.0075 cu ft of concrete per pound (0.47 L per kg) of dry mix. (source: Premix concrete yield (80 lb bag): Premix concrete yields about 0.0075 cubic feet per pound of dry mix (an 80 lb bag about 0.6 cubic feet), the Concrete Calculator's figure)

## Inputs

A length, area or volume is entered with its unit. The page opens on the values below: a metric reader sees the metric column, a US customary reader the other.

| Input | id | Opens at (metric) | Opens at (US customary) | Accepts |
|---|---|---|---|---|
| Fence Length | `fenceLength` | 30 m | 98 ft | mm, cm, m, in, ft, yd; range 0.01–500 m |
| Post Spacing | `postSpacingFt` | 2.4 m (~8 ft, standard) | 8 ft (standard) | `6`, `8` |
| Fence Height | `fenceHeightFt` | 1.5–2.1 m (~5–7 ft) | 5-7 ft | `4`, `6`, `8` |
| Corners (changes of direction) | `corners` | 0 | 0 | range 0–200 |
| Gates | `gateCount` | 0 | 0 | range 0–20 |
| Gate Width (each) | `gateOpening` | 1 m | 3.5 ft | mm, cm, m, in, ft, yd; range 0.3–6 m |
| Picket Width | `picketFace` | 13.97 cm | 5.5 in | mm, cm, m, in, ft, yd; range 0–0.3 m |
| Gap Between Pickets | `picketGap` | 0.635 cm | 0.25 in | mm, cm, m, in, ft, yd; range 0–0.15 m |
| Spare Rails and Pickets (%) | `spareRailsPickets` | 5 | 5 | range 0–30 |
| Post Hole Diameter | `postHoleBore` | 25.4 cm | 10 in | mm, cm, m, in, ft, yd; range 0–0.6 m |
| Post Hole Depth | `postHoleSet` | 60.96 cm | 24 in | mm, cm, m, in, ft, yd; range 0–2 m |
| Post Size (square) | `postSize` | 8.89 cm | 3.5 in | mm, cm, m, in, ft, yd; range 0–0.3 m |

- **Fence Length**: The total straight-line run of fence you're building.
- **Post Spacing**: Closer spacing is sturdier but needs more posts and concrete.
- **Fence Height**: Taller fences need more horizontal rails per section to resist wind and sagging.
- **Corners (changes of direction)**: How many times the fence line turns; each turn takes a post of its own.
- **Gates**: Each gate takes its width out of the fenced run and needs a post on each side.
- **Gate Width (each)**: The clear opening of one gate, between its two posts.
- **Picket Width**: The face width of one picket or board; 0 leaves the pickets out (ready-made panels).
- **Gap Between Pickets**: The space left between neighbouring pickets.
- **Spare Rails and Pickets (%)**: Extra rails and pickets for knotty rejects, splits and the narrow closer in each bay.
- **Post Hole Diameter**: The diameter of each post hole; 0 leaves the concrete out.
- **Post Hole Depth**: The depth of concrete in each hole.
- **Post Size (square)**: The actual face of a square post, taken out of the hole's volume.

## The answer on the opening values

Worked exactly as the page works it, on the values each system opens on.

### Metric

| Result | Value |
|---|---|
| **Estimated fence needed** | 14 posts |
| Fence length | 30 m |
| Sections | 13 sections |
| Line and end posts | 14 posts |
| Corner posts | 0 posts |
| Section width, as set out | 2.31 m |
| Rails needed | 39 rails |
| Rails to order, spare added | 41 rails |
| Pickets before the spare | 205.41 pickets |
| Pickets to order, spare added | 216 pickets |
| Concrete per post hole | 0.03 m³ |
| Concrete for all post holes | 0.36 m³ |
| Post bags, 80 lb (30 kg metric) | 26 bags |

### US customary

| Result | Value |
|---|---|
| **Estimated fence needed** | 14 posts |
| Fence length | 98 ft |
| Sections | 13 sections |
| Line and end posts | 14 posts |
| Corner posts | 0 posts |
| Section width, as set out | 7.54 ft |
| Rails needed | 39 rails |
| Rails to order, spare added | 41 rails |
| Pickets before the spare | 204.52 pickets |
| Pickets to order, spare added | 215 pickets |
| Concrete per post hole | 0.92 ft³ |
| Concrete for all post holes | 12.89 ft³ |
| Post bags, 80 lb (30 kg metric) | 22 bags |

## Formula with your numbers

1. **Divide the run into bays**: 98 ft − 0 gates × 3.5 ft, ÷ 8 ft (standard), rounded up = 13 sections
2. **Add the closing, corner and gate posts**: 13 sections + 1 + 0 corners + 0 gates = 14 posts
3. **Multiply the bays by the rails**: 13 sections × the rails a 5-7 ft fence takes = 39 rails, + 5% spare = 41 rails

Worked on the figures the page opens on; the page re-works each step on the reader's own.

## How to calculate fence in 3 steps

1. **Divide the run into bays**: Take each gate's width off the fence length, divide what is left by the post spacing and round up to whole sections.
2. **Add the closing, corner and gate posts**: A straight run has one post more than it has sections; add one post for every corner and one for every gate, since the fence stops at one gate post and starts again at the other.
3. **Multiply the bays by the rails**: Multiply the sections by two, three or four rails for the fence's height, then add the spare percentage for rejects and offcuts and round up.

## Posts for common fence lengths

Page defaults, not your figures above.

| Fence length | Estimated fence needed |
|---|---|
| 50 ft (15.24 m) | 8 posts |
| 100 ft (30.48 m) | 14 posts |
| 150 ft (45.72 m) | 20 posts |
| 200 ft (60.96 m) | 26 posts |
| 300 ft (91.44 m) | 39 posts |
| 15 m (49.21 ft) | 8 posts |
| 30 m (98.43 ft) | 14 posts |
| 50 m (164.04 ft) | 22 posts |
| 100 m (328.08 ft) | 43 posts |

## How it is worked out

The working the page shows, in order: Fence length; Sections; Line and end posts; Corner posts; Section width, as set out; Rails needed; Rails to order, spare added; Pickets before the spare; Pickets to order, spare added; Concrete per post hole; Concrete for all post holes; Post bags, 80 lb (30 kg metric); then estimated fence needed.

The method, derived in full:

- [Spacing, Pitch and the Count That Follows](https://craftquantities.com/methodology/spacing-pitch-and-count/): Why a run divided by a spacing gives the number of gaps and not the number of things, why the division rounds up rather than to nearest, and what the leftover bay at the end does to both.
- [Perimeter Runs, Stock Lengths and Mitres](https://craftquantities.com/methodology/perimeter-runs-and-mitres/): Why a room's area tells you nothing about how much skirting it needs, why adding a door can increase the trim order, and why a crown moulding mitre is neither forty-five degrees nor half the corner angle.

What this calculation does not cover:

- A part-bay at the end is rounded up to a whole section, so the count assumes every bay runs the full 6 or 8 ft you picked; the run is never redistributed into equal bays, and the last one comes out short unless you reset the spacing on site.
- Rails are counted as one continuous piece per bay per course, so nothing is added for stock lengths that fall short of a post or for splices; the spare percentage covers rejects and off-cuts on the rails and pickets to order, never the posts.
- The rail count steps in three fixed jumps, two then three then four, so a 5 ft fence and a 7 ft fence sharing a band come back with the same three rails, and no part of the arithmetic responds to wind exposure or panel weight even though the height and spacing hints both raise them.
- Height feeds the rail count and nothing else: it never sizes the posts, so the extra length buried below grade is not counted, and the hole diameter and depth behind the concrete figure are yours. The concrete is the hole's cylinder less the post's square, with nothing added for a belled or ragged hole or for gravel at the bottom.
- Pickets are counted over the fenced length as one run at the width and gap entered, as the Fence Picket Calculator does, so the narrow closer in each bay comes out of the spare percentage; prefabricated panels (enter 0 for the picket width), fasteners, post caps and end treatment against rot are counted nowhere.
- Each gate takes its width out of the run and adds one post, so two of the posts are the gate's own; the gate leaf, its hinges and latch, and any heavier gate post size are left to you.
- Both spacing choices are stored as the imperial 6 ft and 8 ft, so the metric labels of 1.8 m and 2.4 m are rounded restatements of those figures, and a bay of any other size — a 2.0 m panel, say — cannot be entered at all.

## Sources

As the calculator cites them (sources checked 2026-10-31):

- Post count = (fence length / post spacing) + 1; typical post spacing is 6-8 ft for wood fencing
- Recommended rails: 2 for fences under 5 ft, 3 for 5-7 ft, 4 for 8 ft fences
- Picket count = fenced length / (picket width + gap), the Fence Picket Calculator's rule; concrete per post hole = (π d² / 4 − post face²) × hole depth
- Premix concrete yields about 0.0075 cubic feet per pound of dry mix (an 80 lb bag about 0.6 cubic feet), the Concrete Calculator's figure

A code or standard has force only where a jurisdiction has adopted it, usually with local amendments; check what is in force with the authority where you build.

## Questions answered on the page

**Do I need a post at every corner?**

Yes. Enter the number of corners and the page adds one post for each, on top of the line posts and the two end posts of the run.

**How deep should fence posts be set?**

A common rule of thumb is at least 1/3 of the post's above-ground height, set in concrete — check local frost-line depth requirements too, which can require deeper footings in cold climates.

**Does this include gates?**

The gate posts, yes. Enter the number of gates and their width: the width comes out of the fenced run and each gate adds one post, since the fence stops at one gate post and starts again at the other. The gate leaf, hinges and latch are not counted, and gate posts are usually a size heavier than line posts.

**What does the 'Section width, as set out' figure mean?**

It is the fence length divided by the number of sections counted. The post and rail counts are the same either way; this row shows the width each bay comes to if you share the run evenly between those posts on site, instead of leaving the short last bay the count assumes, and it is never wider than the spacing picked. Evenly shared bays suit a fence built in place from rails and boards; ready-made panels come in one width and cannot be shared out, so with panels the last bay takes a panel cut down to fit instead.

**Do I need the rail count if I am putting up ready-made panels?**

No. A prefabricated panel — the usual garden fence panel in the UK, or a pre-built privacy section in North America — has its rails built in, so only the post count applies, along with the clips or brackets the panels hang by, or the slotted concrete posts used for panel fencing in the UK. The rail figure is for a fence built in place: horizontal 2×4 rails fixed to the posts in North America, or the triangular arris rails morticed into the posts of a UK closeboard fence.

**Which spacing should I pick for UK panels 6 ft wide?**

The 1.8 m (6 ft) option, knowing the page takes it as the distance between post centres. A panel 1.83 m (6 ft) wide between posts 100 mm (4 in) square puts the centres about 1.93 m (6 ft 4 in) apart, so on a long run this page can count a post or more beyond what the panels need. Set the posts out from the panels actually bought and treat this count as the upper figure.

**How do I measure a fence on sloping ground?**

By how the bays will meet the slope. A stepped fence keeps each bay level and drops at the posts, so its bays are set out on the level: measure the horizontal length, and expect the post on the low side of every step to stand taller, which this count does not size. A fence that follows the ground, with its rails parallel to the slope (racked, in North American usage), is measured along the slope, since each rail runs that sloping length. A square-made panel can only be stepped; a fence built in place can go either way.

## Related calculators

- [Concrete Calculator](https://craftquantities.com/calculators/materials-quantities/concrete-calculator/)
- [Fence Panel and Post Calculator (Lap, Closeboard and Privacy Panels)](https://craftquantities.com/calculators/landscaping-outdoor/fence-panel-calculator/)
- [Fence Picket Calculator](https://craftquantities.com/calculators/renovation-construction/fence-picket-calculator/)

## Run it from a program

- REST: `GET https://api.craftquantities.com/v1/calculate/fence-calculator` with each input as a query parameter, a length, area or volume with its unit; `https://api.craftquantities.com/v1/describe/fence-calculator` lists the inputs.
- MCP: the `calculate` tool at https://api.craftquantities.com/mcp with `slug` `fence-calculator`.
- Definition and test vectors: https://craftquantities.com/api/v1/calculators/fence-calculator.json

---
Source: https://craftquantities.com/calculators/auto-utility/fence-calculator/
Craft Quantities: free to read, cite and link to; the pages are not licensed for republication. Quantities only: no prices, no design and no certification.
