An optical deflector comprises a control means for controlling at least either a light source or a deflection means adapted to gauge the distance between the position of a deflected beam of light moving on a light receiving element in one direction and the position of another deflected beam of light moving on the light receiving element in the opposite direction and control the distance so as to make it agree with a predetermined value. Thus, the optical deflector can very accurately control the operation of the deflection means in such a way that it is not affected by changes of environmental temperature of the deflection means and the detection circuit, because a detection means for detecting the time when a beam of light passes by a predetermined angle of deflection of the deflection means is not used.