In situ sulfur-doped mesoporous g-C3N4 (mpgCNS) was synthesized from a simple organosulfur compound, thiourea, using SiO2 nanoparticles as the hard template. The resultant product has a high surface area of 128 m2 g−1 and mesopores in the range of 10–20 nm. Based on X-ray photoelectron spectroscopy analysis, the doped sulfur was proposed to substitute carbon in mpgCNS and a downshift of 0.25 eV was resulted in its conduction band. Optical studies indicated that mpgCNS exhibits enhanced and extended light absorbance in the visible light region and a much lower density of defects compared to the native g-C3N4. As a result, mpgCNS has been found to be 30 times more active than the native g-C3N4 for hydrogen evolution from photocatalytic water splitting. A high quantum efficiency of 5.8% at 440 nm was obtained which is among the highest for carbon nitride photocatalysts.