The invention provides a reconfigurable device for a walking robot with four/two parallel legs, belonging to the technical field of robots. The leg mechanism of the robot is structurally designed in a modularization way, and the legs are of a same structure. When four-leg walking is carried out, the leg mechanism is a 3-UPU, and when two-leg walking is carried out, the leg mechanism is a 3-SPU (Synergistic Processing Unit), wherein the conversion between the two leg mechanisms is realized through a rotation-pair retaining device, and the conversion between four legs and two legs is realized through a merging device. The rotation-pair retaining device comprises an electromagnet, an electromagnetic chuck base, friction plates, a friction plate carrier, a support column, a spring and a rotation-pair retaining plate, a rotation pair in a pair S is controlled to be locked and unlocked through the lamination and the separation of the friction plates, and the lamination and the separation of the friction plates are controlled by the sucker type electromagnet. The merging device comprises an electromagnetic chuck, a guiding device, a push-pull type electromagnet and a locking clamp, and the merging device is locked by controlling the positions of two legs to be merged, merging the soles through the electromagnetic chuck and the guiding device, and driving the locking clamp to act by the push-pull type electromagnet.