Myocardial contractile dysfunction caused by sepsis is a serious threat to human health, and its pathogenesis is not completely clear. It is generally believed that excessive inflammation and oxidative stress are the main causes of myocardial damage caused by sepsis. Pterostilbene (PTS) has a variety of biological activities, including anti-oxidant, anti-inflammatory, and anti-aging. Whether PTS protect myocardial function in rats with sepsis through anti-inflammatory and anti-oxidant effects has not been reported. In this study, we investigated the role of PTS in septic mice induced by lipopolysaccharide (LPS). Mice were injected intraperitoneally with LPS (20 mg/kg) to simulate sepsis. Use Echocardiography, Masson, DHE, H&E, IHC, IF and other experimental methods to explore the effects of PTS on LPS. The results showed that PTS was indicated to significantly increase the cardiac function of mice with sepsis. PTS treatment also reduced the mRNA expression of IL-1α, IL-6, MCP-1, and IL-1β and the protein expression of NLRP3 in vivo and in vitro, and inhibited the migration of inflammatory cells. PTS treatment also reduced the mRNA expression of collagen I, collagen III and α-SMA, and inhibited fibrosis. PTS treatment reduced the mRNA expression of NOX1, NOX2, and NOX4 and inhibited DHE levels in vivo and in vitro. In summary, our data indicated that PTS played a crucial role in LPS-induced myocardial injured and might be a key target for the prevention and treatment of sepsis-induced myocardial dysfunction.