How much soil does a trench hold?
Enter the trench and the side slope, get cubic yards dug and truck loads to haul.
Slopes are OSHA's maximums for excavations under 20 ft deep (Table B-1). A competent person classifies the soil; the calculator cannot.
Swell percentages are FHWA's planning figures and can be off by a third. The truck size is an example: use your hauler's.
What the volume of a trench means
The volume of a trench is the amount of soil that comes out of the ground, measured as it lay before the digging. If the sides are cut at a slope, the trench is a long prism whose end view is a trapezoid: as wide at the bottom as you set it, and wider at the top by the slope on each side. OSHA states a slope as horizontal distance for each unit of vertical rise (H:V), so 1:1 means the wall moves one foot outward for every foot of depth. Because the top keeps widening as the trench gets deeper, depth has a bigger effect on volume than most people expect. In the example below a 6-foot trench with 1:1 sides takes 5 times as much soil as a 6-foot slot with vertical walls and the same 18-inch bottom.
The formula
With depth d, bottom width b, length L and a slope of z feet of run per foot of depth on both sides, the cross-section is d × (b + z × d) square feet, the width at the top is b + 2 × z × d, and the volume is the cross-section times L. Divide cubic feet by 27 for cubic yards. A pipe with outside diameter D occupies π ÷ 4 × D² × L, so the soil needed to refill the trench is the trench volume minus the pipe. Loose soil takes more room than soil in the ground: the loose volume is the bank volume × (1 + swell ÷ 100), and the number of truck loads is the loose volume divided by the truck capacity, rounded up. The calculator takes the swell and the truck size from you, because both depend on the soil and on the truck.
Worked example
Take a trench 50 feet long, 18 inches wide at the bottom and 6 feet deep, with 1:1 sides (Type B soil). The cross-section is 6 × (1.5 + 1 × 6) = 45 square feet, the top is 1.5 + 2 × 6 = 13.5 feet wide, and the volume is 45 × 50 = 2,250 cubic feet, or 83.33 cubic yards. A 4-inch pipe laid the full length takes 4.4 cubic feet, leaving 83.17 cubic yards to put back. With the 43% swell that FHWA prints for damp earth or loam, the 83.33 cubic yards become 119.2 cubic yards loose, which is 12 loads of a 10-yard truck. For comparison, damp clay swells 67% (139.2 yd³ loose) and dry sand 11% (92.5 yd³).
Sloped sides by soil type
OSHA's Table B-1 gives the steepest slope allowed for excavations less than 20 feet deep. The same 50-foot trench, 18 inches at the bottom and 6 feet deep, digs out like this:
| Soil (Table B-1) | Slope H:V | Top width | Volume |
|---|---|---|---|
| Stable rock | vertical (90°) | 1.5 ft | 16.7 yd³ |
| Type A soil | ¾ : 1 (53°) | 10.5 ft | 66.7 yd³ |
| Type B soil | 1 : 1 (45°) | 13.5 ft | 83.3 yd³ |
| Type C soil | 1½ : 1 (34°) | 19.5 ft | 116.7 yd³ |
Type A soil open 24 hours or less and 12 feet deep or less may use ½:1, which gives 50 cubic yards. Moving from Type B to Type C adds 33.3 cubic yards to this trench, 40% more.
What OSHA says about depth and cave-ins
The rules quoted here are OSHA's construction standards for employers and employees; they are the clearest published statement of the hazard, and local and state rules may add to them. Under 29 CFR 1926.652(a)(1), every employee in an excavation must be protected from cave-ins by an adequate protective system, unless the excavation is made entirely in stable rock, or is less than 5 feet deep and a competent person's examination of the ground finds no indication of a potential cave-in. Sloping and benching is one of the allowed systems (1926.652(b)); shields and shoring are others. A trench 4 feet deep or more needs a stairway, ladder, ramp or other safe way out within 25 feet of lateral travel for anyone in it (1926.651(c)(2)). Excavated soil and equipment must stay at least 2 feet from the edge, or be held back by retaining devices (1926.651(j)(2)). A competent person, defined in 1926.650 as someone able to identify existing and predictable hazards who has authority to correct them, must inspect the excavation daily before work starts, as needed during the shift, and after every rainstorm (1926.651(k)(1)).
Common mistakes and limits of this method
First, the slope on the Table B-1 chart is a maximum for the soil class, and the class is decided by a competent person through at least one visual and one manual test (Appendix A); the calculator cannot tell you what soil you have. If the soil shows signs of distress, such as fissures, slumping or ravelling, the slope has to be cut back to at least ½ horizontal to 1 vertical less steep (Appendix B (c)(3)(ii)), and a surcharge from spoil piles, equipment or traffic calls for a flatter slope still, which the competent person must determine. Second, Table B-1 stops at 20 feet: deeper sloping is designed by a registered professional engineer. Third, the volume here is for sides cut at one slope from the bottom to the top. Benched, stepped or shielded trenches have other shapes, and the vertical-sided lower portions allowed in Figure B-1 are not modeled. Fourth, the swell numbers are planning figures: the FHWA table carries a footnote that its factors are subject to about plus or minus 33 percent, so a hauler's own loose-yard measurement beats it. Last, do not use swell for the refill: compaction depends on how the soil is placed, and the calculator makes no estimate of it.
How do I calculate the volume of a trench?
Multiply the cross-section by the length. For a trench with vertical sides the cross-section is the width times the depth. For sloped sides it is the depth times the bottom width plus the slope times the depth, because each wall moves out by the slope for every unit of depth. The 50-foot trench in the example holds 2,250 cubic feet, or 83.33 cubic yards, which is 63.7 cubic meters.
How steep can the sides of a trench be?
OSHA's Table B-1 (29 CFR 1926 Subpart P, Appendix B) allows vertical sides only in stable rock. For excavations less than 20 feet deep the steepest slopes are ¾:1 (53 degrees) in Type A soil, 1:1 (45 degrees) in Type B and 1½:1 (34 degrees) in Type C. A Type A trench that stays open 24 hours or less and is 12 feet deep or less may be cut at ½:1 (63 degrees); deeper short-term trenches use ¾:1. If you do not classify the soil, 1926.652(b)(1) allows slopes no steeper than 1½:1.
At what depth do I need shoring or a trench box?
OSHA 1926.652(a)(1) requires a protective system for each employee in an excavation, with two exceptions: the excavation is entirely in stable rock, or it is less than 5 feet deep and a competent person's examination of the ground shows no indication of a potential cave-in. Sloping to the Appendix B angle satisfies the requirement in place of shoring or a shield. Deeper than 20 feet the sloping design must come from a registered professional engineer.
How much does soil swell when you dig it?
It depends on the soil. The Federal Highway Administration's Federal Lands Highway design manual lists these swell percentages for common materials, measured against the soil's density in the ground: clay, dry 50%, earth or loam, damp 43%, silt 36%, sand, dry 11%, gravel, dry, average gradation 20%. The same table says the factors are subject to about ±33% variation, so treat them as estimates and enter your hauler's figure if you have one.
How many truck loads of dirt is a trench?
Convert the bank volume to loose volume with the swell, then divide by the truck's capacity and round up. The example trench of 83.3 cubic yards at 43% swell is 119.2 cubic yards loose, so 12 loads of 10 cubic yards. Truck capacity is heaped or struck depending on the hauler, so enter the figure the hauler quotes.
Do I need to call before digging a trench?
OSHA 1926.651(b) requires the estimated location of utilities, such as sewer, telephone, fuel, electric and water lines, to be determined before an excavation is opened, and the utility companies or owners to be contacted, within established or customary local response times, and asked to locate their underground installations. The FCC designated 811 in 2005 (order FCC 05-59) as the national dialing code that state one-call notification systems use for advance notice of excavation work, so dialing 811 is the way to reach the one-call center in your state.
What is the difference between the bank, loose and compacted volume?
Bank volume is the soil in the ground, which is what this calculator reports first. Loose volume is the same soil after digging, when air between the particles increases the space it needs; that is the volume a truck carries. Compacted volume is the soil after it has been put back and packed, and for common soil it is usually smaller than the bank volume. FHWA's earthwork page gives the example that 1 cubic yard of earth in the cut may use 1.25 cubic yards in the transporting vehicle and end up occupying 0.65 to 0.85 cubic yards in the embankment, depending on its density and the compaction.
Sources: OSHA, 29 CFR 1926 Subpart P, sections 1926.650, 1926.651 and 1926.652 (eCFR, edition of October 1, 2026), Appendix A (soil classification) and Appendix B, Table B-1 and Figure B-1 (osha.gov), read October 27, 2026; Federal Highway Administration, Federal Lands Highway, Project Development and Design Manual, “Earthwork Design”, Exhibit 5.1A (page updated January 15, 2026); Federal Communications Commission, Sixth Report and Order, FCC 05-59 (March 2005). The sloping chart applies to the trench as one slope from bottom to top; for gravel and pipe in a drain trench use the French drain calculator, for fill dirt the topsoil calculator, to convert volumes the cubic yard calculator, for bedding stone the gravel calculator, and for footings the sonotube calculator. How we check our calculators.