We present the GGA+U calculations to investigate the electronic structure and visible light absorption of the N, B-codoped anatase TiO2. The NsBi (substitutional N, interstitial B) codoped TiO2 produces significant Ti 3d and N 2p mid-gap states when the distance of N and B atoms is far, and the NiBi (interstitial N and B) and NsBs (substitutional N and B) codoped TiO2 prefer to form localized p states at 0.3-1.2 eV above the valence band maximum. Further, the optical band edges of the three codoped systems shift slightly to the visible region, but only the far distance NsBi codoped TiO2 shows an obvious visible optical transition. These results indicate that the NsBi codoped TiO2 has a dominant contribution to the visible absorption of the N, B-codoped TiO2.