TiO2 nanoparticles were synthesized via sol–gel method using different N or NF doping precursors. The prepared samples were characterized by UV–Vis-DR Spectroscopy (DRS), X-ray diffraction (XRD), N2 physisorption and X-ray photoelectron spectroscopy (XPS). The photocatalytic activity was evaluated in the degradation of ethylbenzene in the gas phase at atmospheric pressure and room temperature. The results showed that nitrogen and fluorine were successfully doped in TiO2 leading to a clear narrowing of the band gap energy (red shift). This narrowing was especially observed for N–TiO2 (2.91 eV) when using urea as nitrogen precursor. The sample prepared with 4-fluorobenzyleamine as precursor showed the smallest pore size (around 10 nm) and crystallite size (about 12 nm) compared to the other prepared catalysts. Additionally, it showed the highest efficiency for the photocatalytic conversion of 1000 ppm ethylbenzene, reaching around 32% under UV light and 17% under visible light.