Background: Non-alcoholic fatty liver disease (NAFLD) and atrial fibrillation (AF) are major health burdens, with emerging evidence suggesting NAFLD as a significant risk factor for AF, but the mechanism is remain unclear.Methods: In this study, we analyzed gene expression data from NAFLD (GSE89632) and AF (GSE75092) datasets from the Gene Expression Omnibus. We identified co-upregulated and co-downregulated genes between NAFLD and AF, assessed diagnostic potential of specific genes, conducted immune infiltration analysis, and performed molecular docking studies with sodium glucose co-transporter 2 inhibitors (SGLT2i).Results: We identified eight co-upregulated and 31 co-downregulated genes between NAFLD and AF. Genes such as AMOT, PDE11A, TYMS, TMEM98, and PTGS2 demonstrated substantial diagnostic potential for identifying NAFLD patients at risk of AF. Immune infiltration analysis discovered an elevated presence of CD8 T cells, γδ T cells, and M2 macrophages in NAFLD livers, linking systemic inflammation to NAFLD and AF. Additionally, studies have shown that a connection between mitochondrial dysfunction and several hub genes like DGAT1, TYMS, and PTGS2, suggesting that mitochondrial disturbances may underpin the systemic inflammation in NAFLD, which possibly exacerbating AF. Molecular docking studies indicated that empagliflozin's binding affinity with key genes such as DGAT1, TYMS, and PTGS2 presents a novel therapeutic avenue for NAFLD-associated AF.Conclusion: Our study firstly discovered that AMOT, PDE11A, TYMS, TMEM98, and PTGS2 are associated with NAFLD-related AF and hold strong diagnostic values. Our study also indicates that mitochondrial dysfunction and systemic inflammation may be potential mechanisms bridging NAFLD and AF. Additionally, we identified empagliflozin as a potentially effective therapeutic agent for NAFLD-related AF at the molecular structure level. These novel insights contribute to the further understanding, diagnosis, and intervention of NAFLD-related AF.