The magnetic moment of the ship is measured to control its protection from magnetic mines and to control the stealth by the magnetic field. A modification of the measurement method using a three-component differential magnetometer is considered. Using computer simulation, the errors of the new method are compared with those of the known analogues and its advantage in accuracy is established (almost by an order of magnitude). It is shown that the new method can also be used for magnetic models of ships and standard samples of magnetic materials to determine their components of the hysteresis loops by magnetization.