By their very nature every permanent magnet contains a form of iron. Iron displays the most dramatic ferromagnetic properties of all elements, which is why it is found in the most powerful magnets. However, iron is highly reactive to water and hence makes magnets with high iron content very susceptible to corrosion. Other ferromagnetic elements used in different types of permanent magnets include nickel, cobalt, gadolinium and dysprosium all of which have an impact on both magnetic strength and resistance to corrosion.
The strongest permanent magnets available are neodymium magnets, but because of their high iron content (64-68%) they are also highly susceptible to corrosion in damp environments. Modern manufacturing techniques have seen traces of other rare earth elements such as dysprosium added to the NdFeb alloy to improve resistance to corrosion as well as other magnetic properties. Because of their susceptibility to corrosion neodymium magnets are almost always coated before being used. A very common coating used for permanent magnets is a triple layer of nickel-copper-nickel, however there are many other suitable options including but not limited to gold, silver, zinc, tin, epoxy, PTFE and various paints and lacquers.
Samarium cobalt magnets, which like neodymium magnets are part of the rare earth family, are much more resistant to corrosion even when left uncoated. This is because much of the iron used in neodymium magnets is replaced with cobalt, which does not react to water. You will still find many samarium cobalt magnets coated as standard but this is essentially for aesthetic purposes or for application-specific reasons such as adhesion or sterility. Samarium cobalt magnets are widely used in marine and offshore applications when they have to cope with being constantly exposed to saltwater air.
Alnico and ferrite magnets are both known for their resistance to corrosion, although they don’t provide the same level of magnetic performance of rare earth samarium cobalt and neodymium magnets. Some grades of alnico magnets do contain traces of iron and therefore will display some light surface corrosion over time if exposed to water. However, if exposed to other lubricants such as oil, solvents or alcohol, alnico performs very, very well. Traditionally, alnico magnets have been coated in red paint; it is not clear how or why this custom started but it is one still followed today with most alnico magnets instantly recognisable by their trademark red finish. Ferrite magnets, also known as ceramic magnets, are made from iron-oxide and as a result they simply do not corrode even when submerged in water. Because of their unrivalled resistance to corrosion, ferrite magnets are very rarely coated, but as ferrite is a dusty material some applications will require some surface treatment to avoid the dust spreading.