Objective: To explore the effects of canagliflozin on cardiac function and its regulation of ferroptosis in rats with heart failure with preserved ejection fraction (HFpEF). Methods: Thirty-two 7-week-old Dahl salt-sensitive rats were selected and randomly divided into four groups: the control group (fed with low-salt diet), the HFpEF group (fed with high-salt diet), the canagliflozin 20 group (fed with high-salt diet and 20 mg·kg-1·d-1 canagliflozin), and the canagliflozin 30 group (fed with high-salt diet and 30 mg·kg-1·day-1 canagliflozin). Body weight and blood pressure of the rats in each group were monitored. Metabolic cage tests were conducted at the10th week of the experiment, and echocardiography was performed at the 12th week, after which the rats were killed. Blood and left ventricular samples were collected. HE staining, Masson staining, Prussian blue iron staining, and reactive oxygen species staining were performed to observe the cardiomyocyte size and shape, degree of interstitial fibrosis, iron staining, reactive oxygen species production under optical microscope. The ultrastructure of cardiomyocytes was observed under electron microscope. Western blotting and real-time fluorescent quantitative reverse transcription polymerase chain reaction (RT-qPCR) were used to detect the expression levels of proteins and mRNA related to ferroptosis in left ventricular myocardial tissue of rats in each group. Results: After 1 week of adaptive feeding, all rats survived. Metabolic cage results showed that compared with control group, rats in the HFpEF group, canagliflozin 20 group and canagliflozin 30 group had more food intake, water intake and urine output, and lower body weight (all P<0.05). These changes were more pronounced in canagliflozin 20 group and canagliflozin 30 group than in HFPEF group, and only the body weight at the 12th week showed a statistically significant difference between canagliflozin 20 group and canagliflozin 30 group (P<0.05). The blood pressure of 6th week and 12th week, heart weight and left ventricular corrected mass of 12th week of rats in HFpEF group were higher than those in control group, canagliflozin 20 group and canagliflozin 30 group, while the ratio of early mitral valve peak velocity to late mitral valve peak velocity of 12th week was lower (all P<0.05). HE and Masson staining showed that compared to control group, the myocardial fibers in the left ventricular myocardial tissue of rats in HFpEF group were disordered, with larger cell diameter ((0.032±0.004) mm vs. (0.023±0.003) mm, P<0.05), irregular shape, obvious proliferation of interstitial collagen fibers, and higher collagen volume fraction (0.168±0.028 vs. 0.118±0.013, P<0.05). Compared with HFpEF group, rats in the canagliflozin 20 group and canagliflozin 30 had more orderly arranged myocardial fibers, more regular cardiomyocyte shape, smaller cell diameter, and lower collagen volume fraction (P<0.05). It was observed under electron microscopy that, compared to control group, most of the striated muscles in myocardial tissue of HFpEF group were broken, and the Z line and M line could not be clearly distinguished, some changes such as mitochondrial swelling, membrane thickening, cristae reduction or even disappearance occurred. In the canagliflozin 20 group and canagliflozin 30 group, the arrangement of striated muscles in the myocardial tissue of rats tended to be more regular, and the morphological changes of mitochondria were milder. Prussian blue iron staining results showed that the iron content in myocardial tissue of rats in HFpEF group was higher than that in control group, canagliflozin 20 group and canagliflozin 30 group. Reactive oxygen species staining results showed that the reactive oxygen species content in the myocardial tissue of rats in HFpEF group was higher than that of control group, canagliflozin 20 group and canagliflozin 30 group. Biochemical analysis of myocardial tissue showed that Fe2+ and malondialdehyde content in myocardial tissue of rats in HFpEF group were higher than those in control group, canagliflozin 20 group and canagliflozin 30 group, while glutathione content was lower (all P<0.05). Western blot and RT-qPCR detection results showed that compared to control group, rats in HFpEF group had higher expression levels of transferrin receptor 1 (protein relative expression level: 1.37±0.16 vs. 0.31±0.12), acyl-CoA synthetase long-chain family member 4 (protein relative expression level: 1.31±0.15 vs. 0.63±0.09) protein and mRNA, and lower expression levels of ferritin heavy chain 1 (protein relative expression level: 0.45±0.08 vs. 1.41±0.15) protein and mRNA (all P<0.05). There was no statistically significant difference in these indicators between canagliflozin 20 group and the canagliflozin 30 group (all P>0.05). There was no significant difference in levels of glutathione peroxidase 4 protein and mRNA expression in myocardial tissue of rats in four groups(P>0.05). Conclusion: Canagliflozin improves cardiac function in HFpEF rats by regulating the ferroptosis mechanism.