Perovskite SrTiO3 (STO) is an attractive photocatalyst for solar water splitting, but suffers from a limited photoresponse in the ultraviolet spectral range due to its wide band gap. By means of hybrid density functional theory calculations, we systematically study engineering its band gap via doping 4d and 5d transition metals M (M=Zr, Nb, Mo, Tc, Ru, Rh, Pd, Hf, Ta, W, Re, Os, Ir and Pt) and chalcogen elements Y (Y=S and Se). We find that transition metal dopant M either has no effect on STO band gap or introduces detrimental mid-gap states, except for Pd and Pt that are able to reduce the STO band gap. In contrast, doping S and Se significantly reduces STOs direct band gap, thus leading to appreciable optical absorption transitions in the visible spectral range. Our findings provide that Pd, S and Se doped STO are potential promising photocatalysts for water splitting under visible light irradiation, thereby providing insightful theoretical guides for experiments to improve the photocatalytic activity of STO.