Purpose: The purpose of this paper is to study the effects of voltage on microstructure and properties of micro-arc oxidation (MAO) ceramic coatings formed on AZ31B magnesium alloy under the constant current–constant voltage operation mode. Design/methodology/approach: The wear and corrosion resistance of MAO coating on AZ31B magnesium alloy was studied by MAO in silicate electrolyte under constant current and constant voltage. Findings: When the voltage is 360 V, the wear and corrosion resistance of AZ31B magnesium alloy is the best. Originality/value: The wear and corrosion resistance of MAO coating on AZ31B magnesium alloy was studied by friction wear and electrochemical workstation.