Trimming coil for a nuclear magnetic resonance imaging device, which is independent of the influences of the magnetic fields generated by a gradient coil and varying with time. The trimming coil comprises a primary coil (L1) for generating a special magnetic field corresponding to the supplied direct current and a compensator coil (L2) for generating a compensator magnetic field which cancels a magnetic field generated by the primary coil (L1) as a function of a current induced as a result of the time-varying gradient fields. <IMAGE>