AimSodium–glucose cotransporter 2 inhibitors (SGLT2is), used as a glucose‐lowering therapy in people with type 2 diabetes (T2D), have significant cardiorenal benefits, reducing hospitalization for heart failure (HF) and cardiovascular mortality in patients with and without T2D. Recent clinical trial evidence suggests their potential utility in preventing incident T2D among the high‐risk HF populations. Therefore, we aimed to assess whether this finding was reproducible in a real‐world setting.MethodsWe performed a retrospective cohort analysis of 484 643 patients with HF, without baseline diabetes, prescribed either angiotensin‐converting enzyme inhibitors or angiotensin II receptor blockers with/without SGLT2is (treatment, n = 42 018; reference, n = 442 625) across 95 global health care organizations, using a large real‐world ecosystem. Propensity score matching balanced arms 1:1 for confounders (n = 39 168 each arm). Subgroup analysis further evaluated the impact on patients with prediabetes and the efficacy of dapagliflozin/empagliflozin, specifically, on incident T2D and secondary outcomes, including all‐cause mortality, acute pulmonary oedema and hospitalization.ResultsTreatment with SGLT2is significantly reduced incident T2D {hazard ratio (HR) 0.71 [95% confidence interval (CI) 0.63, 0.75]} in patients with HF. The analysis of patients with prediabetes found that SGLT2is further reduced incident T2D [HR 0.62 (95% CI 0.45, 0.80)]. The magnitude of reduction in incident T2D was higher in patients prescribed dapagliflozin [HR 0.47 (95% CI 0.39, 0.56)] versus empagliflozin [HR 0.81 (95% CI 0.70, 0.93)].ConclusionTreatment with SGLT2is in patients with HF was associated with a reduced risk of incident T2D, most strikingly in people with prediabetes.