Ni-doped TiO2 nanoparticles have been synthesized by a modified sol–gel method. The crystal phase composition, particle size, and magnetic and optical properties of the samples were comprehensively examined using x-ray diffraction analysis, transmission electron microscopy, Brunauer–Emmett–Teller surface area analysis, Raman spectroscopy, magnetization measurements, and ultraviolet–visible (UV–Vis) absorption techniques. The results showed that the prepared Ni-doped TiO2 samples sintered at 400°C crystallized completely in anatase phase with average particle size in the range from 8 nm to 10 nm and presented broad visible absorption. The bactericidal efficiency of TiO2 was effectively enhanced by Ni doping, with an optimum Ni doping concentration of 6% ( x = 0.06), at which 95% of Escherichia coli were killed after just 90 min of irradiation. Density functional theory (DFT) calculations revealed good agreement with the experimental data. Moreover, the Ni dopant induced magnetic properties in TiO2, facilitating its retrieval using a magnetic field after use, which is an important feature for photocatalytic applications.