MRI is based on the principles of magnetic resonance. Most particles, thus electrons, protons and neutrons have intrinsic angular momentum ( , commonly known as spin) and magnetic dipole moment ( ). The proton and electron pairs have opposite spins within the atomic nuclei (similarly to the electrons in the electron shells), but due to the presence of unpaired components, many atomic nuclei have resultant spin and magnetic dipole moment (e.g. , F). These two quantities are related: their directions are the same, and their ratio, the gyromagnetic ratio is characteristic of the individual atoms.

(1)

This of course also means that the dynamics of the two are identical. When we later refer to the change in the direction of the spin in magnetic interactions, we implicitly apply formula (1).
If the atom is placed in an external magnetic field , it will interact with the magnetic moment, and a “potential energy”, which is dependent on the relative direction of the external field and the magnetic moment, can be defined.

(2)

Due to the quantum behaviour of the system, the direction of the atomic momentum cannot be arbitrary in the external field; its projection onto the direction of the external field can only take on small integer numbers. Let us define a coordinate system the z axis of which points in the direction of the external field. In this case the z component of the angular momentum (operator) is , , and the z component of the magnetization is , where takes on small integer numbers. Thus, the energy defined in formula (2) will not be continuous either, but it will have well defined levels:

(3)

An external oscillating magnetic field (typically electromagnetic radiation) usually has little effect on the system. However, if the energy quantum of the radiation () is equivalent to the distance of the energy levels, then the probability of absorption and induced emission increases by orders of magnitude. This is resonance. In this case, as a result of the external radiation, while absorbing one energy quantum from it, the moment turns from a possible lower energy state to a higher energy state.

(4)

In a resonant magnetic field the probability of the reverse process is similar, i.e. the excited moment jumps to a lower energy level by emitting a photon with appropriate energy.)
The lifespan of the excited state is finite. In the end, the potential energy of the spin forms into atomic movements (heat) in different processes. This is called spin-grid relaxation. The intensity of the relaxation processes can be described by their characteristic time. In case of the spin-grade relaxation it is usually denoted by .