The nuclear magnetic moment is the magnetic moment of an atomic nucleus and arises from the spin of the protons and neutrons. It is mainly a magnetic dipole moment; the quadrupole moment does cause some small shifts in the hyperfine structure as well. All nuclei that have nonzero spin also possess a nonzero magnetic moment and vice versa, although the connection between the two quantities is not straightforward or easy to calculate.
The nuclear magnetic moment varies from isotope to isotope of an element. For a nucleus of which the numbers of protons and of neutrons are both even in its ground state (i.e. lowest energy state), the nuclear spin and magnetic moment are both always zero. In cases with odd numbers of either or both protons and neutrons, the nucleus often has nonzero spin and magnetic moment. The nuclear magnetic moment is not sum of nucleon magnetic moments, this property being assigned to the tensorial character of the nuclear force, such as in the case of the most simple nucleus where both proton and neutron appear, namely deuterium nucleus, deuteron.
The methods for measuring nuclear magnetic moments can be divided into two broad groups in regard to the interaction with internal or external applied fields. Generally the methods based on external fields are more accurate.
According to the shell model, protons or neutrons tend to form pairs of opposite total angular momentum. Therefore, the magnetic moment of a nucleus with even numbers of each protons and neutrons is zero, while that of a nucleus with an odd number of protons and even number of neutrons (or vice versa) will have to be that of the remaining unpaired nucleon. For a nucleus with odd numbers of each protons and neutrons, the total magnetic moment will be some combination of the magnetic moments of both of the "last", unpaired proton and neutron.