Hydrogenated and hydrogen free carbon nitride were grown by the ion beam assisted sputtering method using different precursors. Two sets of films were deposited by sputtering a graphite target and by assisting the growing film with nitrogen ions in a hydrogen free and a hydrogen atmosphere. The third set was grown by sputtering an azaadenine (C 4 N 6 H 4 ) target with argon or nitrogen ions. The bonding structure of the films was investigated by X-ray photoelectron spectroscopy (XPS), ultraviolet photoelectron spectroscopy (UPS) and infrared (IR) spectroscopy. Film properties were examined by UV–vis spectroscopy and plasmon energy (density) measurements. The experimental results indicate a pronounced change in structure for increasing nitrogen concentration up to 36 at%. Above 20 at% N, the intensity of the deconvoluted spectral features attributed to aromatic structures suffers a strong decrease. This effect is further enhanced by the presence of hydrogen in the films. The analysis of CN x :H films obtained from the azaadenine precursor indicates that these films consist predominantly of aliphatic CN structures and terminating >C N H, C N groups. These results are consistent with the increasing activity of the nitrogen lone-pair feature in the UPS spectra, the intensity decrease of the aromatic CN vibrations in the IR spectra, the recession of the valence band leading edge, the increase of the optical band gap and the reduction of the film density.