ImportancePhysical activity (PA) is recommended for preventing and treating nonalcoholic fatty liver disease (NAFLD). Yet, how long-term patterns of intensity-based physical activity, including moderate-intensity PA (MPA) and vigorous-intensity PA (VPA), might affect the prevalence of NAFLD in middle age remains unclear.ObjectiveTo identify distinct intensity-based PA trajectories from young to middle adulthood and examine the associations between PA trajectories and NAFLD prevalence in midlife.Design, Setting, and ParticipantsThis population-based cohort of 2833 participants used the Coronary Artery Risk Development in Young Adults study data. The setting included field clinics in Birmingham, Alabama; Chicago, Illinois; Minneapolis, Minnesota; and Oakland, California. Data analysis was completed in March 2023.ExposuresPA was self-reported at 8 examinations over 25 years (1985-1986 to 2010-2011) and separately scored for MPA and VPA.Main Outcomes and MeasuresNAFLD was defined as liver attenuation values less than 51 Hounsfield units after exclusion of other causes of liver fat, measured using computed tomography in year 25 (2010-2011).ResultsAmong a total of 2833 participants included in the sample, 1379 (48.7%) self-identified as Black, 1454 (51.3%) as White, 1206 (42.6%) as male, and 1627 (57.4%) as female from baseline (1985-1986) (mean [SD] age, 25.0 [3.6] years) to year 25 (2010-2011) (mean [SD] age, 50.1 [3.6] years). Three MPA trajectories were identified: very low stable (1514 participants [53.4%]), low increasing (1096 [38.7%]), and moderate increasing (223 [7.9%]); and 3 VPA trajectories: low stable (1649 [58.2%]), moderate decreasing (1015 [35.8%]), and high decreasing (169 [6.0%]). After adjustment for covariates (sex, age, race, study center, education, smoking status, and alcohol consumption), participants in the moderate decreasing (risk ratio [RR], 0.74; 95% CI, 0.54-0.85) and the high decreasing (RR, 0.59; 95% CI, 0.44-0.80) VPA trajectories had a lower risk of NAFLD in middle age, relative to participants in the low stable VPA trajectory. Adjustments for baseline body mass index and waist circumference attenuated these estimates, but the results remained statistically significant. The adjusted RRs across the MPA trajectories were close to null and not statistically significant.Conclusions and RelevanceThis cohort study of Black and White participants found a reduced risk of NAFLD in middle age for individuals with higher levels of VPA throughout young to middle adulthood compared with those with lower VPA levels. These results suggest the need for promoting sustainable and equitable prevention programs focused on VPA over the life course to aid in lowering NAFLD risk.