Patients with diabetes mellitus (DM) are at a higher risk of infectious diseases, and exercise is an important treatment modality for DM. Despite their susceptibility to infection in diabetic patients, the association between the amount of physical activity and the incidence of infective endocarditis (IE) is unclear. We attempted to demonstrate risk reduction by physical activity in diabetic patients with IE. From the National Health Insurance database, patients with DM were verified, and the incidence of IE was investigated. The level of physical activity was categorized into < 500, 500-999, 1,000-1,499, and ≥ 1,500 metabolic equivalent task (METs) minutes/week. Cox proportional hazard models were used to analyze the relationship between incident IE and physical activity. A total of 2,603,012 patients were included in this study. The incidence rate of IE was 10.06, 9.45, 7.78, and 8.84 in < 500, 500-999, 1,000-1,499, and ≥ 1,500 METs-minutes/week groups, respectively (100,000 person/year). A significant risk reduction of incident IE was observed in the 1,000-1499 and ≥ 1,500 METs-min/week groups compared to the < 500 METs-min/week group (Hazard ratio = 0.82, 95% confidence interval [0.690-0.976], HR = 0.831, 95% CI [0.704-0.981]). An analysis of a large national cohort database demonstrated that physical exercise reduced the risk of IE in patients with DM.