The gearbox with the cooling function comprises a lower shell, an upper shell, a lubricating mechanism and a cooling mechanism, a large gear is installed on one side of the interior of the lower shell, a small gear is installed on the other side of the interior of the lower shell, a heat dissipation mechanism is installed on the lower shell, the upper shell is arranged at the upper end of the lower shell, and the cooling mechanism is arranged on the upper end of the lower shell. The lubricating mechanism is installed on the upper shell, the cooling mechanism is installed on the upper shell, the gearbox with the cooling function is provided with the cooling mechanism, the cooling mechanism comprises a protective cover, a heat exchange pipe, a water inlet, a water storage tank, a water inlet, a water outlet, a cooling tank, a water pump, a connecting pipe and a condenser, and the cooling mechanism is connected with the water pump through the water pump. Liquid in the water storage tank enters the heat exchange pipe through the water inlet, heat on the shell is brought out when the liquid flows, the shell is cooled, then the liquid enters the cooling tank through the water outlet to be cooled, meanwhile, the liquid enters the water storage tank again to be recycled after being treated by the condenser, and the practicability of the device is improved advantageously.