The invention relates to an automatic stacking system which comprises a frame, a first horizontal moving mechanism, a second horizontal moving mechanism, a vertical moving mechanism, a mechanical arm, a main guide rail, at least two pallet platform components, a first transmission mechanism, a first communication module, a distance sensor and a control box. Each pallet platform component comprises a pallet platform, a lifting mechanism for controlling the pallet platform to move up and down and a translation mechanism, the pallet platform is fixedly connected with the translation mechanism through the lifting mechanism, the translation mechanism is bridged on the main guide rail, and the lifting mechanism and the translation mechanism are connected with the first transmission mechanism. The first communication module is electrically connected with the control box. By the automatic stacking system, motion displacement for stacking goods of the mechanical arm can be reduced, goods stacking efficiency can be increased, burden of a mechanical arm motor is relieved, service life of the mechanical arm motor and related parts is prolonged, and cost is lowered.