Introduction Chronic inflammation is one of the causative factors for tumorigenesis. Gastrodin is a main active ingredient isolated from Gastrodia elata Blume, a famous medicinal herb with a long edible history.Aim This study aimed to explore the effects of gastrodin on colitis-associated carcinogenesis (CRC) in mice and to elucidate its potential molecular mechanisms.Methods Balb/c mice were induced with azoxymethane (AOM) and dextran sulfate sodium (DSS) for 12 weeks. Gastrodin (50 mg/kg) was administered via oral gavage three times per week until the end of the experiment. Disease indexes, including body weight, bloody diarrhea, colon length, histopathological score, and tumor size, were measured. Tumor cell proliferation was evaluated by BrdU incorporation assay and tumor cell cytotoxicity was assessed by cell counting kit (CCK-8). The expression levels of toll-like receptor 4 (TLR4)/nuclear factor kappa-B (NF-kappa B) signaling molecules, NF-kappa B luciferase, and pro-inflammatory cytokines were determined by real-time fluorescence quantitative polymerase chain reaction (RT-qPCR), immunoblotting, immunohistochemistry (IHC), enzyme-linked immunosorbent assay (ELISA), or reporter gene assays. The binding affinity between gastrodin and myeloid differentiation protein-2 (MD2) was analyzed by molecular docking and cellular thermal shift assay (CETSA).Results Gastrodin administration was demonstrated to mitigate various CRC-related symptoms in mice, including weight loss, diarrhea, and tissue abnormalities. Notably, gastrodin suppressed tumor cell growth during colitis-associated tumorigenesis, resulting in fewer and smaller adenomas in the colon. Unlike irinotecan, a broad-spectrum antitumor drug, gastrodin did not exhibit apparent cytotoxicity in various colorectal adenocarcinoma cell lines. Additionally, gastrodin downregulated TLR4/NF-kappa B signaling molecules and pro-inflammatory mediators in mice and macrophages. Molecular docking and CETSA experiments suggested that gastrodin binds to the MD2 protein, potentially interfering with the recognition of lipopolysaccharide (LPS) by TLR4, leading to NF-kappa B pathway inhibition.Conclusion This study provides evidence for the first time that gastrodin attenuated colitis and prevented colitis-related carcinogenesis in mice, at least partially, by diminishing tumor-promoting cytokines through the interruption of TLR4/MD2/NF-kappa B signaling transduction.