In this study, Mg-doped ZnO nanoparticles with 2% Mg content were synthesized by sol-gel method.The structure and morphology of the nanoparticles were characterized by TEM, BET and UV-Vis absorbance techniques.From TEM image, it was found out that the nanoparticles had uniform size and uniform distribution.BET analysis revealed that in comparison with pure ZnO, Mg 2%/ZnO nanoparticles had a higher specific surface area.Based on UV-Vis absorbance analysis, Mg 2%/ZnO nanoparticles shifted to a lower wavelength (blue-shift), showing a high photocatalytic activity under UV light irradiation.The central composite design under the response surface methodology (RSM) was used for optimization of the photocatalytic removal of Rhodamine B (RhB) with Mg 2%/ZnO nanoparticles.The results showed that there was a good agreement between the predicted data from RSM and the experimental data with a correlation coefficient of 0.9354.The determined optimum values for removal of RhB were as follows: Mg 2%/ZnO nanoparticles dosage of 500 mg L -1 , initial RhB concentration of 6 mg L -1 , the irradiation time of 6 min, and pH = 8.In order to get more information about photocatalytic activity of the prepared Mg 2%/ZnO nanoparticles, a comparison was made between the photocatalytic activity in this study and that reported by other researchers.The results revealed the synthesized Mg 2%/ZnO nanoparticles had considerable photocatalytic activity.