Objective. To analyze the target and potential mechanism of Scutellaria baicalensis (SB) in the treatment of HCC based on bioinformatics, so as to provide suggestions for the diagnosis, treatment, and drug development of hepatocellular carcinoma (HCC). Methods. The regulated gene targets of SB were screened by gene expression pattern clustering and differential analysis of gene expression data of HepG2 cells treated with SB at 0 h, 1 h, 3 h, 6 h, 12 h, and 24 h. The module genes related to HCC were identified by the weighted gene coexpression network analysis (WGCNA). KEGG and GO enrichment were used to analyze the molecular function and structure of the module, and GSEA was used to evaluate the different functional pathways between normal people and patients with HCC. Then, the module gene was used for univariate Cox proportional hazard analysis and the least absolute shrinkage and selection operator (LASSO) Cox regression analysis to build a prognostic model. The protein-protein interaction network (PPI) was used to analyze the core genes regulated by SB (CGRSB) of the module, and the survival curve revealed the CGRSB impact on patient survival. The CIBERSORT algorithm combined with correlation analysis to explore the relationship between CGRSB and immune infiltration. Finally, the single-cell sequencing technique was used to analyze the distribution of CGRSB at the cellular level. Results. SB could regulate 903 genes, of which 234 were related to the occurrence of HCC. The prognosis model constructed by these genes has a good effect in evaluating the survival of patients. KEGG and GO enrichment analysis showed that the regulation of SB on HCC mainly focused on some cell proliferation, apoptosis, and immune-related functions. GSEA enrichment analysis showed that these functions are related to the occurrence of HCC. A total of 24 CGRSB were obtained after screening, of which 13 were significantly related to survival, and most of them were unfavorable factors for patient survival. The correlation analysis of gene expression showed that most of CGRSB was significantly correlated with T cells, macrophages, and other functions. The results of single-cell analysis showed that the distribution of CGRSB in macrophages was the most. Conclusion. SB has high credibility in the treatment of HCC, such as CDK2, AURKB, RRM2, CENPE, ESR1, and PRIM2. These targets can be used as potential biomarkers for clinical diagnosis. The research also shows that the p53 signal pathway, MAPK signal pathway, apoptosis pathway, T cell receptor pathway, and macrophage-mediated tumor immunity play the most important role in the mechanism of SB in treating HCC.