Background: The development and popularization of the Internet provides an important opportunity to advance national strategies for healthy aging, particularly the impact of the Internet on cognitive function in middle-aged and older adults. Objective: This study aimed to quantify the impact of Internet use on the cognitive health of middle-aged and older adults (aged≥45 years). Methods: We used data from the Chinese Family Panel Study (CFPS) survey, tested the robustness of the baseline findings by variable substitution and instrumental variables methods, and analyzed heterogeneity. Subsequently, five purposes of Internet use that affect cognitive function were analyzed in depth. Results: Internet use may improve cognitive function in middle-aged and older adults. The effect of Internet use on cognitive function was more pronounced in the lower age group (45–59 years), among males, in rural areas, and among middle-aged and older adults with higher levels of education. Cognitive functioning of middle-aged and older adults varied according to how often they used the Internet for entertainment, socialization, study, work, and business activities. Conclusions: The use of the Internet may be considered a practical non-pharmacological intervention to slow cognitive decline in middle-aged and older adults.