Hepatocellular carcinoma (HCC) is one of the most lethal cancers worldwide, which is associated with a variety of risk factors. Cancer stem cells are self-renewal cells, which can promote the occurrence and metastasis of tumors and enhance the drug resistance of tumor treatment. This study aimed to develop a stemness score model to assess the prognosis of hepatocellular carcinoma (HCC) patients for the optimization of treatment. The single-cell sequencing data GSE149614 was downloaded from the GEO database. Then, we compared the gene expression of hepatic stem cells and other hepatocytes in tumor samples to screen differentially expressed genes related to stemness. R package “clusterProfiler” was used to explore the potential function of stemness-related genes. We then constructed a prognostic model using LASSO regression analysis based on the TCGA and GSE14520 cohorts. The associations of stemness score with clinical features, drug sensitivity, gene mutation, and tumor immune microenvironment were further explored. R package “rms” was used to construct the nomogram model. A total of 18 stemness-related genes were enrolled to construct the prognosis model. Kaplan-Meier analysis proved the good performance of the stemness score model at predicting overall survival (OS) of HCC patients. The stemness score was closely associated with clinical features, drug sensitivity, and tumor immune microenvironment of HCC. The infiltration level of CD8+ T cells was lower, and tumor-associated macrophages were higher in patients with high-stemness score, indicating an immunosuppressive microenvironment. Our study established an 18 stemness-related gene model that reliably predicts OS in HCC. The findings may help clarify the biological characteristics and progression of HCC and help the future diagnosis and therapy of HCC.