Doping is an efficient approach to narrow the band gap of TiO2 and enhance its photocatalytic activity. Here, we perform generalized gradient approximation (GGA)+U calculations to narrow the band gap of TiO2 by codoping of X (F, N) with transition metals (TM = Fe, Co) to extend the absorption edge to longer visible-light wavelengths. Our results show that all the codoped systems can narrow the band gap significantly, in particular, (F+Fe)-codoped system could serve as remarkably better photocatalysts with both narrowing of the band gap and relatively smaller formation energies than those of (F+Co) and (N+TM)-codoped systems. Our results provide useful guidance for codoped TiO2 efficient for photocatalytic activity. © 2013 Wiley Periodicals, Inc.