Barium cyanide is a chemical compound with the formula Ba(CN)2. It is synthesized by the reaction of hydrogen cyanide and barium hydroxide in water or petroleum ether. It is a white crystalline salt.