Plastics have been proven to be a potential threat to the ecosystem, and their toxicity mechanism is still uncertain. In the ecological environment, plastics can be degraded into microplastics (MPs) and nanoplastics (NPs), which can be contaminated and ingested through the food chain. MPs and NPs are associated with severe intestinal injury, intestinal microbiota disorder, and neurotoxicity, but it is still unclear whether MPs- and NPs-induced intestinal microbiota dysbiosis will affect the brain through the gut-brain axis. In the current study, we determined the effects of exposure to polystyrene (PS)-MPs and PS-NPs on anxiety-like behaviors and explored the underlying mechanisms. This study explored the behavioral effects of 30-day and 60-day exposure to PS-NPs and PS-MPs using the open field test (OFT) and elevated plus maze (EPM) test. Behavioral tests showed PS-NPs and PS-MPs treatment remarkedly induced anxiety-like behaviors compared with the control group. Using 16 S rRNA gene sequencing and untargeted metabolomics analyses, we observed that PS-MPs and PS-NPs exposure reduced the beneficial gut microbiota expression level, such as Lachnoclostridium and Lactobacillus, and increased the conditionally pathogenic bacteria expressions level, such as Proteobacteria, Actinobacteria, and Desulfovibrio. In addition, PS-NPs and PS-MPs reduce intestinal mucus secretion and increase intestinal permeability. The results of serum metabonomics suggested that the metabolic pathways, such as ABC transporter pathways, aminoacyl-tRNA biosynthesis, biosynthesis of amino acids, and bile secretion were enriched after PS-NPs and PS-MPs treatment. Besides, neurotransmitter metabolites were also altered by PS-NPs and PS-MPs. It is noteworthy that the correlation analysis showed that the disorder of intestinal microbiota was related to anxiety-like behaviors and neurotransmitter metabolites disorder. The regulation of intestinal microbiota may be a promising treatment strategy for PS-MPs- and PS-NPs-induced anxiety disorder.