Sensory systems have evolved to solve computational challenges that animals face during behaviour in their natural environments. To illuminate how sensory cortex operates under such conditions, we investigated the function of neurons in whisker-related Somatosensory Cortex (wS1) of freely moving mice, engaged in tactile exploratory behaviour. By recording neural activity from wS1 whilst tracking the mouse body in 3D, we found that wS1 neurons are substantially modulated by body state (configuration of individual body-parts and their derivatives), even in the absence of whisker afferent input. Most neurons were modulated by multiple dimensions of body state, with the most prominently encoded being the angle of the head to the body and locomotion speed. Overall, our data suggest that sensory cortex functions as an embodied representation, which integrates signals from its associated sense organ within a body schema.