Hepatocellular Carcinoma (HCC) is one of the most common malignant tumors in the world, characterized by high incidence, high malignancy, and low survival rate. Currently, 1/4 of adults in the world suffer from Non-Alcoholic Fatty Liver Disease (NAFLD), with an incidence rate of 27% in Asia. We used TCGA and GEO public database data sets to conduct weighted gene coexpression network analysis to identify relevant gene modules, defined the intersection of tumorigenesis-related modules and NASH development-related modules as shared genes, and then used single-factor Cox, LASSO, and multivariate Cox regression analysis screened out core shared genes and verified their prognostic value. We further investigated the relationship between core shared genes and immune infiltration, tumor mutational load, and drug sensitivity. Finally, RT-qPCR was used to verify its mRNA expression in different cell lines. We identified Karyopherin α 2 (KPNA2) as the core shared gene between NASH and HCC. Patients were divided into low-risk groups and high-risk groups based on the expression of KPNA2. The prognosis of the low-risk group was significantly better than that of the highrisk group. Furthermore, we found significant differences in tumor immune cell infiltration, somatic mutations, microsatellite instability, and drug sensitivity between different expression groups. There are very few studies on the molecular mechanism of the relationship between NAFLD and HCC. Our study demonstrates that KPNA2 is a potential therapeutic target and immune-related biomarker for patients with NAFLD and HCC.