ContextDiet is emerging as a modifiable component of lifestyle for influencing the incidence of liver cancer.ObjectiveTo investigate and quantify the potential relationship between food groups and liver cancer.Data sourcesPubMed and Web of Science were searched for eligible observational studies until 31st March, 2023.Data extractionThe meta-analysis was conducted by pooling relative risk (RR), odds ratio (OR) or hazards ratio (HR) with 95% confidence intervals (CIs). Potential sources of heterogeneity were detected by subgroup analysis. Sensitivity analysis and publication bias test were also carried out.Data analysisThrough stepwise screening, a total of 27 studies were included. The pooled estimates of liver cancer for whole grains and legumes intake were 0.66 (95% CI: 0.54–0.82;I2= 25.3%) and 0.86 (95% CI: 0.75–0.99;I2= 14.3%), respectively. However, there were null associations of nuts, poultry, egg and sweetened beverages consumption with liver cancer and the association between refined grains and liver cancer was inconclusive. In dose-response meta-analysis, the pooled estimates of liver cancer were 0.77 (95% CI: 0.65–0.91) for every 50 g/day increment in whole grains intake. Non-linear dose-response relationship (P= 0.031) was observed in the association between the intake of legumes and liver cancer, and the protective effect occurred with the dose ranging from 8 g/day to 40 g/day.ConclusionsThis meta-analysis shows that whole grains and legumes were inversely associated with liver cancer, whereas intake of nuts, poultry, egg and sweetened beverages may not be associated with liver cancer. Further quantitative research needs to be undertaken within a range of populations to investigate the relationship between food groups and liver cancer.Systematic review registrationPROSPERO registration no. CRD42021246142Supplementary InformationThe online version contains supplementary material available at 10.1186/s12937-023-00858-5.