The invention relates to a twisting machine for processing a square profile. The twisting machine comprises a processing table, wherein a plurality of supporting legs are fixedly connected to the bottom of the processing table, a bracket is fixedly connected to the top of the processing table, a limiting pipe is fixedly connected to the top end of the bracket, a first motor is mounted on one sideof the bracket, a driving gear is fixedly connected to the tail end of an output shaft of the first motor, a transmission shaft is inserted into the limiting pipe, one end of the transmission shaft isfixedly connected to a transmission gear engaged to the driving gear, a clamping rack is fixedly connected to the other end of the transmission shaft, two limiting blocks are fixedly connected to a shaft body of the transmission shaft, the two limiting blocks are located at two ends of the limiting pipe, a slide rail is mounted on the processing table, a movable table is arranged on the slide rail in a sleeving manner, a supporting rod is fixedly connected to the top of the movable table, the top end of the supporting rod is fixedly connected to a fixed table, a limiting groove is formed in the fixed table, a fixed rack is fixedly connected to the top and bottom of the fixed table, an air cylinder is mounted on the fixed rack, and a pressing plate is fixedly connected to the tail end of an output shaft of the air cylinder.