Background: Using a nationally representative sample, this study aimed to examine (1) socio-demographic and health-related disparities in cognitive impairment, (2) the association between food insecurity and cognitive impairment, and (3) the mediation role of anxiety or depression in the pathway between food insecurity and cognitive impairment. Methods: Cross-sectional data of 28,508 adults from the 2020 National Health Interview Survey were analyzed. Multivariable logistic regression models were used to estimate associations with cognitive impairment. Mediation analyses were conducted using the four-way decomposition method under a counterfactual framework. Results: Disparities in cognitive impairment were observed across socio-demographic and health-related characteristics (all p < 0.0001). Food insecurity was significantly associated with cognitive impairment in the overall population and the magnitude of the association was greater for the young or middle-aged, females and nonHispanic Blacks than the general population (AOR ranged from 1.19 to 2.54, all p < 0.01). With anxiety as a mediator, 28.66 % of the total effect of food insecurity on cognitive impairment was attributable to mediation only, and 22.39 % was attributable to interaction (between food insecurity and anxiety) and mediation. With depression as a mediator, 22.33 % of the total effect was attributable to mediation only, and 16.00 % was attributable to interaction (between food insecurity and depression) and mediation. Limitations: The cross-sectional design prevents inference of causality. Conclusions: Ensuring available and adequate food resources is important to prevent adverse cognitive outcomes. Clinical interventions or treatments for anxiety or depression may help improve cognitive function.