Matrine and glycyrrhizin are representative active ingredients of traditional Chinese medicine (TCM) used in clinical practice. Studies have demonstrated that matrine has antitumor pharmacological effects and that glycyrrhizin protects liver function. However, the potential bioactive compounds and mechanisms remain unknown, as well as whether they have synergistic effects in killing cancer cells and protecting liver cells. To investigate the synergistic effects and mechanism of matrine combined with glycyrrhizin in hepatocellular carcinoma (HCC) treatment, we used both network pharmacology and bioinformatics analyses. First, the chemical gene interaction information of matrine and glycyrrhizin was obtained from the PubChem database. The pathogenic genes of HCC were accessed from five public databases. The RNA sequencing data and clinical information of HCC patients were downloaded from The Cancer Genome Atlas (TCGA). Next, the overlapping genes among the potential targets of matrine and glycyrrhizin and HCC-related targets were determined using bioinformatics analysis. We constructed the drug-target interaction network. Prognosis-associated genes were acquired through the univariate Cox regression model and Lasso-Cox regression model. The results were verified by the International Cancer Genome Consortium (ICGC) database. Finally, we predicted the immune function of the samples. The drug-target interaction network consisted of 10 matrine and glycyrrhizin targets. We selected a Lasso-Cox regression model consisting of 3 differentially expressed genes (DEGs) to predict the efficacy of the combination in HCC. Subsequently, we successfully predicted the overall survival of HCC patients using the constructed prognostic model and investigated the correlation of the immune response. Matrine and glycyrrhizin have synergistic effects on HCC. The model we obtained consisted of three drug-target genes by Lasso-Cox regression analysis. The model independently predicted the combined effect of matrine and glycyrrhizin in HCC treatment and OS, which will be helpful for guiding clinical treatment. The prognostic model was correlated with the immune cells and immune checkpoints of patients, which had an adjuvant effect on HCC immunotherapy. Matrine and glycyrrhizin can have therapeutic effects on HCC by promoting the production or enhancing the core gene activity in the drug network and improving the immune system function of patients.