g-C 3 N 4 homojunction was fabricated by thermal etching a mixture of two bulk phases of g-C 3 N 4 derived from various precursors in a 1:1 mass ratio. A larger specific surface area of 144.2 m 2 g −1 was obtained and offered more reaction active sites for photocatalytic production of hydrogen peroxide (H 2 O 2 ). Meanwhile, the built-in electric field formed by the homojunction structure facilitated the separation of charge carriers and prolonged lifetime, and the charge transfer pathway of g-C 3 N 4 homojunction aligned with a type-Ⅱ heterojunction mode. Within 60 min, the H 2 O 2 yield and tetracycline (TC) degradation efficiency of g-C 3 N 4 homojunction reached 414.6 μM and 82.1%, respectively, which were significantly higher than those of the two bulk phases of g-C 3 N 4 . In addition, the photocatalytic reaction route of H 2 O 2 production was confirmed as a continuous single-electron oxygen reduction reaction process. This study introduces a new way to apply g-C 3 N 4 -based materials in H 2 O 2 synthesis practically.