Titanium dioxide/graphitic carbon nitride (TiO2/gC3N4) nanocomposite was successfully synthesized via the mixing of graphitic carbon nitride (gC3N4) with bulk titanium dioxide (TiO2) under sonication. The effect of precursor ratio on the morphological structure and photocatalytic hydrogen peroxide (H2O2) production performance was also investigated. According to the results, the TiO2 was successfully embedded and evenly distributed onto the structure of the gC3N4. Moreover, the as-prepared material with the TiO2 content of 20 % with respect to gC3N4 and catalyst dosage of 3 mg also possessed the greatest photocatalytic performance with an H2O2 production capacity of more than 3000 μM·g−1·h−1. Besides, the material also exhibited great recyclability, which remained at 70 % of the original performance after 5 consecutive reusing cycles. Following to the aforementioned results, the TiO2/gC3N4 nanocomposite can be considered a potential material for the photocatalytic production of H2O2.