The degradation of organic contaminants in water is a pressing issue that must be addressed·H2O2 has a strong oxidation ability and is frequently used in environmental remediation as a reactive oxygen species in advanced oxidation technology. In this study, using supramolecular self-assembly method we synthesized carbon nitride (CN) with an ultra-thin porous structure. The optimally modified CN (CN-MCA-U-2.5), had excellent H2O2 production activity under LED white light, with a rate of 377.06 μmol/(g × h), which was 12.09 times greater than that of CN. Furthermore, after 5 h under visible light irradiation, the H2O2 yield of CN-MCA-U-2.5 was 1256.80 μmol/g. Furthermore, CN-MCA-U-2.5 also had excellent Rhodamin B (RhB) degrading activity. The degradation degree reached 88.50% in 30 min under the excitation of LED white light. The reaction pathway of H2O2 for CN-MCA-U-2.5 was found to be a two-step single-electron O2 reduction reaction, according to the mechanism analysis. O2 and HO2 were the major variables in the degradation process.