To estimate healthcare resource utilization (HCRU) and healthcare costs by body mass index (BMI) in a UK cohort and to explore how this varied by defined BMI strata. This retrospective open cohort study used Discover, a linked primary and secondary electronic health records database covering 2.7 million individuals. Adults were stratified by BMI as: overweight (25-<30 kg/m2); obesity class I (30-<35 kg/m2); obesity class II (35-<40 kg/m2); or obesity class III (≥40 kg/m2). Cost data, comprising primary care, secondary care (inpatient admissions, outpatient appointments and emergency room visits) and prescriptions, were reported for 2015-2019. Overall, 1 008 101 individuals were overweight, 278 782 had obesity class I; 80 621 had obesity class II, and 42 642 had obesity class III. Healthcare costs and HCRU events per person per year increased over time (2015: £851-£1321 and 10.6-13.4 events; 2019: £1143-£1871 and 11.4-14.9 events), and were higher for each successive BMI group. Groups with chronic kidney disease or cardiovascular disease incurred particularly high costs. In 270 493 individuals with obesity in 2019, more than 72% of total healthcare costs were incurred by the highest cost quintile, which had a higher mean age and more obesity-related complications (ORCs) than lower cost quintiles. The economic impact of obesity could be alleviated by weight management support based on unmet need, to limit the effects of BMI progression and ORC development.