To provide a small optical encoder and an optical decoder in which code is variable.
This optical encoder 100 is provided with an optical circulator 110 and an optical component 120. The optical circulator 110 has a first port 111, a second port 112 and a third port 113, outputs light inputted to the first port 111 from the second port 112, and outputs light inputted to the second port 112 from the third port 113. The optical component 120 is connected to the second port 112 of the optical circulator 110 and includes an optical waveguide type diffraction grating element provided with a plurality of refractive index modulation formation areas for performing Bragg reflection of a guided wave of a particular wavelength along the longitudinal direction of an optical fiber. A prescribed area including a boundary position between two adjacent refractive index modulation formation areas in the optical waveguide type diffraction grating element 121 is heated by a thin film heater to adjust an optical path length.
SHIBATA TOSHIKAZU
INOUE SUSUMU