Over the past four decades, research has revealed that cells in the hippocampal formation provide an exquisitely detailed representation of an animal's current location and heading. These findings have provided the foundations for a growing understanding of the mechanisms of spatial cognition in mammals, including humans. We describe the key properties of the major categories of spatial cells: place cells, head direction cells, grid cells and boundary cells, each of which has a characteristic firing pattern that encodes spatial parameters relating to the animal's current position and orientation. These properties also include the theta oscillation, which appears to play a functional role in the representation and processing of spatial information. Reviewing recent work, we identify some themes of current research and introduce approaches to computational modelling that have helped to bridge the different levels of description at which these mechanisms have been investigated. These range from the level of molecular biology and genetics to the behaviour and brain activity of entire organisms. We argue that the neuroscience of spatial cognition is emerging as an exceptionally integrative field which provides an ideal test-bed for theories linking neural coding, learning, memory and cognition.