We examined midlife (1990-1992, mean age 57) and late-life (2011-2013, mean age 75) nonalcoholic fatty liver disease (NAFLD) and aminotransferase with incident dementia risk through 2019 in the Atherosclerosis Risk in Communities (ARIC) Study. We characterized NAFLD using the fatty liver index and fibrosis-4, and we categorized aminotransferase using the optimal equal-hazard ratio (HR) approach. We estimated HRs for incident dementia ascertained from multiple data sources. Adjusted for demographics, alcohol consumption, and kidney function, individuals with low, intermediate, and high liver fibrosis in midlife (HRs: 1.45, 1.40, and 2.25, respectively), but not at older age, had higher dementia risks than individuals without fatty liver. A U-shaped association was observed for alanine aminotransferase with dementia risk, which was more pronounced in late-life assessment. Our findings highlight dementia burden in high-prevalent NAFLD and the important feature of late-life aminotransaminase as a surrogate biomarker linking liver hypometabolism to dementia. Highlights Although evidence of liver involvement in dementia development has been documented in animal studies, the evidence in humans is limited. Midlife NAFLD raised dementia risk proportionate to severity. Late-life NAFLD was not associated with a high risk of dementia. Low alanine aminotransferase was associated with an elevated dementia risk, especially when measured in late life.