Abstract Objective There is currently a lack of evidence from earlier studies about the impact of exercise on the risk of epilepsy. We conducted a 2‐sample Mendelian randomization (MR) study to identify the potential causal relationship between physical activity and epilepsy. Methods We identified single nucleotide polymorphisms (SNPs) associated with physical activity from a recent genome‐wide association study of the UK Biobank. Summary statistics of epilepsy were derived from the International League Against Epilepsy (ILAE) Consortium genome‐wide association study (GWAS) database. Results We found that self‐reported moderate‐to‐vigorous physical activity increases the incidence of focal epilepsy with hippocampal sclerosis(OR: 1.18; 95% CI: 1.07–1.30, p = 9 × e−4) and overall acceleration average reduces the risk of childhood absence epilepsy(OR: .99; 95% CI: .98 to 1.00; p = .013). Significance Different types of epilepsy respond differently to physical activity; it needs further research to explore the physiological mechanism of physical activity and epilepsy.