The aim of this study was to investigate the effects of the high level of xylooligosaccharides (XOS) on growth performance, antioxidant capability, immune function, and fecal microbiota in weaning piglets. The results showed that 28 d body weight exhibited linear and quadratic increases (P < 0.05) with increasing dietary XOS level, as well as average daily feed intake (ADFI) on d 15–28, average daily gain (ADG) on d 15–28 and 1–28. There was a linear decrease (P < 0.05) between XOS levels and feed conversion rate (FCR) on d 1–14 and 1–28. Additionally, glutathione peroxidase (GSH-Px) showed a linear increase (P < 0.05), while the malondialdehyde (MDA) level decreased linearly and quadratically (P < 0.05) with the increasing dietary level of XOS. Moreover, the XOS treatments markedly increased the levels of immunoglobulin A (Ig A) (linear, P < 0.05; quadratic, P < 0.05), IgM (quadratic, P < 0.05), IgG (linear, P < 0.05), and anti-inflammatory cytokine interleukin-10 (IL-10) (quadratic, P < 0.05) in serum, while the IL-1β (linear, P < 0.05; quadratic, P < 0.05) and IL-6 (linear, P < 0.05) decreased with increasing level of XOS. Microbiota analysis showed that dietary supplementation with 1.5% XOS decreased (P < 0.05) the α-diversity and enriched (P < 0.05) beneficial bacteria including Lactobacillus, Bifidobacterium, and Fusicatenibacter at the genus level, compared with the control group. Importantly, linearly increasing responses (P < 0.05) to fecal acetate, propionate, butyrate, and total short-chain fatty acids (SCFAs) were observed with increasing level of XOS. Spearman correlation analyses found that Lactobacillus abundance was positively correlated with ADG, acetate, propionate, and IgA (P < 0.05), but negatively correlated with IL-1β (P < 0.05). Bifidobacterium abundance was positively related with ADFI, total SCFAs, IgG, and IL-10 (P < 0.05), as well as g_Fusicatenibacter abundance with ADFI, total SCFAs, and IL-10. However, Bifidobacterium and Fusicatenibacter abundances were negatively associated with MDA levels (P < 0.05). In summary, dietary supplementation with XOS can improve the growth performance in weaning piglets by increasing antioxidant capability, enhancing immune function, and promoting beneficial bacteria counts.