In this work, a carbon-doped carbon nitride photocatalyst is successfully synthesized through a simple centrifugal spinning method after heat treatment. The morphology and properties of the prepared photo catalyst are characterized by Xray diffraction (XRD), scanning electron microscopy (SEM), transmission electron microscopy (TEM), UV–vis spectrophotometer (UV-vis), and specific surface area. The results show that the band gap of the prepared sample, g-CN-10 is 2.1 eV, is significantly lower than that of pure carbon nitride, 2.7 eV. As the amount of cotton candy increased, the absorption capacity of the prepared catalyst for visible light is significantly enhanced. In addition, the degradation efficiency of Rhodamine B (RhB) by sample g-CN-10 is 98.8 % over 2h, which is twice that value of pure carbon nitride. The enhancement of photocatalytic ability is attributed to the increase of specific surface area after the carbon doping modifies carbon nitride. A possible photocatalytic degradation mechanism of carbon-doped carbon nitride is also suggested.