# Trench Calculator (Excavation and Backfill)

> This trench calculator works out how much soil you dig out, how much gravel bedding goes in, and how much backfill comes back, for a pipe, drain or cable trench.

**Quick answer:** A 50 ft trench 18 in wide and 3 ft deep removes 8.33 cubic yards of soil, which swells to about 10.4 yd³ loose. Subtract 4 inches of gravel bedding (0.93 yd³) and a 4-inch pipe, and you need about 7.2 yd³ of backfill.

_Last updated: October 3, 2026. Estimates only; confirm quantities with your supplier._

## How much soil does a trench hold?

A trench is a long, narrow box: its volume is length times width times depth. From there you take away what goes back in as bedding or pipe, and what is left is backfill.

```
trench volume = length × width × depth (feet)
bedding = length × width × bedding depth
backfill = trench volume − bedding − pipe volume
pipe volume = π × (diameter ÷ 2)² × length
```

Example: 50 ft × 1.5 ft × 3 ft = 225 cu ft = **8.33 yd³**. Dug soil swells about 25%, so haul **10.42 yd³**. Bedding of 4 in is 25 cu ft (**0.93 yd³**, about 1.3 tons of gravel). A 4 in pipe takes 4.4 cu ft. Backfill is 225 − 25 − 4.4 = 195.6 cu ft, or **7.25 yd³**.

### Trench size to soil removed (50 ft long)

| Width × depth | In-place yd³ | Loose yd³ (25% swell) |
| --- | --- | --- |
| 12 in × 2 ft | 3.70 | 4.63 |
| 18 in × 3 ft | 8.33 | 10.42 |
| 24 in × 4 ft | 14.81 | 18.52 |
| 36 in × 5 ft | 27.78 | 34.72 |

### Before you dig

- Call 811 to have buried utilities marked.
- Trenches 5 ft deep or more generally need protective systems under OSHA rules; follow them and local code, and never work in an unprotected deep trench.
- Backfill in layers and compact; the [fill dirt calculator](../fill-dirt-calculator/) gives you quantities if you need to import soil.
- For larger digs use the [excavation calculator](../excavation-calculator/); for bedding stone see the [gravel calculator](../gravel-calculator/).

## Frequently asked questions

### How do I calculate the volume of a trench?

Multiply length by width by depth in feet to get cubic feet, then divide by 27 for cubic yards.

### How much does soil swell when dug?

Loose soil takes more space than in the ground, often 20 to 30% more depending on the soil. The default here is 25%.

### How much gravel do I need for pipe bedding?

Bedding volume is length × trench width × bedding depth, then convert to yards or tons. This calculator includes the tons at 1.4 per yd³.

### Do I need extra backfill for compaction?

Often a little, because compacted soil takes less room. Add a margin or measure after compacting a first layer.

### Are deep trenches regulated?

Yes. OSHA has trench safety requirements, and local rules may add more. Treat deep trenches as a job for trained crews.

## Sources and further reading

- [Trenching and excavation safety](https://www.osha.gov/trenching-excavation) — Occupational Safety and Health Administration
- [NIST Special Publication 811: conversion factors](https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors) — National Institute of Standards and Technology
