Dementia is an increasing cause of disability and loss of independence in the elderly population yet remains largely underdiagnosed. A biomarker for dementia that can identify individuals with or at risk for developing dementia may help close this diagnostic gap. To investigate the association between a sleep electroencephalography-based brain age index (BAI), the difference between chronological age and brain age estimated using the sleep electroencephalogram, and dementia. In this retrospective cross-sectional study of 9834 polysomnograms, BAI was computed among individuals with previously determined dementia, mild cognitive impairment (MCI), or cognitive symptoms but no diagnosis of MCI or dementia, and among healthy individuals without dementia from August 22, 2008, to June 4, 2018. Data were analyzed from November 15, 2018, to June 24, 2020. Dementia, MCI, and dementia-related symptoms, such as cognitive change and memory impairment. The outcome measures were the trend in BAI when moving from groups ranging from healthy, to symptomatic, to MCI, to dementia and pairwise comparisons of BAI among these groups. A total of 5144 sleep studies were included in BAI examinations. Patients in these studies had a median (interquartile range) age of 54 (43-65) years, and 3026 (59%) were men. The patients included 88 with dementia, 44 with MCI, 1075 who were symptomatic, and 2336 without dementia. There was a monotonic increase in mean (SE) BAI from the nondementia group to the dementia group (nondementia: 0.20 [0.42]; symptomatic: 0.58 [0.41]; MCI: 1.65 [1.20]; dementia: 4.18 [1.02]; P < .001). These findings suggest that a sleep-state electroencephalography-based BAI shows promise as a biomarker associated with progressive brain processes that ultimately result in dementia.