Bandgap enlarged Mg-doped aluminum zinc oxide (Mg-doped AZO) film is a potential transparent conducting oxide for applications in photonics devices. The oxide film normally deposited by sputtering, particularly using ceramic targets, while maintaining its pristine property for the film deposited using metallic targets is rarely addressed. This study investigated the optical and electrical properties of Mg-doped AZO films that were performed by a magnetron reactive co-sputtering method using metallic Mg and Al–Zn targets. Doping of Mg in the AZO significantly affects the electrical resistivity and optical transmission of the films because Mg tends to replace part of Zn lattice sites. The 1.2 at.% Mg-doped AZO film had an electrical resistivity of 7.9 × 10−4 Ω·cm, an optical transmittance of 92.6% in the visible light range, and a bandgap of 3.66 eV when the film was post-annealed at 600 °C. The Mg doping widens the bandgap and, thus, increases the transmittance of the AZO film. Because of the superior electrical and optical characteristics, the Mg-doped AZO films prepared using the metallic targets can be a reliable transparent conducting oxide for applications.