Abstract The study intended to enhance the visible light activity of titanium dioxide (TiO2) by doping it with carbon, thereby reducing its effective band gap. Carbon-doped TiO2 nanofibers were synthesized using a simple electrospinning process. The prepared samples were then characterized to investigate their properties. X-ray diffraction (XRD) analysis confirmed the presence of the rutile phase of TiO2 in the nanofibers. The XRD pattern exhibited maximum peak intensity at the highest temperature used during synthesis, indicating that the temperature influenced the crystalline structure of the nanofibers. Scanning electron microscopy (SEM) was conducted to examine the morphology of the nanofibers. The results revealed that as temperature increased, the diameter of the nanofibers decreased. The XRF (X-ray Fluorescence) results indicate the atomic composition of carbon-doped TiO2 nanofibers. UV–vis spectroscopy was performed to evaluate the optical properties of the carbon-doped TiO2 nanofibers. The results demonstrated a shift of the optical band towards the visible region. Moreover, the carbon doping reduced the effective band gap, resulting in improved visible light activity of the TiO2 material. These results have significant implications for potential applications of carbon-doped TiO2 nanofibers in various fields, such as photocatalysis and solar energy conversion.