In 1971, John O'Keefe discovered hippocampal neurons that fire only when an animal occupies a specific location — place cells. The mechanism behind these precise maps remained mysterious until 2005, when Edvard and May-Britt Moser found grid cells in the medial entorhinal cortex: neurons whose activity tiles the environment in perfect hexagonal lattices. This article walks through each step of the grid-to-place transformation — spacing, orientation, phase, modules, path integration, and remapping — with live, adjustable simulations at each stage.
How does the brain know where you are? This deceptively simple question occupied neuroscientists for decades after O'Keefe and Dostrovsky[1] first recorded hippocampal neurons that fired selectively for location in 1971. The answer arrived in 2005 when Hafting, Fyhn, Molden and the Mosers[2] discovered a strikingly geometric class of neuron upstream, in the medial entorhinal cortex (MEC): the grid cell.
Together, grid cells and place cells form the mammalian brain's navigational system — a biological GPS that works without satellites, using only self-motion signals and sensory landmarks. Both discoverers shared the 2014 Nobel Prize in Physiology or Medicine.
The spatial navigation circuit involves several cooperating cell types:
Each CA1 and CA3 hippocampal place cell fires vigorously only when the animal occupies a specific region of the environment called its place field. Outside this region the cell is largely silent. Most place cells have a single place field per environment, with peak firing rates of 20–100 Hz, falling off as a Gaussian function of distance from the field centre.
A key property is remapping: move the animal to an entirely different room and each place cell either falls silent or acquires a completely new, seemingly random field location. Two environments thus receive statistically independent population codes — a mechanism for storing distinct spatial memories.
Move the cursor over the arena to probe the firing rate. Adjust field width and peak rate with the sliders.
Figure 1. Schematic of a hippocampal place cell's spatial firing rate (warmer colours = higher rate). The cell fires at a maximum of ~80 Hz at the centre of its place field and is silent elsewhere. Drag the sliders to explore how field width and peak rate vary across the place cell population.
A grid cell fires at every vertex of a perfect equilateral triangular lattice tiling the environment[2]. The pattern repeats indefinitely — if the environment were large enough, you would see the same array of firing fields extending to the horizon. Three parameters fully specify a grid cell's pattern:
Mathematically the firing-rate map of a grid cell can be written as a sum of three cosine waves at 60° offsets:
Adjust spacing, orientation, and phase to see how each parameter deforms the hexagonal lattice.
Figure 2. Spatial firing rate map of a single grid cell (brighter = higher firing rate). Blue dots mark the lattice vertices (firing-field centres). Changing spacing stretches or compresses the grid; orientation rotates it; phase translates it without changing its shape.
Crucially, all grid cells in a local cortical column share the same spacing and orientation but have different phases — they tile the same environment with the same lattice, but offset from one another. This is exactly what is needed to encode position: together the active phases specify a unique 2-D location.
Grid cells are not a monolithic population. Stensola et al. (2012)[4] showed that they cluster into discrete modules along the dorsoventral axis of the MEC. Within a module, all cells share the same spacing and orientation; across modules, both can differ. The spacing ratio between adjacent modules is approximately √2 ≈ 1.42.
This creates a nested hierarchy of rulers, analogous to a Vernier scale. A fine grid provides precision over short distances; coarser grids extend the unambiguous range. When module spacings are co-prime, the population code can uniquely identify positions over a distance equal to the product of the spacings — an exponential gain from a polynomial number of cells, directly analogous to the Chinese Remainder Theorem.
Left: three overlaid modules at different scales. Right: their combined activity — a far richer spatial signal.
Figure 3. Three grid modules with increasing spacings (approximately in a √2 ratio). The combined map (right) contains unique location information that no single module provides alone — the spatial resolution of the fine grid with the large range of the coarse grid.
One of the most remarkable properties of grid cells is that they maintain their hexagonal firing patterns in complete darkness, with no visual landmarks. They track position purely from self-motion cues — the velocity and heading of the animal — integrating these signals step by step. This is called path integration, or dead reckoning: the same technique sailors used before GPS.
The underlying circuit mechanism is a continuous attractor network[7]. Neurons are connected in a topological torus. A localised "bump" of activity on this torus encodes current position. Head-direction and speed signals from other regions shift the bump as the animal moves, keeping the grid pattern aligned with the animal's actual location.
Path integration inevitably accumulates errors, analogous to drift in a ship's compass. Environmental landmarks and sensory feedback periodically recalibrate the grid, keeping it anchored to the true position[9].
A simulated rat explores the arena. Grid-cell spikes (blue flashes) accumulate at the hexagonal lattice vertices.
Figure 4. The rat's path (white trail) samples the environment. Each time the rat crosses a vertex of the underlying hexagonal grid, the grid cell fires (blue flash). Over time, the firing pattern reveals the hidden lattice structure — built entirely from integrating self-motion signals.
How does the brain go from a repeating hexagonal code to a single, localised place field? The key insight of Solstad, Moser and Einevoll (2006)[3] is that a hippocampal neuron receiving convergent input from many grid cells at different scales automatically produces a single place field, with no additional machinery required.
The mechanism works in two steps. First, the periodic inputs sum linearly. Because they have different spacings and orientations, their peaks align only at a single location within any realistic environment — everywhere else the peaks destructively interfere. Second, a threshold nonlinearity in the hippocampal neuron amplifies the single coincident peak while suppressing the rest.
Left: summed grid inputs. Right: the resulting place field after thresholding. Add more grid inputs to watch the place field sharpen.
Figure 5. Left panel shows the sum of N grid-cell inputs with different spacings and phases. Right panel shows the place-cell output after applying a rectifying threshold. With a single grid (N=1) the repeating pattern is visible everywhere; as N increases, peaks cancel except at one location — a place field crystallises.
Different hippocampal neurons receive inputs from grid cells with different phase combinations. Each combination selects a different location as the coincidence peak. The full population of place cells therefore tiles the environment, with each neuron representing a distinct patch. The place map is, in this view, the decoded output of the grid-cell population code.
When an animal enters a new environment, grid cells shift their phase while largely preserving their spacing and orientation[5]. Even a small phase shift propagates through the summation mechanism to produce a completely different coincidence pattern in the hippocampus — a wholly new set of place fields. This is complete remapping: no spatial relationship between fields in environment A predicts fields in environment B.
Monaco and Abbott (2011)[5] showed computationally that inter-module phase shifts are the primary driver of remapping, far more powerful than changes in orientation or scale. The grid system therefore provides an effectively unlimited memory capacity: each new phase configuration encodes a distinct environment.
Grid spacing is unchanged; only the inter-module phase shifts. Place fields reorganise completely.
Figure 6. Each colour represents one place cell. In Environment A (left) cells have fixed fields; in Environment B (right) the grid-module phase shifts, and each cell's field moves to a completely new, unpredictable location. Increasing the phase shift amplifies remapping; setting it to zero collapses both maps to the same pattern.
Grid cells are concentrated in layer II of the medial entorhinal cortex (MEC), which projects directly to the hippocampus via the perforant path. Spacing increases systematically from the dorsal to the ventral pole of the MEC, mirroring a parallel increase in hippocampal place-field size along the dorsoventral hippocampal axis.
Figure 7. Schematic of the entorhinal–hippocampal projection. Grid cells in MEC layer II project via the perforant path to hippocampal CA1 and CA3. The dorsoventral gradient in grid spacing (left) mirrors the gradient in place-field size (right).
If grid cells were merely a specialised navigation module, they would be a curiosity. But accumulating evidence suggests the grid code is a general-purpose representational format. Doeller, Barry and Burgess (2010)[6] showed using fMRI that the human entorhinal cortex exhibits the characteristic 6-fold rotational symmetry of a grid code during virtual navigation — the first evidence in humans.
More striking still: subsequent studies found the same 6-fold signal when people navigated abstract conceptual spaces — for instance, a 2-D space defined by the neck and leg lengths of birds, or a space of social dominance relationships. The grid signature appeared whenever subjects needed to compare entities along continuous dimensions.
Dong and Fiete's 2024 review[8] synthesises this literature, arguing that grid cells implement compressed sensing: a small population can uniquely represent a vast number of positions by exploiting the modular, multi-scale structure. This compressive property applies to any high-dimensional structured space — making the grid code a candidate for a universal cognitive map that underpins reasoning, memory and imagination well beyond spatial navigation.