Photoelectrochemical water splitting over a photoelectrode is an auspicious methodology for green hydrogen production. The intriguing properties of graphitic carbon nitride (g-C 3 N 4 ) in water splitting were studied via construction of a heterojunction with bismuth-based (BiOX, X = F, Cl, Br, and I) oxyhalides. The g-C 3 N 4 /BiOF heterostructure materials were prepared by adding preformed g-C 3 N 4 via an ultrasonication process by applying a frequency of 50 Hz and a power of 100 W for 2 h. The fabricated 6% g-C 3 N 4 /BiOF electrode exhibited a significant photoelectrocatalytic (PEC) activity in alkaline medium with front and back light illumination. In the case of back light illumination, 6% g-C 3 N 4 /BiOF exhibited a higher photocurrent density of 48.2 μA/cm 2 at 1.23 V versus RHE, which is 5-fold larger than that of bare g-C 3 N 4 . The augmented charge separation and migration of the photoelectrode were confirmed using the transient time-photocurrent response curve and the open-circuit potential, which is consistent with photoluminescence spectra. The higher charge carrier transfer of 6% g-C 3 N 4 /BiOF was confirmed by electrochemical impedance spectroscopy analysis. The heterojunction between g-C 3 N 4 and BiOF was confirmed by FT-IR spectroscopy, Raman spectroscopy, FESEM, and HRTEM analyses, which facilitates the applied bias photon-to-current efficiency and significant stability of the fabricated photoelectrode up to 7500 s. Furthermore, the PEC water splitting performance of the 6% g-C 3 N 4 /BiOF electrode in reverse osmosis-rejected wastewater was explored. Finally, a possible charge-transfer mechanism of the g-C 3 N 4 /BiOF heterojunction during PEC water splitting was proposed, and this work could initiate the BiOF photocatalyst for PEC water splitting.