The established link between DNA methylation and pathophysiology of dementia, along with its potential role as a molecular mediator of lifestyle and environmental influences, positions blood-derived DNA methylation as a promising tool for early dementia risk detection. In conjunction with an extensive array of machine learning techniques, we employed whole blood genome-wide DNA methylation data as a surrogate for 14 modifiable and non-modifiable factors in the assessment of dementia risk in independent dementia cohorts. We established a multivariate methylation risk score (MMRS) for identifying mild cognitive impairment cross-sectionally, independent of age and sex (P=2.0×10-3). This score significantly predicted the prospective development of cognitive impairments in independent studies of Alzheimer's disease (hazard ratio for Rey's Auditory Verbal Learning Test (RAVLT)-Learning=2.47) and Parkinson's disease (hazard ratio for MCI/dementia=2.59). Our work shows the potential of employing blood-derived DNA methylation data in the assessment of dementia risk. We used whole blood DNA methylation as a surrogate for 14 dementia risk factors. Created a multivariate methylation risk score for predicting cognitive impairment. Emphasized the role of machine learning and omics data in predicting dementia. The score predicts cognitive impairment development at the population level.