Solar production of hydrogen peroxide (H2O2) from oxygen gas and water using photocatalysts is a safe, cost-effective, and eco-friendly method. However, the development of efficient photocatalysts has been impeded by their high decomposition rate of photogenerated H2O2 on the surface of photocatalysts. Here we report CdS/sulfur-doped carbon nanocomposites prepared by adopting a Cd- and S-containing metal-organic framework as a precursor. The intimate contact between the two components provoked their synergetic effect for much better H2O2 production performance than that of commercial CdS, where the hydrophobic sulfur-doped carbon prevent the approach of H2O2 and suppress its decomposition. Resultingly, it recorded H2O2 concentration of 17.1 mM under visible light irradiation in KOH solution with 2-propanol as a hole scavenger, which is the highest value among all the reported photocatalysis systems. This value is sufficiently high to be directly utilized in area of bleaching and acidic waste treatments.