Pure Mg and Mg-6wt.%Al alloy were coated by the plasma electrolytic oxidation with various coating times and the microstructural and mechanical characteristics of the coatings were investigated. The coatings on pure Mg and Mg-6wt.%Al alloy consisted of MgO and Mg2SiO4. The surface roughness and thickness of the coatings became larger as the coating time increased. The coatings on the Mg-6wt.%Al alloy were more uniform and thicker than those on pure Mg. The microhardness and friction coefficient of the coatings increased progressively as the coating time increased. In addition, the coatings on the Mg-6wt.%Al alloy compared to pure Mg showed improved microhardness and a better friction coefficient.