Transparent semiconductor thin films of Zn 1Àx Mg x O (0 £ x £ 0.36) were prepared using a sol-gel process; the crystallinity levels, microstructures, and optical properties affected by Mg content were studied. The experimental results showed that addition of Mg species in ZnO films markedly decreased the surface roughness and improved transparency in the visible range. A Zn 1Àx Mg x O film with an x-value of 0.2 exhibited the best average transmittance, namely 93.7%, and a root-mean-square (RMS) roughness of 1.63 nm. Therefore, thin-film transistors (TFTs) with a Zn 0.8 Mg 0.2 O active channel layer were fabricated and found to have n-type enhancement mode. The Zn 0.8 Mg 0.2 O TFT had a field-effect mobility of 0.1 cm 2 /V s, threshold voltage of 6.0 V, and drain current on/off ratio of more than 10 7 .