This study aims to investigate the effect of the processing parameters in plasma electrolytic oxidation (PEO) on the corrosion resistance of magnesium alloy type AZ91. The PEO coatings were prepared on the samples using alkaline‐based electrolyte. Both unipolar and bipolar, different frequencies and duty cycles were applied. Corrosion tests, using potentiodynamic polarization, linear and cyclic, and electrochemical impedance spectroscopy techniques, were applied on the as‐received and PEO coated samples. Scanning electron microscopy was used to investigate the surface morphology, for example, micropores, as well as to measure the thickness of the coated layer by changing the processing parameters. The results show that the size of micropores is interrelated to the duty cycle percentage and current polarities, as the higher frequency causes thinner coating layers, with fewer micropores, consequently higher corrosion resistance. In addition, increasing the duty cycle, a denser and more compact coating was obtained. The XRD results showed a missing peak of the α‐Mg phase in a PEO coated sample using bipolar, the highest frequency (1666 Hz), and the highest duty cycle (66.6%). The mils per year calculations showed that the PEO coated has a lower corrosion rate by at least 8 times than the as‐received alloy.