PURPOSE: To obtain an optical encoder which can detect the rotating angle of a high-speed rotary body without restriction on the side of a light receiving unit.
CONSTITUTION: An optical encoder has a rotary code plate 20, a light projecting unit 20 and a light receiving unit 40. In the rotary code plate 20, a plurality of ring tracks having the codes comprising light transmitting parts A and light screening parts B are formed. The light projecting unit 20 is arranged so as to face the rotary code plate and projects light on the environment tracks. The light receiving unit 40 has photodetectors 41-44 which receive the light transmitted through the light transmitting part of each ring track through slits 31-34 and convert the light into the electric signal. The codes of the ring tracks 1-4 are the same and are deviated by specified angles.