Photocatalysis provides a promising opportunity for selective oxidation of biomass to high-value chemicals under mild conditions. The key to realize this transformation is to design a cost-effective and environmentally friendly photocatalyst. Here, we report the preparation of a carbon nitride photocatalyst with controllable carbon/nitride (C/N) ratio and its application in the selective photocatalytic synthesis of lactic acid from biomass-derived monosaccharides. Reasonable C/N ratio in the catalyst can significantly enhance the visible light absorption range and accelerate the mobility of photogenerated carriers. The obtained photocatalyst exhibited excellent photocatalytic activity, yielding 76.8% lactic acid. All of the h+,·O2-,·OH and 1O2 are beneficial for lactic acid production, and the·O2- plays a major role. Furthermore, the photocatalyst exhibited excellent reusability and universality. The 1000-fold scale-up experiments indicated that the system has potential for industrial production of lactic acid. Therefore, the present work offers a promising example for photocatalytic reforming of biomass.