BackgroundGut microbiota may influence metabolic pathways related to chronic health conditions. Evidence for physical activity and diet influences on gut microbial composition exists, but data from diverse population-based cohort studies are limited. ObjectivesWe hypothesized that gut microbial diversity and genera are associated with physical activity and diet quality. MethodsData were from 537 participants in the Coronary Artery Risk Development in Young Adults (CARDIA) Study, a prospective cohort, who attended the year 30 follow-up examination (2015–2016; aged 47–61 y; 45% Black race/55% White race; 45% men/55% women). The 16S ribosomal RNA marker gene was sequenced from stool DNA, and genus-level taxonomy was assigned. Within-person microbial diversity (α-diversity) was assessed with Shannon diversity index and richness scores; between-person diversity (β-diversity) measures were generated with principal coordinates analysis (PCoA). Current and long-term physical activity and diet quality measures were derived from data collected over 30 y of follow-up. Multivariable-adjusted regression analysis controlled for: sociodemographic variables (age, race, sex, education, and field center), other health behaviors (smoking, alcohol consumption, and medication use), and adjusted for multiple comparisons with the false discovery rate (<0.20). ResultsBased on PCoA β-diversity, participants’ microbial community compositions differed significantly (P < 0.001), with respect to both current and long-term physical activity and diet quality. α-Diversity was associated only with current physical activity (positively) in multivariable-adjusted analysis. Multiple genera (n = 45) were associated with physical activity and fewer with diet (n = 5), including positive associations with Lachnospiraceae UCG-001 and Ruminococcaceae IncertaeSedis with both behaviors. ConclusionsPhysical activity and diet quality were associated with gut microbial composition among 537 participants in the CARDIA study. Multiple genera were associated with physical activity. Physical activity and diet quality were associated with genera consistent with pathways related to inflammation and short-chain fatty acid production.