BackgroundAlthough previous research has substantiated lifestyle and cardiovascular-related measures have some impact on cognitive function, studies focusing on the correlation between Life’s Essential 8 (LE8), an indicator for quantifying cardiovascular health (CVH), and cognitive function are limited. Consequently, this study sought to explore the potential link between CVH and cognitive function as well as to determine if depressive states mediated the relationship.MethodsA total of 2,263 individuals were selected from the 2011–2014 National Health and Nutrition Examination Survey (NHANES). Post-averaged LE8 scores was classified as low CVH (0–49), moderate CVH (50–79), and high CVH (80–100) according to the American Heart Association (AHA). Cognitive function was evaluated using the Animal Fluency Test (AFT), the Digit Symbol Substitution Test (DSST), the instant recall test (IRT), and the delayed recall test (DRT). The Z-score is figured by subtracting the average of the scores of four test sections and dividing by the standard deviation. Models of multi-variable linear regression were employed to appraise the relationships between CVH and the Z-score for cognitive function. Depression was assessed through the utilization of the Patient Health Questionnaire (PHQ-9). Points of 10 or above indicated a positive diagnosis. Weighted linear regression and restricted cubic spline (RCS) were employed to evaluate the correlation between CVH and cognitive function. Pearson’s test was utilized to explore the interrelation among primary variables and mediated effects analyses of depressive states.ResultsA significant positive linear relationship was observed between LE8 score and cognitive function Z-score. In all models, there was a positive correlation between higher Z-score for cognitive function and every ten points added to the LE8 score, which evaluates CVH. The findings of the mediating effect study indicated that the effects of cardiovascular health on cognitive function were partially mediated by depression.ConclusionResults showed a meaningful positive linear correlation between the level of CVH and cognitive function, with a mediating role for depression. These results accentuate the significance of sustaining high CVH and avoiding depression to improve cognitive functioning.