Targeting protein for Xenopus kinesin-like protein 2 (TPX2), a well-known mitotic protein, has been linked to carcinogenesis in several cancers. This study investigated the role of TPX2 in hepatocellular carcinoma (HCC) from various aspects using bioinformatic analyses. TPX2 expression and its prognostic value in pan-cancers were analyzed using SangerBox. TPX2 expression and its association with prognosis, immune infiltration, tumor mutations, and signaling pathways in HCC were analyzed using UALCAN, BoxKaplan-Meier Plotter, GEPIA, Human Protein Atlas, TIMER 2.0, and SangerBox. Genes co-expressed with TPX2 in HCC were analyzed using the HCCDB database, followed by functional enrichment using SangerBox. Clinical predictive models were established based on TPX2 and its co-expressed genes using the ACLBI database. TPX2 expression significantly increased in pan-cancers and was associated with survival in nearly half of the cancer types. High TPX2 expression has been linked to poor survival outcomes in patients with HCC. TPX2 expression was positively correlated with abundant infiltration of immune cells (including B cells, CD4 + /CD8 + T cells, macrophages, neutrophils, and dendritic cells), TP53 mutation, and carcinogenesis-related pathways, such as the PI3K/AKT/mTOR pathway, cellular response to hypoxia, and tumor proliferation signature. Nineteen genes were found to be co-expressed with TPX2 in HCC, and these genes showed close positive correlations and were mainly implicated in cell cycle-related functions. A prognostic model established using TPX2 and its expressed genes could stratify HCC patients into high- and low-risk groups, with a significantly shorter survival time in high-risk groups. The prognostic model performed well in predicting 1-, 3-, and 5-year survival of patients with HCC, with areas under the curve of 0.801, 0.725, and 0.711, respectively. TPX2 functions as an oncogene in HCC, and its high expression is detrimental to the survival of patients with HCC. Thus, TPX2 may be a prognostic biomarker and potential therapeutic target for HCC.