In this present work, the synthesis of g-C3N4/TiO2 nanocomposites with different wt.% g-C3N4 to form a type-II heterostructure and its potential application towards photoelectrocatalytic water splitting was discussed. The synthesized g-C3N4 nanoplatelets incorporated TiO2 nanocomposites were characterized by various analytical techniques such as UV–vis diffuse reflectance spectroscopy, X-ray diffraction, Fourier transform infrared spectroscopy, photoluminescence spectroscopy, X-ray photoelectron spectroscopy, thermogravimetric analysis and high-resolution transmission electron microscopy (HRTEM). HRTEM confirms the formation of type-II heterostructure consists of g-C3N4 nanoplatelets incorporated titania in the nanocomposite. The photoelectrocatalytic activity of the TiO2, g-C3N4, and g-C3N4/TiO2 nanocomposite were investigated under AM 1.5G (100 mW cm−2) illumination in 1 M KOH. The g-C3N4/TiO2 (with 10 wt.% of g-C3N4) nanocomposite photoanode exhibits photocurrent density of 142.7 μA cm−2 (at 1.23 V vs. RHE) which is ~ 1.8-fold higher than bare TiO2 (80.5 μA cm−2 at 1.23 V vs. RHE). The enhancement in PEC activity explained by formation of type-II heterostructure between g-C3N4 and TiO2, which reduced the recombination rate of photo-generated electron–hole pairs and also extends the absorption of TiO2 to visible light range and boost up the interfacial charge transfer between electrode/electrolyte interface, which enhance the PEC activity of the g-C3N4/TiO2 nanocomposite towards water splitting.