Pristine andMg- doped TiO2nanoparticles was prepared via sol-gel technique. The obtained products were characterized by powder XRD, FESEM, UV-vis spectroscopy and current-voltage characteristics. Experimental results indicated that magnesium doping inhibited the growth of crystalline size and most of the predominant phase was anatase form. The absorption edge of Mg doped TiO2 shifted to longer wavelength. When Mg-TiO2was applied in DSSC, the energy conversion efficiency was enhanced considerably compared to that using pure TiO2, it was approximately 4.69%with N719 dye under 100 mW/cm2 of stimulated sunlight.