Background: Several observational cohort studies suggested a close correlation between inflammatory bowel disease and erectile dysfunction. Nevertheless, whether there was a causal effect between them remained debatable. In this study, we aimed to detect the underlying causal links between genetically predicted inflammatory bowel disease and the risk of erectile dysfunction.Methods: A bidirectional Mendelian randomization (MR) study was performed to assess the causal link between inflammatory bowel disease and erectile dysfunction. Inverse variance weighted (IVW), MR-Egger, weighted median, weighted mode, and simple mode were utilized to estimate the causality. The top single nucleotide polymorphisms (SNPs) associated with inflammatory bowel disease cases (n = 25,800) and erectile dysfunction cases (n = 1,154) were extracted from the summary genome-wide association study (GWAS) data obtained from a publicly attainable database. MR-PRESSO global outlier test and MR-Egger regression were utilized to explore the horizontal pleiotropy and outlier instrumental variables. Cochran’s Q statistic was utilized to detect the heterogeneity.Results: In the forward MR study, the IVW approach demonstrated that genetically determined inflammatory bowel disease exhibited a suggestively causal association with an increased risk of erectile dysfunction (OR: 1.11, 95% CI: 1.02–1.21, p = 0.019), and also the genetically determined Crohn’s disease was found to be causally associated with an increased risk of erectile dysfunction (OR: 1.09, 95% CI: 1.02–1.17, p = 0.014). However, the MR analysis results showed no significant evidence supporting a causal effect of ulcerative colitis with erectile dysfunction (OR: 1.02, 95% CI: 0.92–1.14, p = 0.679). Furthermore, the reverse MR analysis showed no causal effects of genetically determined erectile dysfunction on inflammatory bowel disease. Additionally, sensitivity analysis demonstrated no pleiotropy and heterogeneity.Conclusion: Our MR analysis substantiated causal links of inflammatory bowel disease and Crohn’s disease on erectile dysfunction, which may further elucidate how inflammatory bowel disease impacted the initiation and development of erectile dysfunction, and facilitated the prevention and clinical management of inflammatory bowel disease in individuals with erectile dysfunction.