Using long-term brain recordings in patients with chronic pain, we identified objective biomarkers of real-world subjective pain intensity over many months. Spontaneous chronic pain states were predicted most reliably by sustained changes in the activity of the orbitofrontal cortex, whereas acute pain was most associated with signals from the anterior cingulate cortex.