Inflammation is considered as a key pathogenesis factor of dementia and epilepsy. However, epilepsy’s association with dementia, particularly its role in the development of dementia, remains unclear. To evaluate the association between epilepsy and the risk of dementia, in Taiwan, we have now conducted a retrospective cohort study comprising 675 individuals (age, ≥50 years) with epilepsy and 2,025 matched control subjects without epilepsy. In order to match individuals diagnosed with epilepsy with those with no diagnosis of epilepsy (comparison cohort), we utilized exact matching at a ratio of 1:3. Compared with those in the comparison cohort, individuals in the epilepsy cohort had a significantly increased risk of developing dementia (adjusted hazard ratio = 2.87, p < 0.001). A similar result has been observed after stratifying for sex (adjusted hazard ratio in males = 2.95, p < 0.001; adjusted hazard ratio in females = 2.66, p < 0.001). To conclude, based on these data, epileptic individuals ≥50 years were at a greater risk of developing dementia than people who do not have epilepsy, which indicates that a diagnosis of epilepsy presents a greater risk for the development of dementia.