Summary Background High body-mass index (BMI) predisposes to several site-specific cancers, but a large-scale systematic and detailed characterisation of patterns of risk across all common cancers adjusted for potential confounders has not previously been undertaken. We aimed to investigate the links between BMI and the most common site-specific cancers. Methods With primary care data from individuals in the Clinical Practice Research Datalink with BMI data, we fitted Cox models to investigate associations between BMI and 22 of the most common cancers, adjusting for potential confounders. We fitted linear then non-linear (spline) models; investigated effect modification by sex, menopausal status, smoking, and age; and calculated population effects. Findings 5·24 million individuals were included; 166 955 developed cancers of interest. BMI was associated with 17 of 22 cancers, but effects varied substantially by site. Each 5 kg/m2 increase in BMI was roughly linearly associated with cancers of the uterus (hazard ratio [HR] 1·62, 99% CI 1·56–1·69; p<0·0001), gallbladder (1·31, 1·12–1·52; p<0·0001), kidney (1·25, 1·17–1·33; p<0·0001), cervix (1·10, 1·03–1·17; p=0·00035), thyroid (1·09, 1·00–1·19; p=0·0088), and leukaemia (1·09, 1·05–1·13; p≤0·0001). BMI was positively associated with liver (1·19, 1·12–1·27), colon (1·10, 1·07–1·13), ovarian (1·09, 1.04–1.14), and postmenopausal breast cancers (1·05, 1·03–1·07) overall (all p<0·0001), but these effects varied by underlying BMI or individual-level characteristics. We estimated inverse associations with prostate and premenopausal breast cancer risk, both overall (prostate 0·98, 0·95–1·00; premenopausal breast cancer 0·89, 0·86–0·92) and in never-smokers (prostate 0·96, 0·93–0·99; premenopausal breast cancer 0·89, 0·85–0·94). By contrast, for lung and oral cavity cancer, we observed no association in never smokers (lung 0·99, 0·93–1·05; oral cavity 1·07, 0·91–1·26): inverse associations overall were driven by current smokers and ex-smokers, probably because of residual confounding by smoking amount. Assuming causality, 41% of uterine and 10% or more of gallbladder, kidney, liver, and colon cancers could be attributable to excess weight. We estimated that a 1 kg/m2 population-wide increase in BMI would result in 3790 additional annual UK patients developing one of the ten cancers positively associated with BMI. Interpretation BMI is associated with cancer risk, with substantial population-level effects. The heterogeneity in the effects suggests that different mechanisms are associated with different cancer sites and different patient subgroups. Funding National Institute for Health Research, Wellcome Trust, and Medical Research Council.