Al doped Zn<sub>1-x</sub>Mg<sub>x</sub>O (AZMO) thin film was developed by sol-gel process with two-step annealing. Effect of annealing temperature on structural, optical and electrical properties was investigated. It was found that first annealing mainly determines the film crystallinity and grain size, while the second annealing plays a critical role in activating dopant. All of AZMO thin films show a (002) preferential orientation and a high transmittance of over 85% in wavelength region from 400 nm to 1500 nm. A resistivity of 2.1×10<sup>-2</sup> Ω∙cm was achieved for a film with an optical bandgap of 3.6 eV.