Observational studies had indicated an association between cognitive impairment and sarcopenia, but high-quality causal effect evidence remained lacking. The purpose of this study is to determine the causal relationship between cognitive impairment and sarcopenia through a bidirectional Mendelian randomization (MR) study. The inverse variance-weighted (IVW) method was employed as the primary analytical approach to assess causal relationships. Additionally, we conducted sensitivity analyses using MR-Egger and weighted median to complement the IVW results. IVW analysis revealed that walking pace showed causal effects on cognitive performance (OR = 2.171, 95% C.I.: 1.696–2.779, P = 7.6×10− 10) and fluid intelligence (OR = 6.401, 95% C.I.: 3.573–11.467, P = 4.4×10− 10). Similar conclusions were drawn concerning the causal relationship between appendicular lean mass (ALM) with cognitive performance (OR = 1.099, 95% C.I.: 1.074–1.125, P = 1.1×10− 15) and fluid intelligence (OR = 1.237, 95% C.I.: 1.173–1.304, P = 3.1×10− 15). Furthermore, reverse MR analysis demonstrated that genetically predicted cognitive performance (OR = 1.106, 95% C.I.: 1.080–1.133, P = 2.1×10− 16) and fluid intelligence (OR = 1.049, 95% C.I.: 1.034–1.063, P = 1.7×10− 11) were causally associated with walking pace, and so as were ALM (OR = 1.163, 95% C.I.: 1.094–1.237, P = 1.4×10− 6 and OR = 1.066, 95% C.I.: 1.026–1.108, P = 0.0011, respectively). Our Mendelian randomization analysis supported a bidirectional causal effect between sarcopenia traits and cognitive impairment, which suggested the necessity for new therapy and prevention strategies for the corresponding patients. Further investigation is required to explore the individual effects of muscle strength, muscle mass, and physical performance on the cognitive function, as well as to uncover their underlying pathological mechanisms.