A multi-turn absolute magnetic encoder, comprising (M+1) counting units, a single-turn signal processing unit, and a multi-turn signal processing unit. Each counting unit comprises counting wheels with a cylindrical ring permanent magnet fixed thereon, and a tunneling magnetoresistive angular displacement sensor. The magnetoresistive angular displacement sensor is located within a region in a detection plane of the permanent magnet at within a specific radius range from the axis of the cylindrical ring permanent magnet, within the detection plane the angle of a component of a magnetic field generated by the permanent magnet is linearly proportional to the rotation angle of the cylindrical ring permanent magnet. The single-turn signal processing unit calculates and outputs a code characterizing the absolute angular position of the input shaft based on the sensor signal of the first counting unit; and the multi-turn signal processing unit calculates and outputs the integer number of turns of the input shaft based on the sensor signals of the second counting unit to (M+1) counting units.