The wide band gap and low conductivity of TiO2 limit its application for photocatalytic H2 production. In this work, a nitrogen (N) and phosphorus (P) self-doped TiO2/Carbon (TiO2/C) composite with an egg yolk-shell structure was successfully synthesized using a lotus pollen template synthesis approach. The microstructure and photoelectrochemical performance of the composite materials were investigated. The introduction of hetero elements decreased the band gap of the TiO2/C composite, extending light absorption to the visible light region. Additionally, the enhanced conductivity facilitated fast charge transfer and prolonged the lifespan of electron/hole pairs. Consequently, the N, P self-doped TiO2/C composite exhibited higher H2 production (656.18 μmol·g−1·h−1) than commercial TiO2 (418.12 μmol·g−1·h−1) under simulated sunlight irradiation.