Polycystic ovary syndrome (PCOS) represents an endocrine disorder, which is closely related with gut microbiota. Inulin, a kind of probiotics, has been proven to alleviate gut microbiota dysbiosis. Metformin, a biguanide agent, shows beneficial effects on chronic metabolic diseases. Our objective was to assess the effects and associated mechanisms of inulin and metforin on attenuation of PCOS in mice. Mice were divided into 4 groups: control group (CON), model group (MOD), inulin group (INU), metformin group (MET). The last three groups were fed 6 mg of dehydroepiandrosterone (DHEA) per 100 g body weight and 60% high-fat diet to generate mice model. After 21 days of intervention, mice were euthanized and associated indications were investigated. Body weight (BW) and testosterone (T) levels were significantly decreased, but estradiol (E2) levels were increased in INU or MET group, respectively. Ovary HE staining demonstrated that inulin or metformin ameliorated PCOS morphology. Inflammatory indicators from plasma and ovary including TNF-α, IL-6, and IL-17A were decreased in INU or MET group. Moreover, IL-10 in ovary of INU or MET group was increased. Sequencing and analysis of gut microbiota showed that compared to MOD group, Bifidobacterium was increased, but Proteobacteria, Helicobacter and Parasutterella were decreased in INU group. Helicobacter was decreased in MET group. Correlation analysis showed that gut microbiota was correlated with inflammatory factors. Our results revealed that inulin and metformin alleviated PCOS via anti-inflammation and modulating gut microbiota, which may contribute to potential clinical therapy for the disease.