Magnesium iodide

Magnesium iodide is an inorganic compound with the chemical formula MgI2. It forms various hydrates MgI2*xH2O. Magnesium iodide is a salt of magnesium and hydrogen iodide. These salts are typical ionic halides, being highly soluble in water.

Uses
Magnesium iodide has few commercial uses, but can be used to prepare compounds for organic synthesis.

Preparation
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

Reactions
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.

Another method to prepare MgI2 is mixing powdered elemental iodine and magnesium metal. In order to obtain anhydrous MgI2, the reaction should be conducted in a strictly anhydrous atmosphere; dry-diethyl ether can be used as a solvent.

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

Demethylation of certain aromatic methyl ethers can be afforded using magnesium iodide in diethyl ether.

Hydrates
Two hydrates are known, the octahydrate and the nonahydrate, both verified by X-ray crystallography These hydrates feature [Mg(H2O)6]2+ ions.