We present a first-principles calculation study of matal and nonmetal codoped anatase TiO_{2}. We mainly investigate C/TM and N/TM (carbon and metal codoped, nitrogen and metal codoped) codoped TiO_{2}, are calculate their bound energies, energy band structures and densities of states. We find that the metal and the nonmetal impurities have an aggregate tendenty by calculating the bound energy of codoping structure. Positive bound energy show that the doping atom and the peripheral atom will combine into a bond, the boding-effect-produced system energy is higher than the geometric-distortion-effect produced stress energy. We analyze the energy band structure and boding of N/V and C/Cr --codoped TiO_{2}, and further find that if we want to extend TiO_{2} light absorb edge and improve TiO_{2} photocatalysis properties by metal and nonmetal codoped TiO_{2}, we should make codoping by the codoped joint method, namely, below the conduction band and on the top of valence band can arise impurity energy levels contributed by metal 3d and nonmetal 2p orbits respectively