In this study, we have performed first-principles screened exchanged hybrid density function theory with the HSE06 function calculations of the C-Mo, C-W, N-Nb and N-Ta codoped anatase TiO2 systems to investigate the effect of codoping on the electronic structure of TiO2. The calculated results demonstrate that (W(s)+C(s)) codoped TiO2 narrows the band gap significantly, and have little influence on the position of conduction band edges, therefore, enhances the efficiency of the photocatalytic hydrogen generation from water and the photodegradation of organic pollutants. Moreover, the proper oxygen pressure and temperature are two key factors during synthesis which should be carefully under control so that the desired (W(s)+C(s)) codoped TiO2 can be obtained.