ObjectiveTo investigate the association between oral contraceptive (OC) pill use and the risk of developing Multiple Sclerosis (MS), attempting to address the limitations present in previous studies which produced conflicting results. DesignPopulation-based cohort study using data from the UK Biobank. SubjectsThe study included 181,058 women of white ethnicity born in England between 1937 and 1970, among which 1131 had an MS diagnosis. ExposureOC use, considering the self-reported age of initiation and discontinuation. The exposures of interest include: i) ever use, ii) current use, iii) duration of current use in years, and iv) age and year at initiation. Main Outcome MeasuresMS diagnosis (ICD-10: G35) was used as outcome of interest, and the associations with the exposures of interest were investigated using marginal structural models with a time-to-event approach. To adjust for confounding, we included in the models several variables including MS polygenic risk score (MS-PRS), education level, parity, smoking, fertility problems, obesity, and mononucleosis. We further aimed to evaluate the influence of parity using a mediation analysis. ResultsThe association of both ever and current OC use did not result in a statistically significant MS hazard increase (ever vs never users, HR=1.30 [95%CI:0.93,1.82, p=0.12]; current vs never users, HR=1.35 [95%CI:0.81,2.25, p=0.25]). However, we highlighted parity as an effect modifier for this association. In nulliparous women, ever and current use resulted in a significant two-fold and three-fold MS hazard increase (HR=2.08 [95%CI:1.04,4.17, p=0.04] and HR=3.15 [95%CI:1.43,6.92, p=0.004]). These associations were supported by significant MS hazard increases for a higher duration of current use and for an earlier age at initiation. We further highlighted genetic MS susceptibility as another effect modifier, as a stronger OC-MS hazard association was found in women with a low MS-PRS. ConclusionOur findings highlighted how the association between OC use and MS vary based on individual characteristics such as parity and genetic MS susceptibility. Importantly, current use in nulliparous women was found to be associated with a three-fold increase in MS hazard. We acknowledge the need for cautious causal interpretation and further research to validate these findings across diverse populations and OC types.