Introduction: Although several studies have examined the individual relationships among digital literacy, cognitive function, and depressive symptoms, few have integrated all three factors into a single model. This study aimed to address this gap by investigating the mediating effect of depressive symptoms on the relationship between digital literacy and cognition. In doing so, we hoped to contribute to a more comprehensive understanding of the complex interplay among these variables and their implications for mental health and well-being. Methods: Participants were 7,988 older adults (65 years or older) who participated in the Living Profiles of Older People Survey 2020. The main type of exposure was digital literacy (communication, information, media, and online transaction literacy). The main outcomes were depressive symptoms measured using the Short Geriatric Depression Scale of Korean version and cognitive function measured using the Mini-Mental State Examination score. Multiple linear regression and mediation analyses were also performed. Results: After adjusting for covariates, our analysis found a significant association between digital literacy and both depressive symptoms and cognitive function (β of four types of digital literacy and depressive symptoms = −0.123, −0.172, −0.702, and − 0.639, respectively; β of four types of digital literacy and cognitive function = 2.102, 2.217, 1.711, and 1.436, respectively). Moreover, our study showed that depressive symptoms play a mediating role in the relationship between media and online transaction literacy and cognitive function (95% CI of indirect effects = 0.0647–0.1212 and 0.0639–0.1277, respectively), implying an indirect pathway (digital literacy, depressive symptoms, and cognitive function). Discussion: This study sheds light on the relationship between digital literacy, depressive symptoms, and cognitive function in older adults. We found that depressive symptoms mediated the association between specific aspects of digital literacy (online transaction and media literacy) and cognitive function. Our results indicate that community-based digital literacy programs could be effective in reducing depression and preserving or improving cognitive function in older adults.