The association between obesity and response to cancer treatment and survival remains unclear, with conflicting findings from various studies. The optimal choice between conventional chemotherapy and immunotherapy for first-line treatment remains uncertain in patients with obesity who potentially have an inadequate therapeutic response to immunotherapy. To investigate whether body mass index (BMI) modifies the association of immunotherapy or conventional therapy with overall survival in patients with advanced non-small cell lung cancer (aNSCLC). A retrospective cohort study, using administrative claims data obtained from advanced treatment centers in Japan, was conducted between December 1, 2015, and January 31, 2023. Participants included individuals aged 18 years or older with aNSCLC who received immunotherapy, using immune checkpoint inhibitor (ICI) treatment or conventional chemotherapy. Immune checkpoint inhibitor therapy as first-line chemotherapy was compared with conventional chemotherapy, identified through patient medical records. The main outcome was overall survival. Survival analysis covered a 3-year follow-up period after the first-line chemotherapy. A total of 31 257 patients with aNSCLC were identified. Of these, 12 816 patients received ICI therapy (mean [SD] age, 70.2 [9.1] years; 10 287 [80.3%] men) and 18 441 patients received conventional chemotherapy (mean [SD] age, 70.2 [8.9] years; 14 139 [76.7%] men). Among patients with BMI less than 28, ICI therapy was associated with a significantly lower hazard of mortality (eg, BMI 24: hazard ratio [HR], 0.81; 95% CI, 0.75-0.87) compared with those who underwent conventional chemotherapy. However, no such association was observed among patients with BMI 28 or greater (eg, BMI 28: HR, 0.90; 95% CI, 0.81-1.00). The findings of this retrospective cohort study suggest that BMI modifies the association of ICI therapy compared with conventional chemotherapy with overall survival in patients with aNSCLC. A lack of association between ICI therapy and improved survival in patients with aNSCLC and overweight or obesity compared with conventional chemotherapy was observed. This suggests that ICI therapy may not be the optimal first-line therapy for patients with overweight or obesity and the use of conventional chemotherapy should also be considered in such patients.