The magnetic properties and electronic structures of pure, doped and defective cerium oxide (CeO 2) have been studied theoretically by means of ab initio calculations based on the density function theory (DFT) with the hybrid HF/DFT technique named PBE0. Carbon (C), nitrogen (N), phosphorus (P), sulphur (S), lanthanum (La) and praseodymium (Pr) doped in CeO 2 and CeO 2 containing oxygen vacancies (O v) were considered. Our spin-polarized calculations show that C, N, Pr dopants and O v defects magnetize the non-magnetic CeO 2 in different degree. The optical band gap related to photocatalysis for pure CeO 2, corresponding to the ultraviolet region, is reduced obviously by C, N, S, Pr impurities and oxygen vacancies, shifting to the visible region and even further to the infrared range. Especially, N-, S- and Pr-doped CeO 2 could be used to photocatalytic water splitting for hydrogen production. As the concentration of O v increasing up to 5%, the CeO 2 exhibits a half-metallic properties.