A zirconium diboride coating on 201 stainless steel prepared by electrodeposition in NaCl-KCl-K2ZrF6-KBF4 molten salts and the stability and corrosion mechanism of the stainless steel with and without ZrB2 coating in molten aluminum alloy at 800°C are investigated by immersion tests. The results show that the stainless steels suffer severe corrosion by aluminum after only 2h immersion, while the ZrB2-coated stainless steels show high corrosion resistance to aluminum attacks after 120h immersion. It can be inferred that surface modification of stainless steel by electrodepositing ZrB2 coating in molten salts is an effective way to protect substrate materials from degeneration in molten aluminum.