An automatic battery replacement and fixing device on the top of a movable platform aims to design a device with high space utilization, install and fix the battery on the top of the mobile platform, and at the same time realize fast and reliable replacement of the battery. It is composed of mobile platform, slider, drive motor, drive gear, bar gear, photoelectric pair tube, support plate, battery bracket, gripper and battery. When the electric energy of the battery is about to be used up by the mobile platform, the mobile platform returns to the position of the battery replacement pile, eliminates battery constraints, and holds up the battery, making it easier for the mechanism of the battery replacement pile to grab the battery. After the mechanism of the battery replacement pile takes away the battery that needs to be charged and puts down the new battery again, each gripper forms a form of embracing the battery, so that the battery is fixed in an ideal position. It achieves a high space utilization rate, installs and fixes the battery on the top of the mobile platform, and realizes fast and reliable replacement of the battery at the same time, making the system work more reliable and stable.