Size-controllable g-C3N4 quantum dots (QDs) were in-situ synthesized and grafted onto single-crystalline TiO2 nanotube arrays (TiO2-NTAs) based on nanotube-confinement effect. This photoelectrocatalyst exhibited high activity in synergetic H2 evolution and organic pollutant degradation. The g-C3N4 QDs, together with TiO2-NTAs due to multiple light reflections, promoted light harvesting owing to the narrow energy band gap and upconversion from quantum size effect of g-C3N4 QDs. Meanwhile, the single-crystal TiO2in-situ formed during the g-C3N4 synthesis process favored the photoelectron transfer, and the g-C3N4/TiO2 heterojunctions further promoted separation of photoelectrons from holes. Moreover, the strong g-C3N4–TiO2 interaction and the confinement effect of TiO2 nanotubes efficiently inhibited self-gathering and leaching of g-C3N4 QDs, leading to excellent stability in photoelectrocatalysis.