Pressure-induced physical and chemical transformations of sodium cyanide (NaCN) have been studied up to 50 GPa in diamond-anvil cells, using micro-Raman spectroscopy and angle-resolved synchrotron x-ray diffraction. We observe three phase transitions in this pressure range: NaCN-IIA (orthorhombic, Immm), to NaCN-IIB (orthorhombic, Pmmn) at 4 GPa, to NaCN-III (monoclinic, Cm) at 8 GPa, and to NaCN-IV (tetragonal, P4mm) at 15 GPa, which is stable to 25 GPa. At higher pressures, NaCN-IV undergoes an irreversible chemical change, which occurs over a large pressure range between 25 and 34 GPa. The new material exhibits a broad yet strong Raman band at around 1550 cm(-1), indicating the formation of C=N bonds in a similar configuration of carbon graphite. The absence of sharp diffraction lines in this material suggests an amorphous nature of CN polymer products.