Trench Calculator

Enter the length, width and depth of your trench to get the cubic yards to dig, the gravel and backfill you need around a pipe, the spoil left over and a cost range. It also flags the OSHA rules that apply at your depth, and shows the math.

ft

Average depth from the ground to the trench bottom.

Sloping is one way to protect a trench 5 ft or deeper.

Pipe, gravel and your price
in

Optional. Assumes the pipe rests on the trench bottom.

in

Optional. For drains or pipe bedding.

$/ft

Optional. Replaces the $5 to $12 per ft range.

Dirt to dig

7.41yd³

Cubic feet200.0 ft³
Loose spoil8.89 to 9.63 yd³ (+20 to 30%)
GravelNone
Soil to backfill7.41 yd³
Extra spoil to haulNone, all of it goes back in
Trenching cost$500 to $1,200 at $5 to $12 per ft

Under 4 ft deep. Still keep spoil back from the edge, and call 811 before digging.

Cross-section 1 ft wide × 2 ft deep = 2.000 sq ft. × 100 ft long = 200.0 ft³ ÷ 27 = 7.41 yd³.

Estimate based on your inputs and the assumptions on this page. Disclaimer

Dirt to dig7.41 yd³Details

How to calculate trench volume

For a trench with straight sides, cubic yards = length (ft) × width (ft) × depth (ft) ÷ 27. Convert inches to feet first by dividing by 12.

  1. Measure the length along the route in feet.
  2. Convert the width and depth to feet: 12 in = 1 ft, 18 in = 1.5 ft, 24 in = 2 ft.
  3. Multiply width × depth for the cross-section, then × length for cubic feet.
  4. Divide by 27 for cubic yards.
  5. If the sides are sloped, use the average width instead: bottom width + slope × depth.

Example: a 100 ft trench 12 in wide and 24 in deep is 100 × 1 × 2 = 200 cubic feet, or 7.41 cubic yards. Dug out, common earth swells 20 to 30 percent, so expect about 8.9 to 9.6 cubic yards of loose spoil beside the trench.

Width12 in18 in24 in36 in48 in
4 in1.231.852.473.704.94
6 in1.852.783.705.567.41
12 in3.705.567.4111.1114.81
18 in5.568.3311.1116.6722.22
24 in7.4111.1114.8122.2229.63
Cubic yards per 100 ft of trench with vertical sides. Columns are depth.

How much gravel do I need for a trench?

Multiply length × width × gravel depth for the layer, then subtract the space the pipe takes up. The calculator does both, with the exact area of the pipe that sits inside the gravel. Dry gravel weighs about 105 lb per cubic foot (Engineering ToolBox), so divide cubic feet × 105 by 2,000 for tons.

Example, a drain trench: 100 ft long, 12 in wide and 24 in deep, with a 4 in pipe in a 12 in gravel layer. The gravel layer is 100 cubic feet; the pipe takes 8.7 of them. That leaves 91.3 cubic feet, or 3.38 cubic yards and about 4.79 tons of gravel. The soil on top needs 3.70 cubic yards of backfill, and the other 3.70 yards of dug soil is extra, about 4.4 to 4.8 loose yards to spread or haul. For gravel by the ton for driveways and paths, see the Gravel Calculator.

Sloped trench sides

OSHA requires a protective system in any trench 5 ft or deeper unless it is entirely in stable rock. The options are shoring, a trench shield (trench box) or sloping the sides back. The allowed slope depends on the soil, and in a narrow trench it multiplies the dirt you move.

Diagram: a trench 2 ft wide and 6 ft deep holds 44.4 cubic yards per 100 ft with vertical sides, 144.4 with OSHA Type A 3/4:1 slopes, 177.8 with Type B 1:1 slopes and 244.4 with Type C 1 1/2:1 slopes
Per 100 ft, the same 2 ft by 6 ft trench is 3.3 to 5.5 times the dig when sloped.
OSHA soil typeMax slope (H:V)Top width, 2 ft wide × 6 ft deep
Type A: clay, hardpan (not fissured or disturbed)3/4:1 (53°)11 ft
Type B: silt, sandy loam, angular gravel1:1 (45°)14 ft
Type C: sand, gravel, submerged or seeping soil1 1/2:1 (34°)20 ft
OSHA 29 CFR 1926 Subpart P, Appendices A and B, for trenches under 20 ft deep.

