Background: Tannic acid (TA) is potential to reduce diarrhea in weaning pigs, but knowledge about the influence of TA on intestinal barrier integrity and function is still scarce. This experiment was conducted to investigate the effects of dietary TA supplementation on growth performance, diarrhea rate, intestinal barrier integrity and function of weaned pigs. Methods: A total of 108 crossbred (Duroc × Landrace × Yorkshire) piglets, with an initial average body weight of 6.60 ± 0.27 kg, were allotted to 3 groups (6 pigs/pen and 6 replicates/group) in a randomized complete block design according to their gender and body weight. Piglets were fed the basal diet with 0 (control, CON), 0.2% and 1.0% TA, respectively. The trial lasted for 28 d. Results: Compared with the CON group, dietary 0.2% and 1.0% TA supplementation didn't affect ADFI, ADG and F: G (P > 0.05), but reduced diarrhea rate, diarrhea index and diarrhea score of piglets (P < 0.05), reduced diamine oxidase (DAO) activity and D-lactic acid concentration in serum (P < 0.01). The higher occludin expression and localization were observed in the duodenum, jejunum and ileum after supplementation with 0.2% or 1.0% TA (P < 0.05). Adding 0.2% TA to diet significantly decreased crypt depth, increased villus height/crypt depth ratio in the duodenum (P < 0.05), and dietary 1.0% TA tended to decrease crypt depth (P < 0.10) and significantly decreased villus height (P < 0.05) of the ileum. Moreover, lower malondialdehyde content in the ileum was detected in the pigs fed 1.0% TA (P < 0.05). In the duodenum, both 0.2% and 1.0% TA groups had higher occludin (OCLN) mRNA and 0.2% TA group had higher zonula occludens-2 (ZO-2) level (P < 0.05). Meanwhile, dietary 1.0% TA supplementation tended to up-regulate OCLN mRNA levels in the jejunum (P < 0.10) and 0.2% TA supplementation tended to up-regulate zonula occludens-1 (ZO-1) mRNA levels in the ileum (P < 0.10). Conclusion: In conclusion, dietary supplementation of 0.2% or 1.0% TA could effectively alleviate postweaning diarrhea without altering growth performance in weaned piglets, which might be achieved by improving intestinal barrier integrity and function.