Wakefulness is driven by the widespread release of neuromodulators by the ascending arousal system. Yet, it is unclear how these substances orchestrate state-dependent, global changes in neuronal activity. Here we show that neuromodulators induce increases in the extracellular K+ concentration ([K+]e) in cortical slices electrically silenced by tetrodotoxin. In vivo, arousal was linked to AMPA receptor-independent elevations of [K+]e concomitant with decreases in [Ca2+]e, [Mg2+]e, [H+]e, and the extracellular volume. Opposite, natural sleep and anesthesia reduced [K+]e, while increasing [Ca2+]e, [Mg2+]e, [H+]e, as well as the extracellular volume. Local cortical activity of sleeping mice could be readily converted to the stereotypical EEG pattern of wakefulness by simply imposing a change in the extracellular ion composition. Thus, extracellular ions control the state-dependent patterns of neural activity.