In this study, the sol-gel method was used to prepare Mgdoped TiO2 nanoparticles from titanium tetraisopropoxide and magnesium sulfate as the dopant precursors. Mg-doped TiO2 shows the formation of anatase phase with polyhedral and spherical particles with an average size of 25-30 nm. X-ray diffraction, X-ray photoelectron spectroscopy, transmission electron microscopy and photoluminescence were used to characterize the prepared material. The photocatalytic degradation performance of rhodamine B, nonylphenol ethoxylates, pseudoephedrine hydrochloride, and nicotine on Mg-doped TiO2 was studied under UV irradiation. The photocatalytic degradation shows that 98.92, 98.00, 98.00 and 97.95% of rhodamine B, nonylphenol ethoxylates, pseudoephedrine hydrochloride, and nicotine was decomposed by Mg-doped TiO2, respectively.