Single body mass index (BMI) measurements have been associated with increased risk of 13 cancers. Whether life course adiposity-related exposures are more relevant cancer risk factors than baseline BMI (ie, at start of follow-up for disease outcome) remains unclear. We conducted a cohort study from 2009 until 2018 with population-based electronic health records in Catalonia, Spain. We included 2,645,885 individuals aged ≥40 years and free of cancer in 2009. After 9 years of follow-up, 225,396 participants were diagnosed with cancer. This study shows that longer duration, greater degree, and younger age of onset of overweight and obesity during early adulthood are positively associated with risk of 18 cancers, including leukemia, non-Hodgkin lymphoma, and among never-smokers, head and neck, and bladder cancers which are not yet considered as obesity-related cancers in the literature. Our findings support public health strategies for cancer prevention focussing on preventing and reducing early overweight and obesity.