a b s t r a c tWe study the electronic and magnetic structure of carbon and nitrogen impurities and interstitials in rutile TiO 2 . To this end we perform ab initio calculations of a 48-atom supercell employing the VASP code. In order to obtain a realistic description of the electronic and magnetic structure, exchange and correlation are treated with the HSE06 hybrid functional. Both, atomic positions and cell dimensions are fully relaxed. Substitutional carbon and nitrogen are found to have a magnetic moment of 2 and 1l B , respectively, with a tendency for anti-ferromagnetic long range order. For C/N on interstitial sites we find that carbon is non-magnetic while nitrogen always possesses a magnetic moment of 1l B . We find that these interstitial positions are on a saddle point of the total energy. The stable configuration is reached when both carbon and nitrogen form a C-O and N-O dimer with a bond length close to the double bond for CO and NO. This result is in agreement with earlier experimental investigations detecting such N-O entities from XPS measurements. The frequencies of the symmetric stretching mode are calculated for these dimers, which could provide a means for experimental verification. For all configurations investigated both C and N states are found inside the TiO 2 gap. These new electronic states are discussed with respect to tuning doped TiO 2 for the application in photocatalysis.