Abstract:NiO is a new type of wide bandgap semiconductor (Eg=3.6eV),by doping with Mg element, the bandgap of Mg-doped NiO thin films can be adjusted larger. By using pure NiO and MgO double ceramic targets as sputtering targets, Mg-doped NiO thin films were deposited using radio-frequency magnetron co-sputtering method in pure argon and pure oxygen gas, respectively. The crystal structure, morphological characteristics, composition and optical properties of the obtained films were compared by X-ray diffraction (XRD), Scanning Electron Microscope (SEM), Energy Dispersive Spectrometer (EDS) and UV-Visible Spectrophotometer. The properties of the thin films deposited in different sputtering gases are quite different. For the films deposited in pure argon gas, it is a polycrystalline thin film with (200) preferred orientation. While the film deposited in pure oxygen is amorphous film.The grain size, molar ratio of Mg to Ni atoms and optical bandgap is larger for the films deposited in pure argon gas than that deposited in oxygen gas.