The invention discloses a square pipeline welding gear gripper comprising a manipulator, gripper main bodies and a sliding structure. Each gripper main body comprises size regulating structures, a right clamping arm, an actuator, a left clamping plate, a right clamping plate, gears, a rotating shaft, a link rod I, a link rod II, connecting pins, a left clamping arm and U-shaped connectors; the sliding structure comprises a guide rail, a fixed sliding block and a movable sliding block; the gripper main bodies are arranged in pairs and can be slid on the sliding structure, and the upper ends ofthe right clamping arm and the left clamping arm are provided with the size regulating structures; the ends of the clamping arms are both connected to one end of the link rod I, and the middle parts of the clamping arms are both connected to one end of the link rod II; the gears are arranged between the left clamping plate and the right clamping plate, and one end of the rotating shaft is connected to the actuator; and the gripper main body on one side is connected to the fixed sliding block through the U-shaped connectors, and the gripper main body on the other side is connected to the movable sliding block of which the bottom end is slid on the guide rail. The square pipeline welding gear gripper is applicable for the clamping requirements of square pipelines of different sizes, and is higher in degree of freedom and high in stability.