Objective To explore the mechanism of Zhuangfang Xiaoji Huagan Prescription for the treatment of liver cancer by regulating ferroptosis based on network pharmacology and bioinformatics. Methods Active components and their effect targets of Xiaoji Huagan Prescription were screened by the Traditional Chinese Medicine Systems Pharmacology Database and Analysis Platform. Targets related to liver cancer were screened by the databases of DisGeNET, GeneCards®, and OMIM®. Targets related to ferroptosis were screened by the databases of GeneCards® and FerrDb. The intersection targets of the aforementioned 3 categories were imported into the STRING database for establishing protein⁃protein interaction network, and the Cytoscape 3.8.0 software was used to rank the intersection targets based on topological parameters. Functional and pathway enrichment analyses on the intersection targets were conducted by the Metascape database. The “active components of Xiaoji Huagan Prescription⁃intersection targets⁃KEGG signaling pathway” network was established by employing the Cytoscape 3.8.0 software, and the core active components were screened by degree value. The differential expression between the intersection targets in normal liver tissues and liver cancerous tissues was analyzed by using the GEPIA2 database for screening the core targets. Molecular docking analysis of the core active components and core targets corresponding proteins was conducted by using the AutoDockTools 1.5.6 software. Results A total of 197 effect targets, 1578 targets related to liver cancer, 692 targets related to ferroptosis of active components of Xiaoji Huagan Prescription were obtained, and a total of 36 intersection targets after obtaining the intersection. The biological processes involved in the intersection targets mainly contained positive regulation of programmed cell death and regulation of apoptosis signaling pathway, etc. The cellular compositions enriched were mainly membrane rafts and membrane microregions, etc. The molecular functions involved mainly included RNA polymerase Ⅱ specific DNA⁃binding transcription factor binding and DNA⁃binding transcription factor binding, etc. The signaling pathways enriched in the intersection targets mainly contained cancer⁃related pathway, interleukin 17 signaling pathway, mitogen⁃activated protein kinase signaling pathway, hypoxia inducible factor 1 signaling pathway, etc. Four core active components, namely, quercetin, kaempferol, isorhamnetin, and eupatilin, and five core targets (PARP1, CAV1, CDKN2A, HSPB1, and NQO1) were screened. The results of molecular docking analysis suggested that the core active components had strong binding capacity with the corresponding proteins of the core targets. Conclusion The core active components with respect to quercetin, kaempferol, isorhamnetin, and eupatilin in Zhuangfang Xiaoji Huagan Prescription can regulate ferroptosis, so as to exert effect for the treatment of liver cancer through acting on PARP1, CAV1, CDKN2A, HSPB1, and NQO1 genes, etc.