Abstract The etiology of neuropathic pain is mostly due to mechanical deformation and neuroinflammation, of which neuroinflammation is the main cause of chronic neuropathic pain. Activation of the TLR4/NF-κB signaling pathway mediates elevated levels of inflammatory cytokines, and we clearly demonstrated by in vivo and in vitro Western blot experiments that β-sitosterol significantly inhibited the elevated TLR4 expression levels and NF-κB activation associated with inflammatory responses. In cellular experiments, we could clearly see that both β-sitosterol and TLR4/NF-κB signaling pathway inhibitor could inhibit M1 pro-inflammatory phenotype expression and promote M2 anti-inflammatory phenotype expression in microglia GMI-R1 by flow cytometry and immunofluorescence assays. Therefore, we suggest that β-sitosterol can affect microglia polarization by inhibiting TLR4/NF-κB signaling pathway thereby reducing neuroinflammation and thus alleviating neuropathic pain.