Mg-Al co-doped ZnO (AMZO) thin films were successfully deposited onto quartz glass substrates by sol-gel spin coating method. The structure, surface morphology, composition, optical transmittance, and photoluminescence properties of AMZO thin films were characterized through X-ray diffraction, scanning electron microscopy with energy dispersive X-ray spectroscopy (EDS), transmission electron microscopy, UV-VIS-NIR spectrophotometry, and fluorescence spectrophotometry. The results indicated that AMZO thin films exhibited preferred orientation growth along the c-axis, and the full width at half maximum of the (002) diffraction peak decreased first and subsequently increased, reaching a minimum of approximately 0.275 degrees at 3% Al content. The calculated crystallite size increased from 30.21 nm to 40.73 nm. Al doping content increased from 1% to 3% and subsequently reached 19.33 nm for Al doping content at 5%. The change in lattice parameters was demonstrated by the c/a ratio, residual stress, bond length, and volume per unit cell. EDS analysis confirmed the presence of Mg and Al elements in ZnO thin films. The atomic percentage of Mg and Al elements was nearly equal to their nominal stoichiometry within the experimental error. In addition, the optical transmittance of AMZO thin films was over 85% in the visible region, and the optical band gap increased with increasing Al doping concentration. Room temperature photoluminescence showed ultraviolet emission peak and defect emission peak. The defect emission peak of AMZO thin films blue-shifted from 612 nm to 586 nm, with Al doping content increasing from 1% to 5%.