The materials a magnet can attract are classed as either ferromagnetic, paramagnetic, or diamagnetic. These categories are used to describe the extent to which materials can be attracted to magnets.
Any materials which do not fall into any of these categories, such as wood, are classed as non-magnetic.
Ferromagnetic materials
A ferromagnetic material (containing an element of either iron, nickel, cobalt, or gadolinium) is attracted to a magnetic force.
Ferromagnetic materials are classed as so because their atoms have a high level of magnetism due to how their electrons are aligned. The electrons are easily aligned in the same magnetic direction, making them attractive to a magnet.
Most varieties of stainless steel are classed as ferromagnetic, however not all of them are, for example, austenitic stainless steel is a non-magnetic type of stainless steel.
Whether stainless steel is classed as ferromagnetic or not depends on the alloy it is made from, as some have a high nickel content which can negatively affect the magnetic ability.
Paramagnetic materials
Paramagnetic metals are very weakly attracted to a magnet due to a limited number of their electrons aligning in the same magnetic direction. However, there are not enough for these metals to create their own magnetic force.
Comparatively speaking, they are about one million times weaker than ferromagnetic materials, which means their magnetic field can only be measured by very sensitive instruments, such as magnetometers.
Examples of paramagnetic materials are aluminium, uranium and platinum.
Diamagnetic materials
Diamagnetic materials are metals which can weakly repel a magnet when they are near a strong magnetic field. They create their own small magnetic field with opposite poles, which makes the two magnetic fields repel each other.
Metals such as bismuth and carbon graphite are types of diamagnetic materials.
Non-magnetic materials
Non-magnetic materials are those which have atoms that cannot be changed into a magnetic composition, no matter what size of magnetic field they are exposed to. For example, wood, plastic, and glass are classed as non-magnetic.