An association between thyroid function and multiple sclerosis (MS) has been reported in several observational studies, but the causal relationship between them is still unclear. Thus, this study used a bidirectional Mendelian randomization (MR) to investigate the associations between thyroid function and MS. Bidirectional MR was used to explore the causal relationship between thyroid function (thyroid-stimulating hormone [TSH], free thyroxine [FT4], hyperthyroidism, and hypothyroidism) and MS. Genome-wide association study (GWAS) data of thyroid function and MS were obtained from the ThyroidOmics Consortium and the FinnGen Consortium, respectively. Inverse-variance weighted method (IVW) was the primary analysis method to assess causality with Weighted median, MR-Egger regression, weighted mode, and simple mode as auxiliary methods. Sensitivity analyses were performed using heterogeneity tests, horizontal pleiotropy tests and leave-one-out method. There was a positive causal relationship between TSH and MS (IVW: OR = 1.202, 95% CI: 1.040–1.389, P = .013), and no strong evidence was found for an effect of FT4 (IVW: OR = 1.286, 95% CI: 0.990–1.671, P = .059), hypothyroidism (IVW: OR = 1.247, 95% CI: 0.961–1.617, P = .096), and hyperthyroidism (IVW: OR = 0.966, 95% CI: 0.907–1.030, P = .291) on the risk of MS. In the reverse MR results, there was no causal relationship between MS and TSH (IVW: β = −0.009, P = .184), FT4 (IVW: β = −0.011, P = .286), hypothyroidism (IVW: OR = 0.992, 95% CI: 0.944–1.042, P = .745), and hyperthyroidism (IVW: OR = 1.026, 95% CI: 0.943–1.117, P = .549). Cochran’s Q test, MR-Egger intercept test, MR-PRESSO global test, and Leave-one-out did not observe horizontal pleiotropy and heterogeneity. In conclusion, MR analysis supported a positive causal relationship between TSH and MS.