The first step in metal production always involves some form of mining. Mining refers to the process of removing the metal in its free or combined state from the Earth's surface. The two most common forms of mining are surface and subsurface mining. In the former case, the metal or its ore can be removed from the upper few meters of the Earth's surface. Much of the world's copper, for example, is obtained from huge open-pit mines may range in depth to as much as nearly a 0.6 mi (1 km) and in width to as much as more than 2.25 mi (3.5 km). Subsurface mining is used to collect metallic ores that are at greater depths below the Earth's surface.
A few metals can be obtained from seawater rather than or in addition to being taken from the Earth's crust. Magnesium is one example. Every cubic mile of seawater contains about six million tons of magnesium, primarily in the form of magnesium chloride. The magnesium is first precipitated out of seawater as magnesium hydroxide using lime (calcium hydroxide). The magnesium hydroxide is then converted back to magnesium chloride, now a pure compound rather than the complex mixture that comes from the sea. Finally, magnesium metal is obtained from the magnesium chloride by passing an electric current through a water solution of the compound.