This research aims to investigate the immune-associated gene signature from databases to improve the prognostic value in hepatocellular carcinoma (HCC) by multidimensional methods using various bioinformatic methods. Fifty-one immune-associated genes were mined out, which were associated with clinical characters through univariate and multivariate Cox regression analyses, and 51 immune-associated genes could be welldivided HCC samples into high-risk and low-risk clusters. Next, we performed least absolute shrinkage and selection operator (LASSO) Cox regression method to reveal 18 immune-associated genes' signature and calculate risk score of each gene for receiver operating characteristic (ROC) analysis. Comparing with low-risk cluster, high-risk cluster had higher risk score with unfavorable prognosis. Then, multivariate Cox regression analysis showed that risk score of 18 immune-associated genes' signature was associated with tumor invasion and tumor-node-metastasis (TNM) stage. ROC analysis indicated combined TNM stage, and risk score performed more sensitive and specific than single TNM stage or risk score in survival prediction. Furthermore, Kyoto Encyclopedia of Genes and Genomes (KEGG) analysis found that the pathways enriched in tumorigenesis were related to risk score, and those pathways could separate HCC samples into high and low clusters. In addition, the survival prediction of 18 immune-associated genes' signature was well validated in independent test data set, external data set, and Real-time Quantitative PCR (RT-qPCR) experiment. The 18 immuneassociated genes' signature was constructed, which could be used in effective prediction of HCC prognosis.