The transcription factor BarH-like homeobox 2 (BARX2), a member of the Bar-like homeobox gene family, is involved in cell proliferation, differentiation, immune responses and tumorigenesis. However, the potential role of BARX2 in the development of liver hepatocellular carcinoma (LIHC) remains unclear. Therefore, we aimed to study the biological role of BARX2 in hepatocellular carcinoma. Through the UALCAN, GTEx PORTAL, TIMER 2.0, LinkedOmics, SMART, MethSurv, Metascape, GSEA and STRING public databases, the BARX2 mRNA level, prognostic value, coexpressed genes, associated differentially expressed genes, DNA methylation and functional enrichment of LIHC patients were studied. The relationships between BARX2 expression and various clinical or genetic parameters of LIHC patients were determined using data from The Cancer Genome Atlas (TCGA), Gene Expression Omnibus (GEO), and BEAT LIHC databases. In addition, the biological function of BARX2 in LIHC was studied in vitro. Through large-scale data mining, our study showed that BARX2 was differentially expressed between different normal and tumour tissues.BARX2 expression in LIHC tissues was significantly lower than that in corresponding controls, especially in patients with T2-4 stage disease. In patients with LIHC, overexpression of BARX2 was an independent poor prognostic factor associated with poor cytogenetic risk and gene mutations. Genomic hypermethylation of the BARX2 gene was associated with upregulated BARX2 expression and poor overall survival (OS) in LIHC. Functional enrichment analysis showed that BARX2 had an immunomodulatory role and was involved in the inflammatory response in LIHC occurrence. In conclusion, the oncogene BARX2 may serve as a new biomarker and prognostic factor for patients with LIHC. The immunomodulatory function of BARX2 deserves further validation in LIHC.