A scheme for detecting magnetic field gradients via a double-well two-component Bose–Einstein condensate interferometer. The magnetic field gradient can be extracted by either the spin population or the external state. Our proposal is potentially sensitive to weak magnetic field inhomogeneity due to its small sensor size.