A magnetic encoder, comprising: a magnetic medium placed on a first member and a magnetic sensor placed on a second member, the first member and the second member for moving relative to each other in a predetermined axis direction, which is defined as the X axis direction, wherein the magnetic sensor includes a sensor substrate having a magneto-resistive element mounted thereon for detecting a magnetic field emanating from the magnetic medium, for reciprocatively sliding relative to the magnetic medium in the predetermined axis direction; a sensor holding plate (30, 30', 30") for holding the sensor substrate; and a wire for extracting a signal from the magneto-resistive element to outside, the sensor holding plate (30, 30', 30") includes a fixing portion for fixing the sensor holding plate (30, 30', 30") to the second member; a sensor holding member for holding the sensor substrate; and a plurality of arm portions provided apart from each other in the predetermined axis direction, with the sensor holding member in-between, and extending from the fixing portion so as to each constitute a cantilever, and the arm portion has a portion of which width becomes larger either continuously or stepwisely from a side of the sensor holding member toward the fixing portion; wherein the sensor holding member has a plurality of elastically deformable portions provided corresponding to the plurality of arm portions and each placed between each arm portion and a member for holding the sensor substrate; characterized in that in a crossover section of the arm potion, slits are formed in the both respective sides of a part connected to the elastically deformable portion so as to extend in the X axial direction. a magnetic medium placed on a first member and a magnetic sensor placed on a second member, the first member and the second member for moving relative to each other in a predetermined axis direction, which is defined as the X axis direction, wherein the magnetic sensor includes a sensor substrate having a magneto-resistive element mounted thereon for detecting a magnetic field emanating from the magnetic medium, for reciprocatively sliding relative to the magnetic medium in the predetermined axis direction; a sensor holding plate (30, 30', 30") for holding the sensor substrate; and a wire for extracting a signal from the magneto-resistive element to outside, the sensor holding plate (30, 30', 30") includes a fixing portion for fixing the sensor holding plate (30, 30', 30") to the second member; a sensor holding member for holding the sensor substrate; and a plurality of arm portions provided apart from each other in the predetermined axis direction, with the sensor holding member in-between, and extending from the fixing portion so as to each constitute a cantilever, and the arm portion has a portion of which width becomes larger either continuously or stepwisely from a side of the sensor holding member toward the fixing portion; wherein the sensor holding member has a plurality of elastically deformable portions provided corresponding to the plurality of arm portions and each placed between each arm portion and a member for holding the sensor substrate; characterized in that in a crossover section of the arm potion, slits are formed in the both respective sides of a part connected to the elastically deformable portion so as to extend in the X axial direction. a sensor substrate having a magneto-resistive element mounted thereon for detecting a magnetic field emanating from the magnetic medium, for reciprocatively sliding relative to the magnetic medium in the predetermined axis direction; a sensor holding plate (30, 30', 30") for holding the sensor substrate; and a wire for extracting a signal from the magneto-resistive element to outside, the sensor holding plate (30, 30', 30") includes a fixing portion for fixing the sensor holding plate (30, 30', 30") to the second member; a sensor holding member for holding the sensor substrate; and a plurality of arm portions provided apart from each other in the predetermined axis direction, with the sensor holding member in-between, and extending from the fixing portion so as to each constitute a cantilever, and a fixing portion for fixing the sensor holding plate (30, 30', 30") to the second member; a sensor holding member for holding the sensor substrate; and a plurality of arm portions provided apart from each other in the predetermined axis direction, with the sensor holding member in-between, and extending from the fixing portion so as to each constitute a cantilever, and the arm portion has a portion of which width becomes larger either continuously or stepwisely from a side of the sensor holding member toward the fixing portion; wherein the sensor holding member has a plurality of elastically deformable portions provided corresponding to the plurality of arm portions and each placed between each arm portion and a member for holding the sensor substrate; characterized in that in a crossover section of the arm potion, slits are formed in the both respective sides of a part connected to the elastically deformable portion so as to extend in the X axial direction.