Rapid recombination of photoinduced charge carriers and poor photocatalytic degradation performance greatly hinder the large-scale application of g-C3N4 photocatalysis. Therefore, the g-C3N4 is modified by BiPO4 to overcome its poor photocatalytic performance, which is investigated by methylene blue (MB) removal. The S scheme heterojunction is constructed by modifying g-C3N4 with BiPO4, which can effectively preserve the redox activities of holes and electrons on VB and CB, exhibiting good photocatalytic activity. Therefore, the modified g-C3N4 exhibits excellent photocatalytic activity with efficient separation of the photoelectron-hole, compared to pure g-C3N4 and BiPO4. The modified g-C3N4 exhibits large MB degradation removal of 96.7 %, which is significantly larger than the pure g-C3N4 (46.3 %) and BiPO4 (3.3 %) owe to synergy, respectively. The photodegradation rate constant of the modified g-C3N4 is 4.8 and 43 times larger than that of the pure g-C3N4 and BiPO4, respectively. The modified g-C3N4 still has large MB removal of 92.9 % after 5 cycles, indicating excellent stability and recyclability. The fractal density calculation of the modified g-C3N4 is investigated combined with LUMO and HOMO analysis. The MB photocatalytic degradation process follows the S scheme charge transfer mechanism, based on degradation mechanism analysis combined with semiconductor energy band and density functional theory calculation analysis. The MB photocatalytic degradation path is systemically analyzed based on MS-UPLC result analysis, which indicates that MB is finally decomposed into CO2 and H2O, achieving the degradation of MB.