In this work, the CASTEP program in Materials Studio 2017 software package was applied to calculate the electronic structures and optical properties of pure anatase TiO2, S-doped, Mn-doped and Mn-S co-doped anatase TiO2 by GGA + U methods based on the density function theory (DFT). The results indicate that the lattice is distorted and the lattice constant is reduce due to doping. The doping also introduces impurity energy levels into the forbidden band. After substitution of Mn for Ti atom, band gap narrowing of anatase TiO2 is caused by the impurity energy levels appearance in the near Fermi surface, which are contributed by Mn-3d orbital, Ti-3d orbital and O-2p orbital hybridization. After substitution of S for O atom, band gap narrowing is creited with the shallow accepter level under the conduction hand of S-3p orbital. The Mn-S co-doped anatase TiO2 could be a potential candidate for a photocatalyst because of tis enhanced absorption ability of visible light. The results can well explain the immanent cause of a band gap narrowing as well as a red shift in the spectrum for doped anatase TiO2.