Previous research has suggested a link between gut microbiota and attention deficit hyperactivity disorder (ADHD), but their causal relationship has not been elucidated. Aiming to comprehensively investigate their causal relationship and to identify specific causal microbe taxa for ADHD, we conducted a two-sample Mendelian randomization (MR) analysis. Instrumental variables of 211 gut microbiota taxa were obtained from gene wide association study (GWAS), and Mendelian randomization study was carried out to estimate their effects on ADHD risk from PGC GWAS (20,183 ADHD cases and 35,191 controls) and FinnGen GWAS (830 ADHD cases and 215,763 controls). Wald ratio (WR), inverse variance weighted (IVW), MR-Egger, and weighted median were the main methods to analyze causality, and MR results are verified by several sensitivity analysis analyses. At locus-wide significance level (p < 1 × 10−5), IVW results confirmed that genus Eubacteriumhalliigroup (p = 0.013) and genus RuminococcaceaeUCG013 (p = 0.049) were correlated with the risk of ADHD and genus Butyricicoccus (p = 0.009), genus Roseburia (p = 0.009), genus Desulfovibrio (p = 0.015), genus LachnospiraceaeNC2004group (p = 0.026), genus Romboutsia (p = 0.028) and family Oxalobacteraceae (p = 0.048) were protective factors of ADHD. Weighted median results indicated that genus Butyricicoccus (p = 0.018) was negatively correlated with the risk of ADHD. At genome-wide statistical significance level (p < 5 × 10−8), Wald ratio results demonstrated that genus Ruminococcustorquesgroup (p = 0.003) was a risk factor for ADHD, while genus Romboutsia (p = 0.006) and family Peptostreptococcaceae (p = 0.006) had a negative correlation with the risk of ADHD. In reverse MR analysis, IVW results showed that ADHD may lead to an increase in the abundance of genus Roseburia (p = 0.020). Analysis of heterogeneity (p > 0.05) and pleiotropy (p > 0.05) confirmed the robustness of MR results. We demonstrated that there was a potential causal relationship between gut microbiota and ADHD. Our research provides a foundation for understanding the causal relationship between gut microbiota and ADHD, and the several gut bacteria found in this study that may reduce the occurrence of ADHD may have potential in the prevention and treatment of ADHD.