Single crystals of magnesium diiodide have been grown and the structure solved for the first time from single-crystal X-ray diffraction data. This study confirms that MgI(2) is isostructural with CdI(2) (C6 or 2H structure type). The space group is P-3m1 with the Mg atom on a site with 3m symmetry (Wyckoff site 1a) and the I atom on a site with m symmetry (Wyckoff site 2d). Trends in the 2H structures of dihalides are discussed briefly.