Magnesium alloy has been widely investigated as a biodegradable implant material owing to its unique properties to degrade spontaneously in human body fluid without causing toxicity. However, the degradation rate needs to be controlled. An effective way to lower down the degradation rate of Mg alloy is by coating with plasma electrolytic oxidation (PEO) technique. In this research, the microstructure and mechanical hardness of the PEO film formed on AZ31 were investigated. The film was prepared under a constant current of 400 A/m2 in the Na3PO4 solution at 30°C. The voltage-time curve showed an immediate increase of current during the first 25 s before reaching a steady-state voltage of 150 V. The spark discharge revealed as white micro discharges. The film formed for 3 min exhibited a high surface roughness with a large variety of thickness in the range of 1-20 µm. The film contained pores and cracks. The big pores with diameter size 10-20 µm were formed as a result of gas entrapment, while the small pores with a radius of 1-3 µm were associated with the discharge tunnel during the PEO process. The X-ray diffraction pattern indicated that the film composed of crystalline Mg3(PO4)2.