A trench is a type of excavation or depression in the ground that is generally deeper than it is wide (as opposed to a swale or a bar ditch), and narrow compared with its length (as opposed to a simple hole or pit).
In geology, trenches result from erosion by rivers or by geological movement of tectonic plates. In civil engineering, trenches are often created to install underground utilities such as gas, water, power and communication lines. In construction, trenches are dug for foundations of buildings, retaining walls and dams, and for cut-and-cover construction of tunnels. In archaeology, the "trench method" is used for searching and excavating ancient ruins or to dig into strata of sedimented material. In geotechnical engineering, trench investigations locate faults and investigate deep soil properties. In trench warfare, soldiers occupy trenches to protect them against weapons fire and artillery.