A magnetic field sensor in the form of a magnetic switch (200; 800), comprising: first, second, and third magnetic field sensing elements (202, 204, 206; 802, 804, 808) having respective first, second and third maximum response axes, the first second and third maximum response axes pointing along respective first, second, and third different coordinate axes, wherein, in response to a magnetic field, the first, second, and third magnetic field sensing elements are operable to generate first second, and third magnetic field signals; and an electronic circuit coupled to receive the first, second, and third magnetic field signals, wherein the electronic circuit comprises: a threshold generator configured to generate first, second, and third operating point thresholds; and characterised by one or more comparators (436, 438) configured to compare signals corresponding to the first, second, and third magnetic field signals with the first, second, and third operating point thresholds, respectively, and to generate a respective one or more comparator output signals, wherein a respective one or more of the one or more comparator output signals changes state to a first state if a respective one or more of the signals related to the first, second, and third magnetic field signals has a magnitude above a respective one of the first, second, and third operating point thresholds. first, second, and third magnetic field sensing elements (202, 204, 206; 802, 804, 808) having respective first, second and third maximum response axes, the first second and third maximum response axes pointing along respective first, second, and third different coordinate axes, wherein, in response to a magnetic field, the first, second, and third magnetic field sensing elements are operable to generate first second, and third magnetic field signals; and an electronic circuit coupled to receive the first, second, and third magnetic field signals, wherein the electronic circuit comprises: a threshold generator configured to generate first, second, and third operating point thresholds; and characterised by one or more comparators (436, 438) configured to compare signals corresponding to the first, second, and third magnetic field signals with the first, second, and third operating point thresholds, respectively, and to generate a respective one or more comparator output signals, wherein a respective one or more of the one or more comparator output signals changes state to a first state if a respective one or more of the signals related to the first, second, and third magnetic field signals has a magnitude above a respective one of the first, second, and third operating point thresholds. a threshold generator configured to generate first, second, and third operating point thresholds; and characterised by one or more comparators (436, 438) configured to compare signals corresponding to the first, second, and third magnetic field signals with the first, second, and third operating point thresholds, respectively, and to generate a respective one or more comparator output signals, wherein a respective one or more of the one or more comparator output signals changes state to a first state if a respective one or more of the signals related to the first, second, and third magnetic field signals has a magnitude above a respective one of the first, second, and third operating point thresholds.