We have deposited carbon nitride (CNx) films by magnetron sputtering at varying nitrogen pressures and substrate temperatures. The films were deposited on silicon and quartz substrates simultaneously. The incoming ion energy was controlled by a radio frequency power supply. A magnet in front of the substrate holder was used to enhance the plasma density. The films deposited at room temperature (RT) were found to have nitrogen content of ≥ 40%. These films were semiconducting with an optical bandgap of greater than 2 eV and a RT resistivity of 1012 Ω-cm. Films deposited at low nitrogen pressure (< 7 mtorr), at RT and in the presence of a 15 mtesla magnetic field were found to be hard and also exhibited extremely high elastic recovery. The most interesting result we found was that the hard and elastic CN films were also semiconducting with an optical band gap of 1.7 eV, RT resistivity of 107 Ω-cm and an activation energy of 0.8 eV. In all cases the CN films were almost entirely sp2 bonded.