BackgroundAtrial fibrillation (AF) and heart failure (HF) frequently coexist because of their similar pathological basis. However, whether sodium-glucose cotransporter 2 inhibitor (SGLT2i), a novel class of anti-HF medication, decreases the risk of AF in HF patients remains unclear.ObjectivesThe aim of this study was to assess the relationship between SGLT2i and AF in HF patients.MethodsA meta-analysis of randomized controlled trails evaluating the effects of SGLT2i on AF in HF patients was performed. PubMed and ClinicalTrails.gov were searched for eligible studies until 27 November 2022. The risk of bias and quality of evidence were assessed through the Cochrane tool. Pooled risk ratio of AF for SGLT2i versus placebo in eligible studies was calculated.ResultsA total of 10 eligible RCTs examining 16,579 patients were included in the analysis. AF events occurred in 4.20% (348/8292) patients treated with SGLT2i, and in 4.57% (379/8287) patients treated with placebo. Meta-analysis showed that SGLT2i did not significantly reduce the risk of AF (RR 0.92; 95% CI 0.80–1.06;p= 0.23) in HF patients when compared to placebo. Similar results remained in the subgroup analyses, regardless of the type of SGLT2i, the type of HF, and the duration of follow-up.ConclusionsCurrent evidences showed that SGLT2i may have no preventive effects on the risk of AF in patients with HF.Translational perspectiveDespite HF being one of the most common heart diseases and conferring increased risk for AF, affective prevention of AF in HF patients is still unresolved. The present meta-analysis demonstrated that SGLT2i may have no preventive effects on reducing AF in patients with HF. How to effectively prevent and early detect the occurrence of AF is worth discussing.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12933-023-01860-1.