Magnesium coating was electroplated on carbon steel to improve its corrosion protection. The analytical characterization of the magnesium coating was performed by scanning electron spectroscopy and energy dispersive X-ray spectroscopy. The electrochemical behavior of Mg-coated carbon steel was assessed by electrochemical impedance spectroscopy, open-circuit potential measurements and potentiodynamic polarization curves in 0.03% sodium chloride solution. The electrochemical results showed that the self-corrosion current density (i corr) of magnesium-coated steel was 0.32 mA cm−2 (about 1.8% of that of uncoated steel). Impedance results showed an increase of the total impedance when magnesium coating was applied on steel substrate. The corrosion protection was ensured by a two-step mechanism. The first step was cathodic polarization; the second step was the formation of a barrier due to magnesium oxides composed of MgO, Mg(OH2) and Mg(OH3)Cl.