A central question in neuroscience is how cognition and consciousness arise from human brain activity. Here, we decompose cortical dynamics of resting-state functional MRI into their constituent elements: the harmonics of the human connectome. Mapping a wide spectrum of consciousness onto these elementary brain states reveals a generalisable connectome harmonic signature of loss of consciousness, whether due to anaesthesia or severe brain injury. Remarkably, its mirror-reversed image corresponds to the harmonic signature of the psychedelic state induced by ketamine or LSD, identifying meaningful relationships between neurobiology, brain function, and conscious experience. The repertoire of connectome harmonics further provides a fine-tuned indicator of level of consciousness, sensitive to differences in anaesthetic dose and clinically relevant sub-categories of patients with disorders of consciousness. Overall, we reveal that the emergence of consciousness from human brain dynamics follows the same universal principles shared by a multitude of physical and biological phenomena: the mathematics of harmonic modes.