The currently available clinical therapeutic drugs for ulcerative colitis (UC) are considered inadequate owing to certain limitations. There have been reports on the anti-inflammatory effects of 2'-hydroxycinnamaldehyde (HCA). However, whether HCA can improve UC is still unclear. Here, we aimed to investigate the pharmacological effects of HCA on UC and its underlying molecular mechanisms. The pharmacological effects of HCA were comprehensively investigated in 2 experimental setups: mice with dextran sulfate sodium (DSS)-induced colitis and lipopolysaccharide (LPS)-treated fetal human colon (FHC) cells. Furthermore, the interaction between HCA and signal transducer and activator of transcription 3 (STAT3) was investigated using molecular docking. The FHC cells with STAT3 knockdown or overexpression and mice with intestinal epithelium-specific STAT3 deletion (STAT3ΔIEC) were used to evaluate whether STAT3 mediated the pharmacological effects of HCA. 2'-Hydroxycinnamaldehyde attenuated dysregulated expression of inflammatory cytokines in a dose-dependent manner while increasing the expression of tight junction proteins, reducing the apoptosis of intestinal epithelial cells, and effectively alleviating inflammation both in vivo and in vitro. 2'-Hydroxycinnamaldehyde bound directly to STAT3 and inhibited its activation. The modulation of STAT3 activation levels due to STAT3 knockdown or overexpression influenced the mitigating effects of HCA on colitis. Further analysis indicated that the remission effect of HCA was not observed in STAT3ΔIEC mice, indicating that STAT3 mediated the anti-inflammatory effects of HCA. We present a novel finding that HCA reduces colitis severity by attenuating intestinal mucosal barrier damage via STAT3. This discovery holds promise as a potential new strategy to alleviate UC.