Mercury(II) iodide, also known as mercuric iodide, is a chemical compound. Its chemical formula is HgI2. It has mercury and iodide ions in it. The mercury is in its +2 oxidation state.
It is a red crystalline compound. It turns yellow when heated and turns red again when it is cooled. It is insoluble in water. It is highly toxic like all mercury compounds.
Mercury(II) iodide is made by reacting a mercury(II) salt such as mercury(II) chloride with a source of iodide ions. This makes a bright red precipitate.
It is found as the very rare mineral coccinite.
It was used as a medicine, but it poisoned people who took the medicine. It is also used to demonstrate how some things change color when heated and change back when cooled. It can be used to test for ammonia and as a semiconductor.