Zinc oxide (ZnO) and magnesium doped ZnO (MgxZn1-xO) nanoparticles were prepared by flame spray synthesis. X-ray diffraction and field emission scanning electron microscopy were used to investigate the composition and structure of the samples. The results indicated that the samples contained nanoparticles of uniform size ranging between 10—20nm; and after introducing Mg into ZnO the lattice constant decreased. According to the UV-VIS transmission spectra, the band gap of MgxZn1-xO nanoparticles was wider than that of ZnO nanoparticles. The photoluminescence of the samples showed high intensity UV emission, and the mechanisms of emission were discussed.