Patients with cancer frequently exhibit alterations in serum lipid profiles associated with chemotherapy. It has been reported that lipid distribution in cancer correlates with tumor progression. However, the prognostic value of serum lipid biomarkers in cancer survivors remains a subject of debate. We aim to explore the relationship between non-high-density lipoprotein to high-density lipoprotein ratio (NHHR) and the prognosis of cancer survivors. In this study, we analyzed cancer survivor data from the National Health and Nutrition Examination Survey (NHANES) from 1999-2000 to 2017-2018. The study included prospective cohorts that included total cholesterol (TC) and high-density lipoprotein cholesterol (HDL-C) levels as well as mortality data. Weighted multivariate cox regression models, competing risk models and restricted cubic spline (RCS) models were applied to investigate the association between NHHR and cancer survival. Subgroup and sensitivity analyses were performed to test the robustness of the results. This study involved 4,177 participants, representing about 19.6 million U.S. adults. After adjustment for various factors, the lower NHHR group (≤1.64) had a 31% (HR 1.31; 95% CI [1.11,1.54], p = 0.001) higher risk of death from any cause compared to the higher NHHR group. The link between NHHR and mortality remained stable across most subgroups, with notable interactions for smoking (p = 0.006) and diabetes status (p = 0.046). A J-shaped pattern was observed between NHHR and all-cause mortality, significantly among obesity-related cancer survivors (overall association test p-value = 0.0068, non-linear association test p-value = 0.0016). However, a non-significant negative correlation was observed for cancer-specific mortality (overall association test p-value = 0.48, non-linear association test p-value = 0.66). Considering the competitive risk of heart disease and cancer-specific mortality, there is no difference between the high and low NHHR groups, while the low NHHR group showed an increased risk of non-specific causes of death (p < 0.001). The results of this study suggest that NHHR is an important indicator that is strongly associated with all-cause mortality in cancer survivors, and that this relationship may be influenced by the interaction of diabetes and smoking status. This finding may provide important information for future research and patient management.