Hepatic ischemia reperfusion injury (IRI) is a risk factor for early graft nonfunction and graft rejection after liver transplantation (LT). The process of liver IRI involves inflammatory response, oxidative stress, apoptosis and other pathophysiological processes. So far, there is still a lack of effective drugs to ameliorate liver IRI. Trans-anethole (TA) is an aromatic compound. Many medications as well as natural foods contain TA. TA has multiple effects such as anti-inflammation, anti-oxidative stress and anti-apoptosis. However, the mechanism of TA pretreatment in liver IRI is unclear. The mice hepatic IRI model was constructed after gavage pretreatment with TA (10 mg/kg, 20 mg/kg, 40 mg/kg) for 7 consecutive days. Our study confirmed that TA pretreatment significantly improve liver function and reduce serum AST, ALT in hepatic IRI. HE staining showed that TA pretreatment alleviated liver injury. Meanwhile, TA (20 mg/kg) pretreatment attenuated hepatocyte apoptosis in hepatic IRI. In addition, TA (20 mg/kg) pretreatment reduced the inflammatory factors TNF-α, IL-6 and infiltration of CD11b positive cells in liver tissues during hepatic IRI in mice. TA pretreatment also alleviated oxidative stress in mice hepatic IRI. Our study further indicated that TA pretreatment attenuated mice hepatic IRI through inhibiting NLRP3 inflammasome activation via regulation of soluble epoxide hydrolase (sEH). This study provides a novel and effective potential drug with few side effects for easing liver IRI.