Epstein-Barr virus (EBV) has long been suggested as a pathogen in multiple sclerosis (MS). Here, we used high-throughput sequencing to determine the diversity, compartmentalization, persistence and EBV-reactivity of the T-cell receptor repertoires in MS. T-cell receptor (TCR)β genes were sequenced in paired samples of cerebrospinal fluid (CSF) and blood from patients with MS and controls with other inflammatory neurological diseases. The TCR repertoires were highly diverse in both compartments and patient groups. Expanded T-cell clones, represented by TCRβ sequences >0.1%, were of different identity in CSF and blood of MS patients, and persisted for more than a year. Reference TCRβ libraries generated from peripheral blood T cells reactive against autologous EBV-transformed B cells were highly enriched for public EBV-specific sequences and were used to quantify EBV-reactive TCRβ sequences in CSF. TCRβ sequences of EBV-reactive CD8+ T cells, including several public EBV-specific sequences, were intrathecally enriched in MS patients only, whereas those of EBV-reactive CD4+ T cells were also enriched in CSF of controls. These data provide evidence for a clonally diverse, yet compartmentalized and persistent, intrathecal T-cell response in MS. The presented strategy links TCR sequence to intrathecal T-cell specificity, demonstrating enrichment of EBV-reactive CD8+ T cells in MS.