The autocatalytic nature of the electroless nickel-based alloy coating process will inevitably produce H2 bubbles which may be left in electroless nickel-based alloy coating. If the H2 cannot be removed and left in the coating, it can lead to its poor corrosion resistance due to hydrogen cracks. So, the post treatment is an essential step for electroless deposition process. In this paper, electroless Ni-P and Ni-W-P coatings with chromium-free pretreatment and dehydrogenation post treatment have been successfully prepared on AZ91D magnesium alloy, and the corrosion behaviors of the two kind coating samples in NaCl solution, HCl solution, and H 2SO4 solution have been investigated. Both the polarization test and immersion tests show that the electroless Ni-W-P coating has better corrosion resistance than that of electroless Ni-P coating. Copyright © 2011 WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim.