An investigation is performed into the optical and electrical application of Mg doping GZO thin films deposited on glass substrates using a radio frequency magnetron sputtering (RF-sputtering) system with working pressures ranging from 3 to 9 mtorr. The X-ray diffraction patterns show that the MGZO films all exhibit a strong (103) preferential orientation. Moreover, the films show an average optical transmittance of approximately 85% in the visible light range. The electrical resistivity increases with an increasing working pressure. Thus, the optimal resistivity (1.9 × 10−3 Ω-cm) is obtained at the lowest working pressure of 3 mtorr and is the result of an improved crystalline structure. The results show the Mg doping GZO can be applied in the optical elements.