The electronic properties of amorphous carbon nitride were studied by x-ray-absorption near-edge structure (XANES) and valence-band photoelectron spectroscopy (PES). The nitrogen incorporation was found to induce graphitization, as evidenced by an increase of the sp(2) cluster in C and N K-edge XANES spectra. The structure is found to be similar to pyridine. Hybridized C-N bond lengths were determined from the position of the sigma(*) resonance of XANES spectra and the obtained results suggest sp(2) hybridization. A valence-band PES spectrum showed that the p-pi band became more intense than the p-sigma band upon higher at. % nitrogen addition, which confirmed the role played by the pi bonds in controlling the electronic structure of a-CNx films. (c) 2005 American Institute of Physics.