A magnetic field sensor for determining the strength and/or direction of a component of an ambient magnetic field. It comprises electrical circuitry which incorporates a magnetic sensing element, a voltmeter connected in the circuitry to provide a measure of the voltage across the magnetic sensing element, an electrical energy supply connector connected to the magnetic sensing element to supply an electrical current which passes through that element when the sensor is in use, and switches to reverse the direction of the flow of electrical current through the magnetic sensing element between successive measurements of the said voltage by the said voltmeter. The magnetic sensing element comprises a coil surrounding magnetic material. The electrical energy source connector and the said switches are connected to the said coil. The voltmeter is connected to measure the voltage across the said coil. The circuitry further comprises a timer connected within the circuitry to cause the voltmeter to provide measurements V1 and V2 respectively at times T1 and T2 which occur after successive operations of the switches respectively at times T0 and T5, to initiate the passage of electrical current through the coil in respective opposite directions, such that T1 - T0 = T2 - T5 = ΔΤ, where ΔΤ is a predetermined period of time. A processor is connected in the circuitry to provide an indication of the value of V1-V2, the magnitude of which provides an indication of the strength of the said component, and the sign of which provides an indication of the direction of the said component. Also, a method of determining the strength and/or direction of a component of an ambient magnetic field using such a sensor.