The invention relates to the technical field of cartons, in particular to an automatic carton nailing and packing machine. The automatic carton nailing and packing machine comprises a device main body, the device main body comprises an installing table, supporting legs are fixedly installed on the two sides of the bottom end of the installing table, supporting frames are fixedly installed on the two sides of the top end of the installing table, an installing plate is fixedly installed at the top ends of the two supporting frames, a supporting plate is integrally installed at the bottom end of the installing plate, and pressing assemblies are fixedly installed on the sides, close to each other, of the supporting frames. According to the automatic carton nailing and packing machine, the pressing assemblies are arranged, a fixing rod drives a driving rod to do lifting movement when moving, so that pressing blocks do lifting movement, the two pressing blocks can press one side of a paperboard correspondingly, when the output end of a second driving motor rotates, the pressing blocks can press the paperboard repeatedly, manual paperboard pressing is avoided, and the problems that manual flattening consumes manpower, only one side of the paperboard can be flattened at a time, the production efficiency is low, and subsequent binding of the paperboard is unfavorably fast are solved.