A magnetoresistive Z-axis gradient sensor chip for detecting the gradient in the XY plane of a component of a Z-axis magnetic field generated by a magnetic medium, wherein the magnetoresistive Z-axis gradient sensor chip comprises: a Si substrate, magnetoresistive sensor units located on the Si substrate that have the same sensing direction, and which are electrically interconnected into a full bridge gradiometer or half bridge gradiometer, and two groups of flux guide devices located on the Si substrate; wherein the magnetoresistive sensor units are located above or below the flux guide devices, and have a sensing direction parallel to the surface of the Si substrate, and the flux guide devices are configured to convert the component of the Z-axis magnetic field generated by the magnetic medium into a magnetic field with a component parallel with a sensing direction along the magnetoresistive sensing units; and each group of flux guide devices comprises at least one flux guide device, the two groups of flux guide devices are spaced apart by a distance Lg, and opposite bridge arms in the full bridge gradiometer or half bridge gradiometer are spaced apart by a distance Lg, wherein the flux guide devices are elongated, and have a major axis along a Y-axis direction and a minor axis along an X-axis direction, and a length Ly thereof is greater than a width Lx and a thickness Lz thereof, comprising two of the flux guide devices which are arranged into an array of two rows and one column, wherein the row direction thereof is the Y-axis direction, and the column direction is the X-axis direction, characterized in that the sensor is configured to detect the gradient and in that: (i) the magnetoresistive sensor units of the two bridge arms in the half bridge gradiometer are located at the same position on the same side of the opposite first or second sides of the Y-axis center line of the or each respective flux guide device; or (ii) each half bridge in the full bridge gradiometer corresponds to a respective group of flux guide devices, in each half bridge, the magnetoresistive sensor units of the two bridge arms are symmetrically distributed on opposite first and second sides of the Y-axis center line of the or each respective at least one flux guide device, two bridge arms connected to a common power supply electrode (Vbias) are located at the same first or second sides of the Y-axis center line of their respective at least one flux guide device; or (iii) in each half bridge of the full bridge gradiometer, the magnetoresistive sensor units of the two bridge arms are located at the same position on the same side of the opposite first or second sides of the Y-axis center lines of the or each respective at least one flux guide device, and two bridge arms connected to a common power supply electrode (Vbias) correspond to the same flux guide device and are symmetrically distributed on the opposite first and second sides of the Y-axis center line of their respective at least one flux guide device. a Si substrate, magnetoresistive sensor units located on the Si substrate that have the same sensing direction, and which are electrically interconnected into a full bridge gradiometer or half bridge gradiometer, and two groups of flux guide devices located on the Si substrate; (i) the magnetoresistive sensor units of the two bridge arms in the half bridge gradiometer are located at the same position on the same side of the opposite first or second sides of the Y-axis center line of the or each respective flux guide device; or (ii) each half bridge in the full bridge gradiometer corresponds to a respective group of flux guide devices, in each half bridge, the magnetoresistive sensor units of the two bridge arms are symmetrically distributed on opposite first and second sides of the Y-axis center line of the or each respective at least one flux guide device, two bridge arms connected to a common power supply electrode (Vbias) are located at the same first or second sides of the Y-axis center line of their respective at least one flux guide device; or (iii) in each half bridge of the full bridge gradiometer, the magnetoresistive sensor units of the two bridge arms are located at the same position on the same side of the opposite first or second sides of the Y-axis center lines of the or each respective at least one flux guide device, and two bridge arms connected to a common power supply electrode (Vbias) correspond to the same flux guide device and are symmetrically distributed on the opposite first and second sides of the Y-axis center line of their respective at least one flux guide device.