Both developmental and neurophysiological research suggest a common coding between perceived and generated actions. This shared representational network is innately wired in humans. We review psychological evidence concerning the imitative behaviour of newborn human infants. We suggest that the mechanisms involved in infant imitation provide the foundation for understanding that others are 'like me' and underlie the development of theory of mind and empathy for others. We also analyse functional neuroimaging studies that explore the neurophysiological substrate of imitation in adults. We marshal evidence that imitation recruits not only shared neural representations between the self and the other but also cortical regions in the parietal cortex that are crucial for distinguishing between the perspective of self and other. Imitation is doubly revealing: it is used by infants to learn about adults, and by scientists to understand the organization and functioning of the brain.