The magnetometer is a key instrument to the Solar Orbiter mission. The magnetic field is a fundamental parameter in any plasma: a precise and accurate measurement of the field is essential for understanding almost all aspects of plasma dynamics such as shocks and stream-stream interactions. Many of Solar Orbiter's mission goals are focussed around the links between the Sun and space. A combination of in situ measurements by the magnetometer, remote measurements of solar magnetic fields and global modelling is required to determine this link and hence how the Sun affects interplanetary space. The magnetic field is typically one of the most precisely measured plasma parameters and is therefore the most commonly used measurement for studies of waves, turbulence and other small scale phenomena. It is also related to the coronal magnetic field which cannot be measured directly. Accurate knowledge of the magnetic field is essential for the calculation of fundamental plasma parameters such as the plasma beta, Alfven speed and gyroperiod. We describe here the objectives and context of magnetic field measurements on Solar Orbiter and an instrument that fulfils those objectives as defined by the scientific requirements for the mission.