Abstract In this article, the supercells of pure anatase titanium dioxide, nitrogen and/or chromium doping anatase titanium dioxide were computed using first-principles with the plane-wave ultrasoft pesudopotentials method. The crystal structure, electronic structure, and optical properties of above different ions doping models were investigated by using the calculated results. The results indicated that the band gap of nitrogen and chromium codoped system is decreased effectively, and the separation of electron-hole pairs becomes more favorable due to impurity energy levels formation in the band gap of anatase titanium dioxide, which could play an important role in enhancing the catalytic activity and visible light absorption of anatase titanium dioxide. The energy levels splitting and the overlapping between impurity energy levels and valence band maximum or conduction band minimum are all more obvious than that of single ion doping, which is quite helpful for the decrease of charge carriers recombination rate and energy gap, leading to the great photocatalytic activity improvement of titanium dioxide. Moreover, the optical absorption curves of nitrogen and chromium codoped anatase titanium dioxide indicates the highest photoresponse for visible-light, which are consistent with the previous experimental results. The above results would be quite helpful for guiding research and further developing of titanium dioxide photocatalyst.