This cohort study examines the association between soft drink consumption and major depressive disorder diagnosis and severity and whether this association is mediated by changes in the gut microbiota.