Background: More than half of the world's population have been infected with H. pylori, however the relationship between H. pylori infection and coronary heart disease (CHD) is unknown. Methods: This study used mendelian randomization (MR) analyses. The instrument variables for H. pylori infection were genetic variables (rs10004195 and rs368433) obtained from a published study. The outcome data included diagnosis, prognosis, and pathogenesis data for CHD, which were extracted from the public genome-wide association studies database, mainly from the CARDIoGRAMplusC4D consortium, UK Biobank, IEU database, and FinnGen database. MR analyses were performed per outcome database and were conducted by reverse analysis. Two step MR analyses were used to explore indirect pathogenic factors of H. pylori infection. Results: Genetically-predicted H. pylori infection was causally associated with body mass index (BMI) (β, 0.022; 95% CI, 0.008-0.036; p-value = 0.001), but not with the diagnosis of CHD (OR, 0.991; 95%CI, 0.904-1.078; p-value = 0.842, IEU database; OR, 1.049; 95% CI, 0.980-1.118; p-value = 0.178, FinnGen database) and prognosis of CHD (OR, 0.999; 95% CI, 0.997-1.001; p-value = 0.391, IEU database; OR, 1.022; 95% CI, 0.922-1.123; p-value = 0.663, FinnGen database). The causal effect of H. pylori infection on CHD is mediated by BMI. Inverse MR showed no causal effect of CHD on H. pylori infection. Conclusions: Our findings confirm the causal effect of H. pylori infection on CHD is mediated by BMI. Eradication or prevention of H. pylori infection may have a clinical benefit for patients with CHD indirectly.