Understanding the charge flow direction within semiconductor heterojunction is of crucial importance for designing and constructing next generation photocatalysts for fundamental perspective as well as efficient production of fuels such as hydrogen and hydrogen peroxide (H2O2). Here, two-dimensional (2D)/2D g-C3N4/In2S3 heterostructures are explored for photocatalytic H2O2 production in organic electron donor-free condition for the first time. The substantially augmented photocatalytic performance is unveiled by charge flow tracking realized through in situ reduction of Au ions by electron into Au and oxidation of Pb ions by hole into PbO2, revealing that photoinduced electrons of g-C3N4 move to In2S3 and holes remain in g-C3N4, prompting effective separation of charges. The experiments of radical trapping confirm that the photoexcited electrons accumulated on the conduction band of In2S3 in g-C3N4/In2S3 heterostructures generate H2O2 through a two-step one-electron reduction reaction of O2. This work not only identifies In2S3 as a new promising material for the photocatalytic H2O2 production but also provides a new approach for rational design of heterojunction photocatalyst via tracking charge flow direction to boost H2O2 production.