In this study, a nanocrystalline layer composed primarily of martensite phase was prepared on the surface of 304 stainless steel. The results showed that the nanocrystalline layer before and after heat treatment exhibited excellent erosion resistance.