Ulcerative colitis (UC) is a disorder of the bowel that is characterized by a chronic inflammatory response. The traditional Chinese herbal medicine ferulic acid (FA) is known for its antioxidant, antiapoptotic, and antiinflammatory properties. However, its role in UC is still unclear. Thus, the current study was conducted to investigate the role of FA in UC. Rats were treated with 2,4,6-triabrobenzene sulfonic acid to induce UC and subjected to FA. Human intestinal microvascular endothelial cells (HIMECs) were treated with tumor necrosis factor-α (TNF-α) and pretreated with FA. Pathological changes in colonic tissues were visualized via hematoxylin-eosin staining. Enzyme linked immunosorbent assay was conducted to detect interleukin (IL)-6, IL-12, and IL-1β levels. Cell morphology was visualized by using a microscope, and viability was detected by using MTT. The percentage of apoptosis was detected via flow cytometry. Western blot analysis was performed to detect the expression of the apoptosis-related proteins thioredoxin-interacting protein (TXNIP) and NOD-like receptor pyrin domain-containing 3 (NLRP3). In vivo FA administration alleviated intestinal injury in UC rats and inhibited inflammatory factor levels (IL-6, IL-12, and IL-1β), apoptosis-related protein expression (caspase-1 and caspase-3) and the TXNIP/NLRP3 signaling pathway. In vitro, TNF-α treatment reduced HIMEC viability, increased cell apoptosis and inflammatory factor levels and activated the TXNIP/NLRP3 signaling pathway. However, FA treatment restored the viability of HIMECs, reduced TNF-α-induced cell apoptosis and inflammation and inhibited the TXNIP/NLRP3 signaling pathway. Furthermore, with increasing FA concentration, the effects were stronger. In summary, FA inhibits the inflammatory injury of endothelial cells in ulcerative colitis or alleviates TNF-α-induced HIMEC injury by inhibiting the TXNIP/NLRP3 signaling pathway.