The application discloses an electronic device with a scanning function, comprising: a device host, a scanning component, a display screen is arranged on the device host, the scanning component is movably connected to the device host, the scanning component is configured to have a first state and a second state relative to the device host, when in the first state, the scanning component is located on the side of the device host which is away from the display screen, when in the second state, the scanning component at least partially extends relative to the device host to be suitable for scanning. The electronic device of the application expands the use scene of the electronic device while taking into account the normal scanning function of the electronic device, so that the scanning component can be hidden when scanning is not needed, and the display screen on the device host can be operated according to actual needs, for example, video watching, webpage operation and the like, which is beneficial to improving the use experience of users.