This study investigates the relationship between sodium, potassium intake, and all-cause mortality in the U.S. population using data from NHANES 2003–2018. It finds that both daily sodium and potassium intake are inversely associated with all-cause mortality, with non-linear relationships observed. The inflection points for sodium intake were 3133 mg/d and 3634 mg/d for the general population and elderly, respectively. For potassium intake, the inflection point was 3501 mg/d. The sodium-to-potassium ratio also showed a non-linear association, with an inflection point of 1.203 mg/mg/d. These findings suggest that maintaining a balanced sodium-to-potassium ratio is crucial for reducing all-cause mortality. The study highlights the importance of individualized dietary recommendations, as sodium and potassium intake thresholds vary among different population groups. It also emphasizes the need for further research to confirm these findings and to develop tailored dietary guidelines for specific age and health groups. The study underscores the complexity of sodium and potassium's roles in health and the necessity for a holistic approach to dietary recommendations.This study investigates the relationship between sodium, potassium intake, and all-cause mortality in the U.S. population using data from NHANES 2003–2018. It finds that both daily sodium and potassium intake are inversely associated with all-cause mortality, with non-linear relationships observed. The inflection points for sodium intake were 3133 mg/d and 3634 mg/d for the general population and elderly, respectively. For potassium intake, the inflection point was 3501 mg/d. The sodium-to-potassium ratio also showed a non-linear association, with an inflection point of 1.203 mg/mg/d. These findings suggest that maintaining a balanced sodium-to-potassium ratio is crucial for reducing all-cause mortality. The study highlights the importance of individualized dietary recommendations, as sodium and potassium intake thresholds vary among different population groups. It also emphasizes the need for further research to confirm these findings and to develop tailored dietary guidelines for specific age and health groups. The study underscores the complexity of sodium and potassium's roles in health and the necessity for a holistic approach to dietary recommendations.