Objectives. The purpose of this study was to identify the molecular mechanism and prognosis-related genes of Jianpi Jiedu decoction in the treatment of hepatocellular carcinoma. Methods. The gene expression data of hepatocellular carcinoma samples and normal tissue samples were downloaded from TCGA database, and the potential targets of drug composition of Jianpi Jiedu decoction were obtained from TCMSP database. The genes were screened out in order to obtain the expression of these target genes in patients with hepatocellular carcinoma. The differential expression of target genes was analyzed by R software, and the genes related to prognosis were screened by univariate Cox regression analysis. Then, the LASSO model was constructed for risk assessment and survival analysis between different risk groups. At the same time, independent prognostic analysis, GSEA analysis, and prognostic analysis of single gene in patients with hepatocellular carcinoma were performed. Results. 174 compounds of traditional Chinese medicine were screened by TCMSP database, corresponding to 122 potential targets. 39 upregulated genes and 9 downregulated genes were screened out. A total of 20 candidate prognostic related genes were screened out by univariate Cox analysis, of which 12 prognostic genes were involved in the construction of the LASSO regression model. There was a significant difference in survival time between the high-risk group and low-risk group (
p
<
0.05
). Among the genes related to prognosis, the expression levels of CCNB1, NQO1, NUF2, and CHEK1 were high in tumor tissues (
p
<
0.05
). Survival analysis showed that the high expression levels of these four genes were significantly correlated with poor prognosis of HCC (
p
<
0.05
). GSEA analysis showed that the main KEGG enrichment pathways were lysine degradation, folate carbon pool, citrate cycle, and transcription factors. Conclusions. In the study, we found that therapy target genes of Jianpi Jiedu decoction were mainly involved in metabolism and apoptosis in hepatocellular carcinoma, and there was a close relationship between the prognosis of hepatocellular carcinoma and the genes of CCNB1, NQO1, NUF2, and CHEK1.