Although strong genetic determinants of multiple sclerosis (MS) exist, the findings of migration studies support a role for environmental factors in this disease. Through rigorous epidemiological investigation, Epstein-Barr virus infection, vitamin D nutrition and cigarette smoking have been identified as likely causal factors in MS. In this Review, the strength of this evidence is discussed, as well as the potential biological mechanisms underlying the associations between MS and environmental, lifestyle and dietary factors. Both vitamin D nutrition and cigarette smoking are modifiable; as such, increasing vitamin D levels and smoking avoidance have the potential to substantially reduce MS risk and influence disease progression. Improving our understanding of the environmental factors involved in MS will lead to new and more-effective approaches to prevent this disease.