The invention relates to an encoder, also named speed and displacement sensor, in particular to an ultra-thin encoder of a permanent magnet servo high-speed motor. The ultra-thin encoder comprises a shell, a rubber-formed wire protecting bushing, a circuit board provided with electric elements, a movable raster, a fixed raster, a movable raster base, a first bearing, a light emitting diode, a main support, a second bearing, a hollow shaft and a blade spring. The ultra-thin encoder of the permanent magnet servo high-speed motor is characterized in that the ultra-thin encoder further comprises a light emitting diode sleeve, the light emitting diode is sleeved with the light emitting diode sleeve, and the light emitting diode sleeve is arranged on the main support. Due to the fact that the light emitting diode of the encoder is installed in an embedded mode, space is saved, production positioning accuracy is improved, and the problem that in the prior art, a light emitting diode is fixed by means of a circuit board, and fixation is unstable and unreliable is solved. The ultra-thin encoder of the permanent magnet servo high-speed motor is compact, small in occupied space, simple, reasonable, and convenient and fast to assembly and adjust. Compared with existing encoders, the ultra-thin encoder of the permanent magnet servo high-speed motor is lighter, thinner and lower in cost. The installation space is small, and requirements of the modern industry for smaller size and more powerful function are met.