Magnesium chloride is an inorganic compound with the formula MgCl2. It forms hydrates MgCl2·nH2O, where n can range from 1 to 12. These salts are colorless or white solids that are highly soluble in water. These compounds and their solutions, both of which occur in nature, have a variety of practical uses.