Method for calibrating a magnetometer including the following steps: - the magnetometer travels through (S1) a set of path positions, said positions being distinguished from each other by a location of the magnetometer and/or by an orientation of the magnetometer ; - acquisition (S2) by the magnetometer at acquisition times of a plurality of measurements of the magnetic field when the magnetometer travels through said set of path positions; - provision of trajectory information (S3) representative of the location and the orientation of a point integral with the magnetometer while travelling through the set of path positions at travel times, - for each of a plurality of determination times determined from the acquisition times and the travel times, matching up (S4) of the measurements of the magnetic field with the trajectory information, - determination (S5) of calibration parameters of the magnetometer by the minimisation of a cost function involving, for a plurality of determination times, at least said calibration parameters, a measurement of the magnetic field, and a relationship linking the change in a magnetic field with the change in the location and in the orientation of the magnetometer derived from the trajectory information, the relationship linking the change in a magnetic field with the change in the location and in the orientation of the magnetometer locally translating an equation of the particular derivative of the magnetic field: B → ̇ = ∇ B → . v → + Ω × B → with B a magnetic field vector, ∇ B a gradient vector of the magnetic field, B → ̇ a vector of the time derivative of the magnetic field, v a velocity vector representative of the modification of the location and Ω a rotation matrix representative of the modification of the orientation. - the magnetometer travels through (S1) a set of path positions, said positions being distinguished from each other by a location of the magnetometer and/or by an orientation of the magnetometer ; - acquisition (S2) by the magnetometer at acquisition times of a plurality of measurements of the magnetic field when the magnetometer travels through said set of path positions; - provision of trajectory information (S3) representative of the location and the orientation of a point integral with the magnetometer while travelling through the set of path positions at travel times, - for each of a plurality of determination times determined from the acquisition times and the travel times, matching up (S4) of the measurements of the magnetic field with the trajectory information, - determination (S5) of calibration parameters of the magnetometer by the minimisation of a cost function involving, for a plurality of determination times, at least said calibration parameters, a measurement of the magnetic field, and a relationship linking the change in a magnetic field with the change in the location and in the orientation of the magnetometer derived from the trajectory information, the relationship linking the change in a magnetic field with the change in the location and in the orientation of the magnetometer locally translating an equation of the particular derivative of the magnetic field: B → ̇ = ∇ B → . v → + Ω × B → with B a magnetic field vector, ∇ B a gradient vector of the magnetic field, B → ̇ a vector of the time derivative of the magnetic field, v a velocity vector representative of the modification of the location and Ω a rotation matrix representative of the modification of the orientation. <EOS>