Hydrochloric acid results from the dissolution of hydrogen chloride into water at percentages up to around 40 percent HCl. Although hydrochloric acid reacts with many compounds, its elemental reactions are most noted with regards to metals — by itself, hydrogen chloride reacts with many metals, particularly those closer to the left of the periodic table.
Alkaline metals, the first group in the periodic table, like lithium, sodium and potassium, will react with even cold water — breaking the H2O molecules apart to create a metallic oxide and elemental hydrogen gas. Hydrochloric acid, however, will also react with these metals — for instance, two molecules of hydrochloric acid and two atoms of metallic sodium will react to produce two molecules of sodium chloride (table salt) and one molecule of hydrogen gas.
Alkaline Earth Metals
The alkaline earth metals, the second group in the periodic table, have varying degrees of activity, but will all generally react with water or steam. These metals — like beryllium, magnesium, calcium and strontium — will react with hydrochloric acid to form a chloride and free hydrogen. Metallic magnesium when combined with hydrochloric acid, will naturally result in magnesium chloride -- used as a dietary supplement -- with the hydrogen being released as a gas.
Iron, cadmium, cobalt, nickel, tin and lead are not reactive with water, but can be dissolved with hydrochloric acid, displacing the hydrogen from the HCl. Iron reacts with hydrogen chloride to produce iron chloride, FeCl2 — sometimes known as ferrous chloride. Like another iron chloride compound, FeCl3, ferrous chloride is used in waste water treatment, helping to remove suspended particles in the water. Chlorides of cadmium, cobalt, nickel, and tin are used in electroplating — a process that deposits a very thin layer of the metal onto another surface.
Metals in higher groups than lead are generally not dissolvable by hydrochloric acid alone, but hydrochloric acid can be combined with nitric acid to produce "aqua regia," or royal water, an extremely corrosive solution so called because it's capable of dissolving even "royal" metals like platinum and gold. This process is used, for example, in refining extremely high purity gold — like that found in bullion coins -- gold or silver coins that are kept safe as an investment, rather than being used as ordinary currency. Aqua regia can also be used to clean laboratory equipment, since it will remove nearly any contaminant.