An electronic device is connectable to an external device. An interface substrate is detachably connected to a main substrate. A first interface is installed on the interface substrate, and the first interface is connectable to the external device. A second interface is installed on the main substrate, and the second interface is connectable to the external device. A selection unit selects one interface of the first interface on the interface substrate and the second interface on the main substrate. A communication unit communicates information with the external device through the interface selected by the selection unit. At least one of the first interface and the second interface is configured to detect a connection state to the external device. The selection unit selects an interface which is designated or preferentially selects an interface which detects a connection to the external device.