Mg-doped ZnO (MZO) thin films were successfully fabricated on fluorine-doped tin-oxide (FTO)-coated glass substrates by an electrochemical deposition method using aqueous electrolytes of 80 mM Zn(NO3)2 with different concentrations of Mg(NO3)2.