Abstract: An optical type encoder comprises a light source for supplying a light beam for illuminating a diffraction grating formed on a movable scale, photoelectric converting means for photoelectrically converting interference fringes formed by causing a plurality of diffracted lights created by the diffraction grating to interfere with one another to measure the displacement of the movable scale and outputting a predetermined signal, detecting means for receiving a predetermined diffracted light created by the diffraction grating and detecting any fluctuation of the intensity thereof, and control means for modulating the intensity of the light beam illuminating the diffraction grating, on the basis of a signal from the detecting means, so that the amplitude of the output signal from the photoelectric converting means may become substantially constant.