Background: Poor social connections (eg, small networks, infrequent interactions, and loneliness) are modifiable risk factors for cognitive decline. Existing meta-analyses are limited by reporting aggregate responses, a focus on global cognition, and combining social measures into single constructs. We aimed to investigate the association between social connection markers and the rate of annual change in cognition (ie, global and domain-specific), as well as sex differences, using an individual participant data meta-analysis. Methods: We harmonised data from 13 longitudinal cohort studies of ageing in North America, South America, Europe, Africa, Asia, and Australia. Studies were eligible for inclusion if they had baseline data for social connection markers and at least two waves of cognitive scores. Follow-up periods ranged from 0 years to 15 years across cohorts. We included participants with cognitive data for at least two waves and social connection data for at least one wave. We then identified and excluded people with dementia at baseline. Primary outcomes were annual rates of change in global cognition and cognitive domain scores over time until final follow-up within each cohort study analysed by use of an individual participant data meta-analysis. Linear mixed models within cohorts used baseline social connection markers as predictors of the primary outcomes. Effects were pooled in two stages using random-effects meta-analyses. We assessed the primary outcomes in the main (partially adjusted) and fully adjusted models. Partially adjusted models controlled for age, sex, and education; fully adjusted models additionally controlled for diabetes, hypertension, smoking, cardiovascular risk, and depression. Findings: Of the 40 006 participants in the 13 cohort studies, we excluded 1392 people with dementia at baseline. 38 614 individual participants were included in our analyses. For the main models, being in a relationship or married predicted slower global cognitive decline (b=0·010, 95% CI 0·000–0·019) than did being single or never married; living with others predicted slower global cognitive (b=0·007, 0·002–0·012), memory (b=0·017, 0·006–0·028), and language (b=0·008, 0·000–0·015) decline than did living alone; and weekly interactions with family and friends (b=0·016, 0·006–0·026) and weekly community group engagement (b=0·030, 0·007–0·052) predicted slower memory decline than did no interactions and no engagement. Never feeling lonely predicted slower global cognitive (b=0·047, 95% CI 0·018–0·075) and executive function (b=0·047, 0·017–0·077) decline than did often feeling lonely. Degree of social support, having a confidante, and relationship satisfaction did not predict cognitive decline across global cognition or cognitive domains. Heterogeneity was low (I2=0·00–15·11%) for all but two of the significant findings (association between slower memory decline and living with others [I2=58·33%] and community group engagement, I2=37·54–72·19%), suggesting robust results across studies. Interpretation: Good social connections (ie, living with others, weekly community group engagement, interacting weekly with family and friends, and never feeling lonely) are associated with slower cognitive decline. Funding: EU Joint Programme–Neurodegenerative Disease Research grant, funded by the National Health and Medical Research Council Australia, and the US National Institute on Aging of the US National Institutes of Health.