An atom can act as tiny magnet due to the spinning and orbiting motion of negatvely charged particles called electrons. The spinning motion of electrons creates a magnetic dipole moment, while the orbiting motion of electrons around the nucleus creates a magnetic current loop. These two effects combine to produce a net magnetic moment for the atom. The strength of the magnetic moment depends on the number of electrons in the atom and their spin and orbital angular momenta.