3,3′-Diindolylmethane (DIM) has attracted extensive attention due to its bioactivity, and is applied to the fields of food, medicine and so on. In the study, DIM was isolated from the flaxseed meal-xylose-tryptophan Maillard reaction products. Its formation mechanism was investigated using the isotope labeling method. The reactive sites in DIM were analyzed by quantum chemistry calculation. The results showed that the Maillard reaction of tryptophan and xylose produced indole-3-formaldehyde, which further reacted to generate indole-3-methanol. Indole-3-methanol was unstable and eventually formed DIM. The molecular structure of DIM was determined and then the best configuration was obtained by frequency calculation. The molecular potential energy and frontier molecular orbital analysis showed that the main action site in DIM was near the indole ring. This study may provide a theoretical basis for in-depth studies on the relationship between the molecular structure and properties of DIM, broaden its applications in food, and offer a reference for the rational development of functional foods.