Introduction: Italy is considered a high-risk country for multiple sclerosis (MS). Exploiting electronic health archives (EHAs) is highly useful to continuously monitoring the prevalence of the disease, as well as the care delivered to patients and its outcomes. The aim of this study was to validate an EHA-based algorithm to identify MS patients, suitable for epidemiological purposes, and to estimate MS prevalence in Piedmont (North Italy). Methods: MS cases were identified, in the period between January 1, 2012 and December 31, 2017, linking data from 4 different sources: hospital discharges, drug prescriptions, exemptions from co-payment to health care, and long-term care facilities. Sensitivity of the algorithm was tested through record linkage with a cohort of 656 neurologist-confirmed MS cases; specificity was tested with a cohort of 2,966,293 residents presumably not affected by MS. Undercount was estimated by a capture-recapture method. We calculated crude, and age- and gender-specific prevalence. We also calculated age-adjusted prevalence by level of urbanization of the municipality of residence. Results: On December 31, 2017, the algorithm identified 8,850 MS cases. Sensitivity was 95.9%, specificity was 99.97%, and the estimated completeness of ascertainment was 91.9%. The overall prevalence, adjusted for undercount, was 152 per 100,000 among men and 286 among women; it increased with increasing age and reached its peak value in the 45- to 54-year class, followed by a progressive reduction. The age-adjusted prevalence of residents in cities was 15% higher than in those living in the countryside. Discussion/Conclusion: We validated an algorithm based on EHAs to identify cases of MS for epidemiological use. The prevalence of MS, adjusted for undercount, was among the highest in Italy. We also found that the prevalence was higher in highly urbanized areas.