A magnetic laboratory test facility must usually be shielded because external magnetic fields, such as the earth's magnetic field and magnetic noise, influence measurements. In a laboratory without magnetic shielding by ferromagnetic materials, a compensation system for the external magnetic field is necessary so that a magnetic field of less than 10 6 nT can be measured with high accuracy. In this paper, a compensation system for the external magnetic field is proposed, which is able to automatically remove only the components of the external magnetic field by the generation of a constant magnetic field. It is shown that a stable magnetic field without any influence of external magnetic fields can be generated by using a magnetic field generator with compensation for the external magnetic field.