Environmental pH change is a challenge for growth and health of aquatic animals. In this study, the juveniles of Pacific white shrimp Litopenaeus vannamei were exposed to a higher pH 9.5 or a lower pH 6.5 versus a normal pH (pH 8.0) as the control for four weeks. Growth performance, antioxidant capacity, immune functions, and intestinal histological damage and microbiota were evaluated. The weight gain rate was significantly decreased in shrimp at pH 9.5 compared with the control shrimp at pH 8.0. The antioxidant capacities of shrimp as activities of SOD, GSH-Px, GST and MDA contents shown at pH 9.5 or pH 6.5 were significantly reduced relative to the control shrimp. The expressions of immune-related genes, including anti-lipopolysaccharide factor, lysozyme, protein toll, immune deficiency, and hemocyte protein-glutamine gamma-glutamyltransferase, were down-regulated and the intestine tissues were distorted. Histology analysis showed that shrimp gut epithelial cells at pH 6.5 separated from the basement membrane, while epithelial cell necrosis were found in shrimp at pH 9.5. The diversity of intestine microbiota was disturbed with lower Shannon and higher Simpson indices in shrimp at pH 6.5 than the control shrimp, but no differences were found in shrimp at pH 9.5. The intestine barrier functions were weakened as the KEGG analysis shown, where functions for protein or carbohydrate digestion and absorption at pH 6.5, and for antibiotics biosynthesis, including streptomycin, penicillin, cephalosporin, novobiocin, ansamycins and vancomycin, at pH 9.5 in shrimp were significantly decreased. All finding in this study suggest that long-term lower or higher pH stress could adversely affect gut microbiota functions, thus leading to shrimp reduced growth, immunity and antioxidant capacity, and even intestine histology damage.