BackgroundObesity is a common and highly convincing risk factor for many cancers, including liver cancer. Sex disparities in the body composition and regulatory mechanisms involved in energy homeostasis may contribute to the difference in the incidence of cancer. However, evidence on the gender-specific association between body composition and liver cancer incidence is limited. We performed this study to investigate the linear and non-linear associations of body composition with liver cancer risk by gender.Materials and methodsThis prospective analysis included 4,75,659 participants free of cancer, based on the UK Biobank. We used Cox proportional hazard models to calculate the hazard ratios (HRs) and 95% confidence intervals (CIs) after adjusting for potential confounders. Restricted cubic spline was performed to investigate the potential non-linear associations.ResultsDuring a median follow-up, 275 cases (174 male patients and 101 female patients) of liver cancer were identified. Male patients in the highest body fat percentage group are more likely to develop liver cancer (HR = 1.89, 95% CI: 1.17–3.03) compared with those in the lowest group. The one-unit increase of whole-body fat mass, arm fat mass, and trunk fat mass was associated with 1.03-, 1.14-, and 1.05-fold increased risk of liver cancer in male subjects, respectively. U-shaped associations of body composition with liver cancer risk were observed in the female subjects. Both high and low levels of whole-body fat-free mass, particularly in the arm and trunk, were associated with an increased risk of liver cancer.ConclusionThis study found a gender-specific association between body composition and liver cancer risk and provided evidence for individualized weight management for the prevention of liver cancer.