Abstract Objective Research on factors contributing to depressive symptoms in cancer patients at a national level, encompassing a comprehensive set of variables was limited. This study aimed to address this gap by identifying the factors associated with depressive symptoms among cancer patients through a nationwide cross-sectional analysis. Methods Various factors, including demographic, socioeconomic, behavioral patterns, general and self-rated health status, chronic conditions, dietary habits, and cancer-related factors, were examined. Data was from the National Health and Nutrition Examination Survey. Univariate and multivariate logistic regression analyses were performed to identify associated factors. The receiver-operating characteristic (ROC) curve was used to evaluate the performance of the logistic model. Results The findings showed that five sociodemographic factors, two behavioral styles, self-rated health status, comorbid arthritis, two dietary factors and two cancer-related factors were strongly associated with depressive symptoms. Compared with those aged 20–39 years, cancer individuals aged 40–59 years (OR = 0.48, P 0.05). Shorter cancer diagnosis duration was associated with reduced odds of depression (P