The present invention relates to a displacement sensor for contactlessly measuring a position of a magnet relative to a reference point. The displacement sensor comprises the magnet which can be displaced along a movement axis, a plurality of magnetic field sensors which are arranged in series and which are arranged parallel with the movement axis of the magnet and a calculation unit for forming a position signal which indicates the position of the magnet relative to the reference point. The plurality of magnetic field sensors which are arranged in series are arranged in such a manner that the displacement measurement ranges of adjacent magnetic field sensors overlap in an overlap range. The calculation unit is constructed in such a manner that, if the position of the magnet is contained in an overlap range, it forms the position signal on the basis of output signals which are output by the magnetic field sensors whose displacement measurement ranges overlap in the overlap range; and, if the position of the m