In physics, magnetism is a phenomenon by which materials exert an attractive or repulsive force on other materials. Magnetism arises whenever electrically charged particles are in motion. Some well known materials that exhibit magnetic properties are iron, some steels, and the minerallodestone. All materials are influenced to one degree or another by the presence of a magnetic field, although in some cases the influence is too small to detect without special equipment.

Magnetic forces are fundamental forces that arise due to the movement of electrically charged particles. The origin and behavior of the fields that govern these forces are described by Maxwell's equations (see also Biot-Savart's Law).

For the case of electric current moving through a wire, the resulting field is directed according to the "right hand rule". If the right hand is used as a model, and the thumb of the right hand points along the wire from positive towards the negative side, then the magnetic field will wrap around the wire in the direction indicated by the fingers of the right hand. If a loop is formed, such that the charged particles are traveling in a circle, then all of the field lines in the center of the loop are directed in the same direction. The result is called a magnetic dipole. When placed in a magnetic field, a magnetic dipole will tend to align itself with that field. For the case of a loop, if the fingers of the right hand are directed in the direction of current flow, the thumb will point in the direction corresponding to the North pole of the dipole.

Magnetic dipoles or magnetic moments can often result on the atomic scale due to the movements of electrons. Each electron has magnetic moments that originate from two sources. The first is the orbital motion of the electron around the nucleus. In a sense this motion can be considered as a current loop, resulting in a magnetic moment along its axis of rotation. The second source of electronic magnetic moment is due to a quantum mechanical property called spin.

In an atom the orbital magnetic moments of some electron pairs cancel each other. The same is true for the spin magnetic moments. The overall magnetic moment of the atom is thus the sum of all of the magnetic moments of the individual electrons, accounting for moment cancellation between properly paired electrons. For the case of a completely filled electron shell or subshell, the magnetic moments completely cancel each other out. Thus only atoms with partially filled electron shells have a magnetic moment. The magnetic properties of materials are in large part determined by the nature and magnitude of the atomic magnetic moments.