Carbon-based solar photocatalysts for overall water splitting could provide H 2 as an energy vector in a clean and sustainable way. Band engineering to align energy levels can be achieved, among other ways, by doping. Herein, it is shown that phosphorous doping of microporous graphitic carbons derived from pyrolysis of α-, β-, and γ-cyclodextrin increases the valence band edge energy of the material, and the energy value of the conduction band decreases with the P content. In this way, P doping increases the activity of these metal-free materials in photocatalytic overall water splitting under simulated sunlight and visible-light illumination. The optimal P-doped photocatalyst in the absence of any metal as a cocatalyst affords, after 4 h of irradiation with simulated sunlight, a H 2 production of 2.5 mmol of H 2 × g catalyst −1 in the presence of methanol as the sacrificial agent or 225 μmol of H 2 × g catalyst −1 from pure H 2 O.