This research is to produce corrosion protection coatings on magnesium alloys (AZ91D) with good performance and less time and less power consumption by optimising the electrolytes used in plasma electrolytic oxidation processes. Coatings were produced in a NaAlO2solution and two composite electrolytes, namely NaAlO2/NaBO2and NaAlO2/NaBO3. The effects of borate additives on the coating formation processes, phase structure, microstructure, and corrosion property are discussed. The results indicate that borate additives can greatly increase the coating growth rate and improve the corrosion property by strengthening the micro-arcing growth process and accelerating coating’s fuse and re-crystallisation. The coating can have a thickness of about 40 μm with NaBO3additives in NaAlO2electrolyte after 50-min treatment. The coating thickness is only 8 μm using NaAlO2electrolyte. Specifically, the coating produced in NaBO3–NaAlO2solution achieves the best corrosion resistance among all the coatings due to its uniform, dense, and thick structure. [ABSTRACT FROM AUTHOR]