BackgroundGut microbiota-based therapeutic strategies, such as probiotic and prebiotic preparations, may benefit mental health. However, commonly consumed fermented and prebiotic-containing foods have not been well-tested. The aim of the present study was to determine whether consumption of fermented food and food-derived prebiotics is associated with cognitive performance, depressive, and anxiety symptoms in psychiatrically healthy medical students under psychological stress.MethodsThe study protocol with data analysis plan was prospectively registered. Food consumption was evaluated with a 7-day dietary record. Cognitive performance was modeled with academic examination performance in relation to subject knowledge. Pre-exam depressive and anxiety symptoms were assessed with the Patient Health Questionnaire-9 and Generalized Anxiety Disorder-7, respectively.ResultsIn total, 372 medical students (22.7 ± 1.1 years of age, 66% female) completed the study. No relationship was observed between cognitive performance under stress and either fermented food (adjusted β 0.02, 95% CI −0.07–0.11, p = 0.63) or food-derived prebiotics consumption (adjusted β −0.00, 95% CI −0.09–0.09, p = 0.99). High intake of fermented food was associated with more severe depressive (adjusted β 0.11, 95% CI 0.01–0.20, p = 0.032) and anxiety symptoms under stress (adjusted β 0.13, 95% CI 0.04–0.22, p = 0.0065); however, no such link was observed for food-derived prebiotics (adjusted β 0.03, 95% CI −0.07–0.13, p = 0.50 and −0.01, 95% CI −0.11–0.08, p = 0.83, for depression and anxiety, respectively).ConclusionsUnder psychological stress in medical students, consumption of fermented food and food-derived prebiotics appears to be not associated with cognitive performance. High intake of fermented food, but not food-derived prebiotics, may be associated with severity of depressive and anxiety symptoms. The safety of fermented food in this regard therefore requires further clarification.