CNx films were deposited on YG8 carbide alloy (WC+8%Co) substrates by DC or RF magnetron sputtering. The composition, bonding state, adhesion, and tribological behavior of CNx films were researched. X-ray Photoelectron spectroscopy results showed that C-N, C=N and C≡N bond existed in CNx films. RF magnetron sputtering is in favor of the bonding of C and N, the adhesion and the wear resistance of CNx films. DC magnetron sputtering is in favor of lubricating ability of CNx films. Substrate bias has some effect on the bonding of C and N, the adhesion of the films, decrease of adhesive wear and the friction coefficient of films.