This study aimed to assess the relationship between dietary sodium/potassium intake and cognition in elderly individuals with hypertension. We designed a cross-sectional study based on the 2011-2014 National Health and Nutrition Examination Survey (NHANES) 2011-2014. A multivariable-logistic regression analysis was performed to analyze the relationship between sodium/potassium intake and cognitive impairment.Restricted cubic spline (RCS) based on regression analysis to assess the nonlinear doseresponse relationship between dietary sodium intake and cognitive performance. Out of the 2276 participants included in this study, 1670 patients had hypertension. Compared with the lowest quartile of dietary sodium intake, the lowest weighted odds ratio of cognitive impairment in DSST was observed in Q4 (OR = 0.45, 0.29-0.70), and a similar trend was observed in AFT (OR = 0.34, 0.18-0.65). After adjusting the covariates, the lowest weighted multivariable-adjusted OR of cognitive impairment in DSST were also observed in Q4 (OR = 0.47, 0.26-0.84) compared with the lowest quartile of dietary sodium intake. The RCS results showed that dietary sodium intake was U-shaped and associated with the risk of cognitive impairment in the DSST (P non-linearity = 0.0067). In addition, no significant association was observed between dietary potassium intake and different dimensions of cognitive performance. In conclusion, excessively high and low low dietary sodium were associated with impairment of specific processing speed, sustained attention, and working memory for elderly patients with hypertension in the United States. However, no association was observed between dietary potassium intake and cognition.