Mg-doped NiO (Ni0.61Mg0.39O) thin films were fabricated by using magnetron sputtering "co-sputtering" method. Ar gas was used as the sputtering gas, high-purity NiO and MgO double ceramic targets were used as the sputtering target. The sputtering power of NiO and MgO target was controlled at 190 W and 580 W respectively, the sputtering vacuum degree was kept 2 Pa, and the substrate temperature was kept at 300 ℃. The obtained thin film was a crystalline film with (200) preferred orientation. The surface was relatively flat and the distribution of the grains was dense. The grain size of the film was about 46.9 nm, and the diffraction peak position of (200) was shifted to small angle of about 0.2° compared with that of the undoped NiO film. The film had a high transmittance in the visible light region, but the transmittance dropped sharply near 300 nm. The optical bandgap of the film moved to 3.95 eV towards higher energy direction. It provides technical support for the fabrication of high quality Mg-doped NiO thin films using magnetron sputtering co-sputtering method.