Although liver metabolic dysfunction has been found to potentially elevate susceptibility to cognitive impairment and dementia, there is still insufficient evidence to explore the non-linear association of liver enzymes with cognitive performance. Therefore, we aimed to elucidate the non-linear relationship between liver enzymes and cognitive performance. In this cross-sectional study, 2764 individuals aged ≥ 60 who participated in the National Health and Nutrition Survey (NHANES) between 2011 and 2014 were included. The primary data comprised liver enzyme levels (alkaline phosphatase (ALP), aspartate aminotransferase (AST), alanine aminotransferase (ALT), AST/ALT ratio, and gamma-glutamyl transferase (GGT)), and cognitive performance was the major measured outcome. The associations were analyzed using weighted multivariate logistic regression, subgroup analysis, a generalized additive model, smooth fitting curves, and threshold effects. The results of the fully adjusted model indicated that ALP was negatively associated with the animal fluency test (AFT) score (OR = 1.48, 95% CI: 1.11-1.98), whereas ALT demonstrated a positive association with the consortium to establish a registry for Alzheimer's disease (CERAD) test score (OR = 0.72, 95% CI: 0.53-0.97). Additionally, the AST/ALT ratio was negatively associated with the global cognitive test (OR = 2.39, 95% CI: 1.53-3.73), CERAD (OR = 2.61, 95% CI: 1.77-3.84), and digit symbol substitution test (DSST) scores (OR = 2.51, 95% CI: 1.57-4.02). GGT was also negatively associated with the AFT score (OR = 1.16, 95% CI: 1.01-1.33) in unadjusted model. A non-linear relationship was observed between liver enzymes and the risk of cognitive impairment as assessed by the global cognitive test. Specifically, when ALP > 60 U/L, 0.77 < AST/ALT < 1.76, and 25 < GGT < 94 U/L, higher liver enzyme levels were significantly associated with an elevated cognitive impairment risk, while a lower cognitive impairment risk when ALT level was > 17 U/L. There is a non-linear relationship between liver enzymes and cognitive performance, indicating that liver enzyme levels should be maintained within a certain level to mitigate the risk of cognitive impairment.