Objective To observe the effects of berberine on gut microbiota of rats with non-alcoholic fatty liver disease (NAFLD) induced by high-fat diet. Methods A total of 18 male SD rats were randomly divided into the normal diet group (ND group, n=6), high-fat diet-induced NAFLD group (NAFLD group, n=6), and high-fat diet-induced NAFLD intervened by berberine group (berberine intervention group, n=6). Changes of gut microbiota were investigated by the 16SrRNA gene sequence analysis and morphological changes of liver and ileum tissue were observed. Results Gut microbiota were mainly Firmicutes and Bacteroidetes. Compared with the ND group, the ratio of Firmicutes of the NAFLD group was significantly higher (P<0.05), while ratios of Bacteroidetes and beneficial bacteria Lactobacillus were significantly lower (P<0.01). Compared with the NAFLD group, the ratio of Firmicutes of the berberine intervention group was significant lower (P<0.01), while ratios of Bacteroidetes and beneficial bacteria Lactobacillus were significantly higher (P<0.01). Results of the liver histological examination of liver showed that the arrangement of hepatic cells of the ND group was normal and fatty infiltration and inflammatory cell infiltration were not observed. Compared with the ND group, the arrangement of hepatic cells of the NAFLD group was disordered and much steatosis was observed. The steatosis was observed in liver tissues of the berberine intervention group, but less serious than the NAFLD group. Results of the histological examination of ileum showed that the ileum mucosal villus of the ND group arranged neatly and tight and the surface structure was integrated. The ileum mucosal villus of the NAFLD group was broke or lost and the gap of intervillous space widened. The ileum mucosal villus of the berberine intervention group arranged relatively neatly and less ileum mucosal villus was broke or lost than that of the NAFLD group. Conclusion Berberine can relieve the non-alcoholic fatty liver disease induced by high fat diet. The mechanism may be relevant to the changes of structure of gut microbiota and the decrease of intestinal mucosa damages caused by high-fat diet.