The main application of magnesium chloride is production of magnesium metal. This is done by the precipitation process for which the formula is given in the common reactions section. Magnesium chloride is also used for a variety of other applications like the manufacture of textiles, paper, fireproofing agents, cements and refrigeration brine, and dust and erosion control. Also, presence of magnesium chloride in water decreases its freezing point making magnesium chloride a perfect anti-icer.
Another use of magnesium chloride is in the food industry - it is used as a coagulant in the preparation of tofu from soy milk.
MgCl2(aq) + Ca(OH)2(aq) Mg(OH)2(s) + CaCl2(aq)