Effects of current density on the anodizing process,surface morphology,thickness and corrosion resistance of the anodized films of AZ 31 B magnesium alloy were studied by applying an environment-friendly electrolyte of KOH-Na_2SiO_3-Na_2B_4O_7-Na_2CO_3 system.The results show that according to the voltagetime curves,the anodizing process could be divided into three stages: fast increasing stage,slowly increasing stage and relatively stable stage in voltage.With the increasing of current density,slopes of the voltage-time curves increase,the voltage values increase remarkably,and the ignition time decreases,but the breakdown voltage has no apparent variation.The compactness,thickness,and corrosion protection of the anodized films all increase at first and then decrease with the increasing of current density.When the current density is at 1.5 A/dm~2,the compactness and corrosion resistance of the anodized film are the best.