The invention relates to a device and a method for correction of the position (x) of a field sensor (4) measured by means of a magnetic localization device. External field distortions, such as caused for example by the rotating components (1a, 1b) of a computer tomograph (1), are then determined with the help of reference sensor (3) placed at a known position. It is possible to deduce, for example, the current angle of rotation (Phi) of the computer tomograph (1) from the measurement signals of the reference sensor (3). Based on an empirically determined correction (delta(x, Phi)), the uncorrected determined positions (x) of the field sensor (4) can then be converted to corrected positions (x) in relation to the field distortions. The field generator (2) and the reference sensor (3) are preferably fastened to the gantry in order to eliminate the dependency of the field distortions on an inclination of the gantry.