BackgroundNumerous observational studies have indicated a link between the composition of gut microbiota and thyroid function. Nevertheless, the precise causal relationship between gut microbiota and thyroid function remains uncertain.MethodsIn this two-sample Mendelian randomization study, we utilized summary data from a genome-wide association study of gut microbiota composition in 18,340 participants from 24 cohorts, as well as summary statistics on thyroid hormones and thyroid-stimulating hormone from the ThyroidOmics Consortium and summary statistics on hypothyroidism and hyperthyroidism from the FinnGen R8 release. Five different methods, including inverse variance weighting, MR-Egger, weighted median, weighted mode, and simple mode, were employed to examine the causal relationship between gut microbiota and thyroid function. Reverse Mendelian randomization analysis was conducted for taxa identified as having a causal relationship with thyroid function in the Mendelian randomization analysis. To assess the robustness of the results, sensitivity analyses were conducted employing Cochran’s Q test, MR-Egger intercept test, MR-PRESSO global test, and leave-one-out analysis.ResultsThrough MR analysis of 211 microbial taxa and 4 phenotypes, we identified a total of 34 gut microbiota taxa that were associated with the outcomes. After using the bonferroni method for multiple testing correction, phylum Actinobacteria (id.400) had a protective effect on hypothyroidism (OR=0.883, 95% CI: 0.817-0.955, P=0.002), and class Deltaproteobacteria (id.3087) had a protective effect on hyperthyroidism (OR=0.549, 95% CI: 0.374-0.805, P=0.002). According to the results of reverse MR analysis, no significant causal effect of the four phenotypes was found on gut microbiota. No significant horizontal pleiotropy was detected based on MR-Egger intercept test and MR-PRESSO global test.ConclusionThrough two-sample MR analysis, we identified specific gut microbiota taxa at the genetic level that are predicted to have a causal relationship with thyroid function, which may serve as useful biomarkers for early disease diagnosis.