The hippocampal dentate gyrus is an important relay conveying sensory information from the entorhinal cortex to the hippocampus proper. During exploration, the dentate gyrus has been proposed to act as a pattern separator. However, the dentate gyrus also shows structured activity during immobility and sleep. The properties of these activity patterns at cellular resolution, and their role in hippocampal-dependent memory processes have remained unclear. Using dual-color in-vivo two-photon Ca2+ imaging, we show that in immobile mice dentate granule cells generate sparse, synchronized activity patterns associated with entorhinal cortex activation. These population events are structured and modified by changes in the environment; and they incorporate place- and speed cells. Importantly, they are more similar than expected by chance to population patterns evoked during self-motion. Using optogenetic inhibition, we show that granule cell activity is not only required during exploration, but also during immobility in order to form dentate gyrus-dependent spatial memories.