Abstract:〔Abstract〕 Objective To study the effect of Jianpi Shugan Xiaoliu decoction on liver function and immune function in patients with primary liver cancer. Methods 60 patients with primary liver cancer admitted to Guangzhou Liwan District Hospital of Traditional Chinese Medicine from January 2018 to July 2020 were selected and divided into a control group and an observation group according to random number table method, with 30 patients in each group. The control group received conventional western medicine treatment, and the observation group was given Jianpi Shugan Xiaoyu decoction on the basis of the control group, and the clinical efficacy of the two groups was compared. Results The disease control rate and objective response rate in the observation group were higher than those in the control group, the differences were statistically significant (P < 0.05). Before treatment, there was no significant difference in the levels of total bilirubin, aspartate aminotransferase and alanine aminotransferase between the two groups (P > 0.05); after treatment, the levels of total bilirubin, aspartate aminotransferase and alanine aminotransferase in the two groups were decreased, and all indexes in the observation group were significantly lower than those in the control group, the differences were statistically significant (P < 0.05). Before treatment, there was no significant difference in the levels of CD3+ , CD4+ , CD8+ and CD4+ /CD8+ between the two groups (P > 0.05). After treatment, the levels of CD3+ , CD4+ and CD4+ /CD8+ in the two groups increased, while CD8+ decreased, and the levels of CD3+ , CD4+ and CD4+ /CD8+ in the observation group were higher than those in the control group, while CD8+ was lower than that in the control group, the differences were statistically significant (P < 0.05). Conclusion The treatment of patients with primary liver cancer with Jianpi Shugan Xiaoyu decoction can promote the recovery of liver function and immune function and effectively control the progression of the disease.