Magnetic linear or rotary encoder (1, 1') for monitoring the movement range of a movable body, wherein the magnetic linear or rotary encoder (1, 1') has the following: - an exciter unit (8, 8'), which maps the movement to be monitored, and which has at least two primary permanent magnets (16, 17; 43, 44, 45, 46), which are arranged diametrically opposing relative to each other, which are each arranged with one of their poles at a ferromagnetic back iron body (9, 9') and are magnetically connected to each other via the same, and which form between their free, inwardly directed, unlike poles a measurement field space that connects them; - a fine resolution sensor unit, which is arranged fixedly and is for determining a fine position value; and - a processing electronics, which has a data storage and evaluates the signals of the fine resolution sensor unit; characterized in that - a ferromagnetic deflecting body (18, 18') is provided, which moves together with the exciter unit (8, 8'), which deflects at least a part of the magnetic field lines of the magnetic field generated by the primary permanent magnets (16, 17; 43, 44, 45, 46) in a direction that is perpendicular to the magnetization vector of the primary permanent magnets (16, 17; 43, 44, 45, 46), - the fine resolution sensor unit has more than two magnetic field sensors (25, 26, 27, 28), which are arranged such that they are penetrated by the magnetic field lines that are deflected by the deflecting body (18, 18') with a perpendicular component, - at least the back iron body (9, 9') consists of a thermally treated, ferromagnetic material, and - the fine resolution sensor unit contains no ferromagnetic component parts. - an exciter unit (8, 8'), which maps the movement to be monitored, and which has at least two primary permanent magnets (16, 17; 43, 44, 45, 46), which are arranged diametrically opposing relative to each other, which are each arranged with one of their poles at a ferromagnetic back iron body (9, 9') and are magnetically connected to each other via the same, and which form between their free, inwardly directed, unlike poles a measurement field space that connects them; - a fine resolution sensor unit, which is arranged fixedly and is for determining a fine position value; and - a processing electronics, which has a data storage and evaluates the signals of the fine resolution sensor unit; characterized in that - a ferromagnetic deflecting body (18, 18') is provided, which moves together with the exciter unit (8, 8'), which deflects at least a part of the magnetic field lines of the magnetic field generated by the primary permanent magnets (16, 17; 43, 44, 45, 46) in a direction that is perpendicular to the magnetization vector of the primary permanent magnets (16, 17; 43, 44, 45, 46), - the fine resolution sensor unit has more than two magnetic field sensors (25, 26, 27, 28), which are arranged such that they are penetrated by the magnetic field lines that are deflected by the deflecting body (18, 18') with a perpendicular component, - at least the back iron body (9, 9') consists of a thermally treated, ferromagnetic material, and - the fine resolution sensor unit contains no ferromagnetic component parts.