Hydroxysafflower yellow A (HSYA) protects against acute kidney injury through TLR4/NF-κB pathway. However, the effect and potential mechanism of HSYA in ulcerative colitis (UC) have been rarely reported, which is thus investigated in this research. An in vivo UC model was established by oral administration of 5% dextran sulfate sodium (DSS) in Sprague-Dawley rats. After HSYA treatment, the daily body weight and colon length of rats were measured. Then rat colon tissues, myeloperoxidase (MPO) activity, and the levels of inflammatory cytokines were examined by histopathological examination (HE) staining, immunohistochemistry, ultraviolet spectrophotometry, and enzyme-linked immune sorbent assay (ELISA) respectively. The activated TLR4/NF-κB pathway was detected by Western blot. RAW 264.7 cell viability was detected by MTT assay after lipopolysaccharide (LPS) treatment, and ELISA and Western blot were performed again to investigate the effects of HSYA on LPS-treated cells. DSS administration increased body weight and colon length of rats and induced colon tissue injury. DSS or LPS treatment up-regulated the levels of TNF-α, IL-1β, and IL-6 and activated TLR4/NF-κB pathway of colon tissues and cells, respectively. HSYA partially reversed the above effect of DSS and LPS treatment, and the effects of the drug were improved with the dosage. Taken together, HSYA alleviates UC by suppressing TLR4/NF-κB signaling pathway, which may provide a new insight for the treatment of UC.