People with type 2 diabetes (T2D) face high risks of heart failure (HF) hospitalizations that are often recurrent, especially as kidney function declines. We examined the effects of canagliflozin on total HF events by baseline kidney function in patients with T2D at high cardiovascular risk and/or with chronic kidney disease. Leveraging pooled participant-level data from the CANVAS programme (n = 10 142) and CREDENCE trial (n = 4401), first and total HF hospitalizations were examined. Cox proportional hazards models were built for the time to first HF hospitalization, and proportional means models based on cumulative mean functions were used for recurrent HF hospitalizations. Treatment effects were evaluated overall as well as within baseline estimated glomerular filtration rate (eGFR) strata (<45, 45-60, and >60 ml/min/1.73 m2). HF hospitalizations were independently and blindly adjudicated. Among 14 540 participants with available baseline eGFR values, 672 HF hospitalizations occurred over a median follow-up of 2.5 years. Among participants who experienced a HF hospitalization, 357 had a single event (201 in placebo-treated patients and 156 in canagliflozin-treated patients), 77 had 2 events, and 39 had >2 events. Canagliflozin reduced risk of first HF hospitalization (hazard ratio 0.58, 95% confidence interval [CI] 0.48-0.70) consistently across baseline eGFR strata (pinteraction = 0.84). Canagliflozin reduced total HF hospitalizations overall (mean event ratio 0.63, 95% CI 0.54-0.73) and across eGFR subgroups (pinteraction = 0.51). Canagliflozin also reduced cardiovascular death and total HF hospitalizations (mean event ratio 0.72, 95% CI 0.65-0.80) and across eGFR subgroups (pinteraction = 0.82). The absolute risk reductions were numerically larger, and numbers needed to treat were smaller when evaluating total events versus first events alone. These observed HF benefits were highly consistent across the range of eGFR, with larger absolute benefits in participants who had worse kidney function at baseline. In individuals with T2D at high cardiovascular risk and/or with chronic kidney disease, canagliflozin reduced the total burden of HF hospitalizations, with consistent benefits observed across the kidney function spectrum. ClinicalTrials.gov Identifier: CANVAS (NCT01032629), CANVAS-R (NCT01989754), CREDENCE (NCT02065791).