Background Estimates of health care costs associated with excess weight are needed to inform the development of cost-effective obesity prevention efforts. However, commonly used cost estimates are not sensitive to changes in weight across the entire body mass index (BMI) distribution as they are often based on discrete BMI categories. Methods We estimated continuous BMI-related health care expenditures using data from the Medical Expenditure Panel Survey (MEPS) 2011-2016 for 175,726 respondents. We adjusted BMI for self-report bias using data from the National Health and Nutrition Examination Survey (NHANES) 2011-2016, and controlled for potential confounding between BMI and medical expenditures using a two-part model. Costs are reported in $US 2019. Results We found a J-shaped curve of medical expenditures by BMI, with higher costs for females and the lowest expenditures occurring at a BMI of 20.5 for adult females and 23.5 for adult males. Over 30 units of BMI, each one-unit BMI increase was associated with an additional cost of $253 (95% CI $167-$347) per person. Among adults, obesity was associated with $1,861 (95% CI $1,656-$2,053) excess annual medical costs per person, accounting for $172.74 billion (95% CI $153.70-$190.61) of annual expenditures. Severe obesity was associated with excess costs of $3,097 (95% CI $2,777-$3,413) per adult. Among children, obesity was associated with $116 (95% CI $14-$201) excess costs per person and $1.32 billion (95% CI $0.16-$2.29) of medical spending, with severe obesity associated with $310 (95% CI $124-$474) excess costs per child. Conclusions Higher health care costs are associated with excess body weight across a broad range of ages and BMI levels, and are especially high for people with severe obesity. These findings highlight the importance of promoting a healthy weight for the entire population while also targeting efforts to prevent extreme weight gain over the life course.