In a wide excavation, slopes add a third or more; in a 2 ft trench they can add four times the dirt. That is why most deep utility trenches use a trench shield instead. For large holes such as basements, see the Excavation Cost Calculator.

What is the 5-4-3-2-1 trench rule?

It is a training memory aid, not an official OSHA name, but each number comes straight from OSHA’s excavation rules:

  • 5 ft: trenches this deep need a protective system (shoring, a shield or sloping) unless they are entirely in stable rock. 29 CFR 1926.652(a)(1).
  • 4 ft: trenches this deep need a ladder, stairway, ramp or other safe exit within 25 ft of lateral travel for every worker. 1926.651(c)(2).
  • 3 ft: a portable ladder’s side rails must extend at least 3 ft above the landing. 1926.1053(b)(1).
  • 2 ft: spoil, materials and equipment stay at least 2 ft from the edge. 1926.651(j)(2).
  • 1: a competent person inspects the trench daily, before work starts and as needed during the shift. 1926.651(k)(1).
Diagram of the 5-4-3-2-1 trench rule: protective system at 5 ft deep, ladder or other exit at 4 ft within 25 ft of travel, ladder rails 3 ft above the edge, spoil kept 2 ft from the edge, and one competent person inspecting daily, with OSHA 1926 citations

How much does trenching cost?

HomeGuide’s 2026 guide puts trenching at $5 to $12 per linear foot: $2 to $3 for the trencher or machine and $3 to $9 for labor. Trenching labor runs $35 to $65 per hour. Depth, soil, rock and obstacles like driveways push the price up.

Trench lengthCost at $5 to $12 per ft
25 ft$125 to $300
50 ft$250 to $600
100 ft$500 to $1,200
200 ft$1,000 to $2,400
300 ft$1,500 to $3,600
Trenching only. Source: HomeGuide, updated February 2026.

When the trench is part of a bigger job, HomeGuide quotes the whole installation per foot instead:

Project, installedPer linear footTypical total
Drainage system$10 to $30$1,000 to $4,000
Gas line$12 to $25$350 to $1,000+
Water line$30 to $50$800 to $3,000
Sewer line$40 to $180$1,600 to $7,200
Complete project including trenching. Source: HomeGuide.

How deep are trenches?

HomeGuide says residential trenches are usually 12 to 24 in deep, and most are under 5 ft. The required depth for a pipe or cable is set by your local code and utility, and water lines have to sit below the local frost line, so check with your building department before you dig. Call 811 a few days ahead so buried lines can be marked; it is free.

Frequently asked questions

How do I calculate trench size?

Multiply length × width × depth in feet and divide by 27 for cubic yards. A 100 ft trench 12 in wide and 24 in deep is 200 cubic feet, or 7.41 cubic yards.

What is the 5-4-3-2-1 trench rule?

A training memory aid based on OSHA rules: a protective system at 5 ft deep, a safe exit at 4 ft within 25 ft of travel, ladder rails 3 ft above the edge, spoil 2 ft back from the edge, and one competent person inspecting the trench daily.

How much does it cost to trench 300 feet?

About $1,500 to $3,600 at HomeGuide’s $5 to $12 per linear foot for trenching alone. Installing a pipe or line adds material and labor on top.

How much gravel do I need for a trench?

Multiply length × width × gravel depth in feet, subtract the pipe, and divide by 27 for cubic yards. A 100 ft trench 12 in wide with a 12 in layer around a 4 in pipe needs 3.38 cubic yards, about 4.79 tons of dry gravel.

How deep can a trench be without shoring?

Under OSHA, a trench less than 5 ft deep does not need a protective system unless a competent person sees signs of a possible cave-in. At 5 ft or deeper it needs shoring, a shield or sloped sides unless it is entirely in stable rock.

How much spoil will a trench make?

The dug volume plus swell: about 20 to 30 percent more for common earth, 20 to 40 percent for clay and 40 to 80 percent for rock (Engineering ToolBox). A 7.41 cubic yard trench in common earth makes about 8.9 to 9.6 loose cubic yards.

Sources

Scroll to Top