An animal’s spatial coordinates are encoded by a range of interacting cell types with defined activity profiles. The two most striking firing patterns are perhaps those of the ‘place cells’, discovered in the hippocampus1, and the ‘grid cells’, discovered in the medial entorhinal cortex (Fig. 2)23. Grid cells have multiple firing fields that span the entire available space in a periodic hexagonal pattern, which provides a metric to the neural representation of space23. Grid cells are present throughout the medial entorhinal cortex and in the pre- and parasubiculum but are most abundant in layer 2 of medial entorhinal cortex24,25. Deeper layers often contain cells with stronger representation of some grid axes than others26, and grid cells are intermingled with head direction cells25. In addition, the medial entorhinal cortex contains a smaller number of ‘border cells’, which line up in specific orientations along specific geometric boundaries of the environment27. These cell types were all discovered in rats, but place cells, grid cells and head direction cells have since been found in other species28–30.