Al doped Zn1-xMgxO (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-2 Ω∙cm was achieved for a film with an optical bandgap of 3.6 eV.