Sand crabs use their multi-jointed legs to dig into sand. Combined movement and electromyogram (EMG) analyses showed that the pattern of intra-leg coordination in the legs of two sand crabs of different families (Blepharipoda occidentalis and Emerita analoga) is similar in legs 2 and 3, but very different in leg 4. For example, the sequence of proximal joint movements in legs 2 and 3 is elevation, retraction, depression and protraction (similar to backward walking in most decapods), but the sequence of proximal joint movements in leg 4 is elevation, protraction, retraction and depression (similar to forward walking). The synergies are the same during leg movements in sea water and in sand, suggesting that the same motor programme is used in both situations. At the transition from sea water into sand, however, both the frequency and amplitude of the EMG potentials increase, and the phasing of the motor output to leg 2 (and presumably leg 3) changes from proportional (both power and return strokes co-vary with period) to return stroke constant (power strokes co-vary much more with period than do return strokes). The motor output to leg 4 remains intermediate between proportional and return stroke constant in sea water and in sand. On the basis of the segmental specialisation of the motor patterns for the legs, we hypothesize that sand crab digging may be an evolutionary mosaic of disparate ancestral locomotor behaviours.