Magnesium nitride, which possesses the chemical formula Mg3N2, is an inorganic compound of magnesium and nitrogen. At room temperature and pressure it is a greenish yellow powder. Magnesium nitride, which possesses the chemical formula Mg3N2, is an inorganic compound of magnesium and nitrogen. At room temperature and pressure it is a greenish yellow powder. Magnesium nitride reacts with water to produce magnesium hydroxide and ammonia gas, as do many metal nitrides. In fact, when magnesium is burned in air, some magnesium nitride is formed in addition to the principal product, magnesium oxide.