A single-chip half-bridge or full-bridge magnetic field sensor, comprising: two or four magnetoresistive sensor arms, each of which includes one or more GMR or MTJ magnetoresistive sensing elements (41,42,43,44); each GMR or MTJ magnetoresistive sensing element (41,42,43,44) is configured as a spin- valve comprising a free layer and a pinned layer; characterised by: the pinned layer of each GMR or MTJ magnetoresistive sensing element has a parallel pinned layer magnetization direction set in the same direction; wherein an angle of a magnetization direction of the free layer of each GMR or MTJ magnetoresistive sensing element (41,42,43,44) is arranged such that in the absence of an applied magnetic field, all free layers have the same absolute value magnetization direction angle; and wherein, in said full-bridge, the polarities of magnetization directions of the free layers of the GMR or MTJ magnetoresistive sensing elements (41,42,43,44) with respect to the pinned layer magnetization direction of the GMR or MTJ magnetoresistive sensing elements located in the sensor arms diagonally across from each other are the same, but the magnetization directions of the free layers of adjacent GMR or MTJ magnetoresistive sensing elements in adjacent sensor arms have different polarities with respect to the pinned layer magnetization directions and wherein the adjacent GMR or MTJ magnetoresistive sensing elements are arranged so that when a magnetic field is applied to the magnetic field sensor the different polarities of the free layers of the adjacent GMR or MTJ magnetoresistive sensing elements are caused to move in opposite directions; or wherein, in said half-bridge, the polarities of the magnetization directions of the free layers of the adjacent magnetoresistive sensor arms are different with respect to the pinned layer magnetization direction and wherein the GMR or MTJ magnetoresistive sensing elements are arranged so that when a magnetic field is applied to the magnetic field sensor the different polarities of the free layers of the GMR or MTJ magnetoresistive sensing elements are caused to move in opposite directions. two or four magnetoresistive sensor arms, each of which includes one or more GMR or MTJ magnetoresistive sensing elements (41,42,43,44); each GMR or MTJ magnetoresistive sensing element (41,42,43,44) is configured as a spin- valve comprising a free layer and a pinned layer; the pinned layer of each GMR or MTJ magnetoresistive sensing element has a parallel pinned layer magnetization direction set in the same direction; wherein an angle of a magnetization direction of the free layer of each GMR or MTJ magnetoresistive sensing element (41,42,43,44) is arranged such that in the absence of an applied magnetic field, all free layers have the same absolute value magnetization direction angle; and wherein, in said full-bridge, the polarities of magnetization directions of the free layers of the GMR or MTJ magnetoresistive sensing elements (41,42,43,44) with respect to the pinned layer magnetization direction of the GMR or MTJ magnetoresistive sensing elements located in the sensor arms diagonally across from each other are the same, but the magnetization directions of the free layers of adjacent GMR or MTJ magnetoresistive sensing elements in adjacent sensor arms have different polarities with respect to the pinned layer magnetization directions and wherein the adjacent GMR or MTJ magnetoresistive sensing elements are arranged so that when a magnetic field is applied to the magnetic field sensor the different polarities of the free layers of the adjacent GMR or MTJ magnetoresistive sensing elements are caused to move in opposite directions; or wherein, in said half-bridge, the polarities of the magnetization directions of the free layers of the adjacent magnetoresistive sensor arms are different with respect to the pinned layer magnetization direction and wherein the GMR or MTJ magnetoresistive sensing elements are arranged so that when a magnetic field is applied to the magnetic field sensor the different polarities of the free layers of the GMR or MTJ magnetoresistive sensing elements are caused to move in opposite directions.