Diagnosis of multiple sclerosis (MS) requires the exclusion of other possible diagnoses. For this reason, the cerebrospinal fluid (CSF) should be routinely analysed in patients with a first clinical event suggestive of MS. CSF analysis is no longer mandatory for diagnosis of relapsing-remitting MS, as long as MRI diagnostic criteria are fulfilled. However, caution is required in diagnosing MS in patients with negative MRI findings or in the absence of CSF analysis, as CSF investigation is useful to eliminate other causes of disease. The detection of oligoclonal IgG bands in CSF has potential prognostic value and is helpful for clinical decision-making. In addition, CSF analysis is important for research into the pathogenesis of MS. Pathophysiological and neurodegenerative findings of inflammation in MS have been derived from CSF investigations. Novel CSF biomarkers, though not yet validated, have been identified for diagnosis of MS and for ascertaining disease activity, prognosis and response to treatment, and are likely to increase in number with modern detection techniques. In this Review, we summarize CSF findings that shed light on the differential diagnosis of MS, and highlight the potential of novel biomarkers for this disease that could advance understanding of its pathophysiology.