ABSTRACT Macrophage differentiation is associated with tumorigenesis, including the tumorigenesis of hepatocellular carcinoma (HCC). Herein, we explored the value of macrophage differentiation-associated genes (MDGs) in the prognosis of HCC using data from The Cancer Genome Atlas (TCGA) and the International Cancer Genome Consortium (ICGC) databases. We performed multivariate Cox regression analyses to identify the hub genes affecting HCC patient prognoses. The correlations between hub genes and macrophage differentiation and immune checkpoint inhibitors (PD-1, PD-L1, and CTLA4) were investigated. Finally, the potential mechanism was examined with gene set enrichment analysis (GSEA). In total, seventeen differentially expressed MDGs were obtained after intersecting data from the two databases. Multivariate analysis indicated that CDC42 expression was an independent prognostic indicator in both databases. Furthermore, CDC42 showed a strong correlation with the tumor infiltration levels of immune cells in HCC tissue. Correlation analysis revealed that CDC42 expression was positively associated with M2 macrophage markers and immune checkpoint inhibitors, which indicated that CDC42 expression might be related to M2 macrophage differentiation and HCC cell immune tolerance. Finally, GSEA showed that CDC42 expression was most significantly related to the Wnt signaling pathway. In conclusion, this study showed that CDC42 expression might be an important MDG in HCC and may prove to be a new gene for studying macrophage differentiation in HCC. Abbreviations: HCC: hepatocellular carcinoma; TCGA: The Cancer Genome Atlas; ICGC: International Cancer Genome Consortium; GSEA: gene set enrichment analysis; GO: Gene Ontology; KEGG: Kyoto Encyclopedia of Genes and Genomes; ROC: receiver operating characteristic; K-M: Kaplan-Meier; AUC: the area under the ROC curve; TNM: Tumor size/lymph nodes/distance metastasis