This paper presents a preliminary study on whether low-frequency transcranial magnetic stimulation (LF-TMS) can modulate the gut microbiota in mice with chronic unpredictable mild stress (CUMS). Mice received LF-TMS (1 Hz, 20 mT) for 28 consecutive days under chronic unpredictable mild stress (CUMS). The composition of gut microbiota of stool samples were tested. CUMS caused significant changes in gut microbiotas, specifically in community diversity of gut microbiotas (P < .05). Compared with the stressed group mice, the Chao1 index (P < .05), Observed species index (P < .05), Faith's PD index (P < .05) and Shannon index (P < .05) of the LF-TMS treatment group were significantly increased. Furthermore, 1 Hz LF-TMS-treatment partially recovered chronic stress induced changes of microbiotas, such as the abundance of Chloroflexi, Actinobacteria. These results manifested that LF-TMS treatment can improve the anhedonic behaviors caused by CUMS in mice, which are connected with regulating the related intestinal microbial community disturbance, including species diversity, structure of gut microbiota, and species composition.