The invention relates to a zigzag sewing machine, which has a lower pipe base, a lower shaft, a transmission mechanism and a rotary hook. The lower shaft is connected to the transmission mechanism and rotates inside the lower pipe base with the X axis The transmission mechanism drives the outer kettle of the rotary hook to rotate around the Y-axis direction. The transmission mechanism has a rotary hook seat, bearings and transmission parts. The piercing part inside the outer kettle, and the accommodation space is formed between the piercing part and the outer kettle, and the bearing is located in the accommodation space. In addition, the transmission part is connected to the outside of the outer kettle, so that the transmission part, the bearing and the piercing part They are arranged sequentially from the outside to the outside of the inner and outer kettles towards the inside of the outer kettle, so that the assembly state of the hook seat, bearings, outer kettle and transmission parts can make the volume of the end of the lower tube seat shrink along the Y direction, and then The zigzag sewing machine can be used to sew the hemming of the shoe mouth for shoes with a small size.