ObjectiveTo explore the influencing factors and patterns of cognitive function among populations with different educational levels.MethodsUsing data from the China Health and Retirement Longitudinal Study (2015–2020), we analyzed 29,620 subjects aged 45–85 years who completed cognitive function assessments. Participants were stratified by educational level: illiterate (n = 7,670), primary school (n = 7,897), junior high school (n = 8,904), and high school and above (n = 5,149). Mixed-effects models were used to analyze cognitive function determinants across educational groups, with sensitivity analyses performed to verify result robustness.ResultsCognitive function scores demonstrated a significant educational gradient, with the highest scores in the high-education group [20.0 (18.0–23.0)] and lowest in the illiterate group [16.0 (13.0–18.0)]. Age negatively correlated with cognitive function, with stronger effects in higher education groups (illiterate: β = −0.665; high-education: β = −1.033, p