Magnesium iodide

Magnesium iodide is the name for the chemical compounds with the formulas MgI2 and its various hydrates MgI2(H2O)x. These salts are typical ionic halides, being highly soluble in water. Magnesium iodide has few commercial uses but can be used to prepare compounds for organic synthesis.

Reactions
Magnesium iodide can be prepared from magnesium oxide, magnesium hydroxide, and magnesium carbonate by treatment with hydroiodic acid :
 * MgO + 2 HI →  MgI2 + H2O
 * Mg(OH)2 + 2 HI →  MgI2 + 2 H2O
 * MgCO3 + 2 HI →  MgI2 + CO2 + H2O

Magnesium iodide is stable at high heat under a hydrogen atmosphere, but decomposes in air at normal temperatures, turning brown from the release of elemental iodine. When heated in air, it decomposes completely to magnesium oxide .

Usage of magnesium iodide in the Baylis-Hillman reaction tends to give (Z)-vinyl compounds .