X-ray absorption near edge structure (XANES) spectra of hard amorphous a-Si–C–N thin films with various compositions were measured at the C and N K-edge using sample drain current and fluorescent modes. The C K-edge XANES spectra of a-Si–C–N contain a relatively large 1s→π∗ peak, indicating that a substantial percentage of carbon atoms in the a-Si–C–N films have sp2 or graphite-like bonding. Both the observed sp2 intensity and the Young’s modulus decrease with an increase in the carbon content. For N K-edge XANES spectra of the a-Si–C–N films we find the emergence of a sharp peak near the threshold when the carbon content is larger than between 9% and 36%, which indicates that carbon and nitrogen atoms tend to form local graphitic carbon nitride.