To prospectively investigate the long-term relationship between body mass index (BMI) in adolescents and young adults and risk for multiple sclerosis (MS) at the population level. We used data from the population-based compulsory Norwegian tuberculosis screening program during 1963 to 1975, including objectively measured height and weight from ≈85% of all eligible citizens. This was combined with data from the Norwegian MS registry and biobank up to November 2020. BMI was standardized according to age and sex, and risk for MS was calculated with Cox proportional hazard models. During 30,829,506 years of follow-up, we found 1,409 cases of MS among 648,734 participants in eligible age groups (14-34 years). Overall, obesity was associated with increased MS risk (hazard ratio [HR] 1.53 [95% confidence interval (CI) 1.25-1.88]), and the risk was similar in men (HR 1.4 [95% CI 0.95-2.06] and women (HR 1.59 [95% CI 1.25-2.02]). Risk was highest for the youngest age groups (age 14-16: HR 1.73 [95% CI 1.19-2.53]; 17-19: HR 1.61 [95% CI 1.08-2.39]; 20-24: HR 1.56 [95% CI 1.04-2.36]) and was no longer present for those >30 years of age. High BMI in individuals 14 to 24 years of age was associated with increased MS risk later in life in both male and female individuals.