AimsWe aimed to investigate whether peripheral T‐cell subsets could be a biomarker to distinguish major depressive disorder (MDD) and bipolar disorder (BD).MethodsMedical records of hospitalized patients in the Department of Psychiatry, the First Affiliated Hospital, Zhejiang University School of Medicine, from January 2015 to September 2020 with a discharge diagnosis of MDD or BD were reviewed. Patients who underwent peripheral blood examination of T‐cell subtype proportions, including CD3+, CD4+, CD8+ T‐cell, and natural killer (NK) cells, were enrolled. The Chi‐square test, t‐test, or one‐way analysis of variance were used to analyze group differences. Demographic profiles and T‐cell data were used to construct a random forest classifier‐based diagnostic model.ResultsTotally, 98 cases of BD mania, 459 cases of BD depression (BD‐D), and 458 cases of MDD were included. There were significant differences in the proportions of CD3+, CD4+, CD8+ T‐cell, and NK cells among the three groups. Compared with MDD, the BD‐D group showed higher CD8+ but lower CD4+ T‐cell and a significantly lower ratio of CD4+ and CD8+ proportions. The random forest model achieved an area under the curve of 0.77 (95% confidence interval: 0.71–0.83) to distinguish BD‐D from MDD patients.ConclusionThese findings imply that BD and MDD patients may harbor different T‐cell inflammatory patterns, which could be a potential diagnostic biomarker for mood disorders.