The invention relates to an automatic focusing electronic eyepiece and a system. Including: lens, Sensor board, main control unit, interface unit, the lens receives the image of the measured target once formed by the front-end optical system, which includes the focusing lens group, focusing motor and lens group position detection unit, the Sensor board realizes photoelectric conversion, and the The optical signal through the lens is converted into an image signal and then output to the main control unit; the main control unit outputs a control signal to control the focus motor to drive the movement of the focus lens group, and integrates the focus lens group and the corresponding control circuit into the electronic Inside the eyepiece, the main control unit inside the electronic eyepiece executes the focus search algorithm, controls the movement of the focusing lens group, and realizes automatic focusing by adjusting the image distance. Through the present invention, automatic focusing can be realized without moving or changing the front-end optical system (including not limited to microscopes, telescopes, etc.), improving focusing efficiency and shortening focusing time.