Ulcerative colitis is a chronic disease with colonic mucosa injury. Nitazoxanide is an antiprotozoal drug in clinic. Nitazoxanide and its metabolite tizoxanide have been demonstrated to activate AMPK and inhibit inflammation, therefore, the aim of the present study is to investigate the effect of nitazoxanide on dextran sulfate sodium (DSS)-induced colitis and the underlying mechanism. Oral administration of nitazoxanide ameliorated the symptoms of mice with DSS-induced colitis, as evidenced by improving the increased disease activity index (DAI), the decreased body weight, and the shortened colon length. Oral administration of nitazoxanide ameliorated DSS-induced intestinal barrier dysfunction and reduced IL-6 and IL-17 expression in colon tissues. Mechanistically, nitazoxanide and its metabolite tizoxanide treatment activated AMPK and inhibited JAK2/STAT3 signals. Nitazoxanide and tizoxanide treatment increased caudal type homeobox 2 (CDX2) expression, increased alkaline phosphatase (ALP) activity and promoted tight junctions in Caco-2 cells. Nitazoxanide and tizoxanide treatment restored the decreased zonula occludens-1(ZO-1) and occludin protein levels induced by LPS or IL-6 in Caco-2 cells. On the other hand, nitazoxanide and tizoxanide regulated macrophage bias toward M2 polarization, as evidenced by the increased arginase-1expression in bone marrow-derived macrophages (BMDM). Nitazoxanide and tizoxanide reduced the increased IL-6, iNOS and CCL2 pro-inflammatory gene expressions and inhibited JAK2/STAT3 activation in BMDM induced by LPS. In conclusion, nitazoxanide protects against DSS-induced ulcerative colitis in mice through improving intestinal barrier and inhibiting inflammation and the underlying mechanism involves AMPK activation and JAK2/STAT3 inhibition.