[Introduction]The corrosion resistance of anodic oxide film on AZ31 magnesium alloy needs to be improved further.[Method]Anodization of AZ31 Mg alloy was carried out by adding different mass concentrations of glucose(C6H12O6)to the electrolyte mainly composed of NaOH,Na2SiO3,and Na2B4O7.The effect of C6H12O6 mass concentration on the morphology,phase structure,and corrosion resistance of the anodic oxide film on AZ31 Mg alloy was studied by scanning electron microscopy(SEM),optical microscopy(OM),X-ray diffraction(XRD),and polarization curve measurement.[Result]The size of the micropores of the anodic oxide film on AZ31 Mg alloy was gradually decreased due to the enhanced ability of suppressing spark discharge with the increasing of C6H12O6 mass concentration from 5 to 25 g/L,but the thickness of anodic oxide film was increased initially and then decreased,with the maximum of about 28 μm at the mass concentration of C6H12O6 10 g/L,which was attributed to the saturation of C6H12O6 in the adsorption layer on the surface of Mg alloy,resulting in the reduction of film-forming rate.C6H12O6 had no significant effect on the phase structure of the anodic oxide film on AZ31 Mg alloy,and all anodic oxide films consisted of MgO and Mg2SiO4 phases.The corrosion current density(jcorr)was decreased initially and then increased,and the polarization resistance(RP)was increased initially and then decreased with the increasing of C6H12O6 mass concentration.The anodic oxide film prepared with 10 g/L of C6H12O6 on AZ31 Mg alloy had a relatively low jcorr and high Rp,showing the best corrosion resistance.[Conclusion]The corrosion resistance of the anodic oxide film can be improved in the presence of C6H12O6 in the electrolyte,due to the decrease in the size of micropores and the increase in thickness of the anodic oxide film.