Serum uric acid (SUA), a causative agent for gout, is linked to dietary factors, perhaps differentially by race. Cross-sectional (SUAbase, i.e. baseline SUA) and longitudinal (SUArate; i.e. annual rate of change in SUA) associations of SUA with diet were evaluated across race and sex–race groups, in a large prospective cohort study of urban adults. Of 3720 African American (AA) and White urban adults participating in the Healthy Aging in Neighborhoods of Diversity across the Life Span study, longitudinal data (2004–2013, k=1·7 repeats, follow-up, 4·64 (sd 0·93) years) on n 2138 participants were used. The main outcome consisted of up to two repeated measures on SUA. Exposures included the dietary factors such as ‘added sugar’, ‘alcoholic beverages’, ‘red meat’, ‘total fish’, ‘legumes’, ‘total dairy product’, ‘caffeine’, ‘vitamin C’ and a composite measure termed ‘dietary urate index’. Mixed-effects linear regression models were conducted, stratifying by race and by race×sex. A positive association between legume intake and SUArate was restricted to AA, whereas alcohol intake was positively associated with SUAbase overall without racial differences. Added sugars were directly related to SUAbase among White men (P<0·05 for race×sex interaction), whereas dairy product intake was linked with slower SUArate among AA women, unlike among White women. Nevertheless, dairy product intake was associated with a lower SUAbase among Whites. Finally, the dietary urate index was positively associated with both SUAbase and SUArate, particularly among AA. In sum, race and sex interactions with dietary intakes of added sugars, dairy products and legumes were detected in determining SUA. Similar studies are needed to replicate these findings.