The objective of this study was to investigate the effects of l-carnitine and/or maize distillers dried grains with solubles (DDGS) in diets of gestating and lactating sows on the intestinal barrier functions of their offspring. The experiment was designed as a 2×2 factorial with two dietary treatments (soyabean meal v. DDGS) and two l-carnitine levels (0 v. 100 mg/kg in gestating diets and 0 v. 200 mg/kg in lactating diets). Sows (Landrace×Large White) with an average parity of 4·2 with similar body weight were randomly assigned to four groups of thirty each. Dietary supplementation with l-carnitine increased the total superoxide dismutase activity but decreased the concentration of malondialdehyde of the jejunal mucosa in newborn piglets and weaning piglets on day 21. Dietary supplementation with l-carnitine decreased the concentrations of IL-1β, IL-12 and TNF-α in the jejunal mucosa of newborn piglets and decreased the concentrations of IL-6 and TNF-α in the jejunal mucosa of weaning piglets on day 21. There was an interaction between dietary treatment and l-carnitine on the bacterial numbers of total eubacteria in the digesta of caecum in weaning piglets on day 21. Bacterial numbers of total eubacteria in weaning piglets on day 21 were significantly increased by l-carnitine only in soyabean meal diet, but there was no significant effect of l-carnitine in DDGS-based diet. Dietary supplementation with l-carnitine increased the bacterial numbers of Lactobacillus spp. and bifidobacteria spp. in the digesta of caecum in weaning piglets on day 21. Dietary supplementation with l-carnitine in sows affected the expression of tight junction proteins (claudin 1, zonula occludens-1 (ZO-1) and occludin) in the jejunal mucosa of their offspring by increasing the expression of ZO-1 mRNA in the jejunal mucosa of newborn piglets, and by increasing the expression of ZO-1 and occludin mRNA in the jejunal mucosa of weaning piglets on day 21. In conclusion, dietary supplementation with l-carnitine in gestating and lactating sows had positive effects on intestinal barrier functions of newborn piglets and weaning piglets on day 21, but it did not have effects on intestinal barrier functions of growing–finishing pigs in the filial generation. There were no effects of dietary treatment of sows on intestinal barrier functions in their offspring.