Sarcopenia, as measured at the level of the third lumbar (L3) has been shown to predict the survival of cancer patients. However, many patients with advanced non-small cell lung cancer (NSCLC) do not undergo routine abdominal imaging. The objective of this study was to investigate the association of thoracic sarcopenia with survival outcomes among patients who underwent immunotherapy for NSCLC. In this retrospective study, patients who initiated immunotherapy for advanced NSCLC from 2019 to 2022 were enrolled. and detailed patient data were collected. Cross sectional skeletal muscle area was calculated at the fifth thoracic vertebra (T5) on pretreatment chest computed tomography (CT) scan. Gender-specific lowest quartile values was used to define sarcopenia. The risk factors were analyzed using Cox analyses. The log-rank test and the random survival forest (RSF) were used to compare progression free survival (PFS). The model's performance was assessed using calibration curve and the receiver operating characteristic curve (ROC). A total of 242 patients was included (discovery cohort n=194, validation cohort n=48). In the discovery cohort, patients with sarcopenia exhibited significantly poorer PFS (p<0.001) than patients without sarcopenia. Univariate cox regression revealed that sarcopenia, lung cancer stage, body mass index, smoking status, and neutrophil-to-lymphocyte ratio were predictors of poor PFS. A RSF model was constructed based on the aforementioned parameters, to evaluate the model's efficacy, the ROC curve was utilized. with an area under the curve for predicting 6-month PFS of 0.68 and for 12-month PFS of 0.69. The prediction models for survival outcomes built by the discovery cohort showed similar performance in the validation cohort. Sarcopenia at T5 is independent prognostic factors in patients who received immunotherapy for advanced NSCLC.