Pure and magnesium-doped TiO2 nanoparticles (NPs) of three different concentrations (3, 6, and 9 mol%) were synthesized by a simple, cost effective solvothermal microwave irradiation method and characterized by XRD, EDAX, transmission electron microscopy (TEM), and UV-Vis diffuse reflection spectroscopy. X-ray diffraction studies performed on synthesized NPs have shown that the anatase phase is preserved after doping and the dopant does not change the crystalline phase (anatase) of the parent material (TiO2). TEM results revealed that the particle size was significantly reduced with increasing dopant concentration and are spherical in shape. For the J–V measurements, the devices were subjected to the simulated sun light of 100 mW/cm2 irradiation with a working electrode area of 0.25 cm2 (0.5 × 0.5 cm). The results show that the dye-sensitized solar cell based on a 3 mol% Mg-doped TiO2 electrode achieved a photoelectrical conversion efficiency of 7.36% which is perceptibly increased by 17.6% than undoped TiO2 (6.26%).