The crystal structure, impurity formation energy, electronic structure and optical properties of anatase TiO2 doped with sulfur in different valence states were studied by using the plane-wave ultrasoft pseudopotential method based on first_principles. The calculations shown that the existence form of sulfur element in anatase TiO2 was related to the experimental conditions; the octahedral dipole moments were increased due to the changes of lattice parameters, bond length and charges on atoms; the band gap narrowed and the curves of light absorption red-shifted to visible-light region due to the position of conduction band downward shifting, the position of valence band upper shifting and the width of valence band broadening result from hybridizing S 3p states with O 2p states and Ti 3d states. All of these results can explain the better photocatalytic properties of S-doped anatase TiO2 in visible-light region. According to these results, the effects on electronic structures and photocatalytic properties of anatase TiO2 doping with different valence states of sulfur were compared and analyzed.