The effect and mechanism of Heixiaoyao Powder on the polarization of microglia(MG) in APP/PS1 double transgenic mice were explored based on NADPH oxidase 2(NOX2)/reactive oxygen species(ROS)/nuclear factor kappaB(NF-κB) signaling pathway. Fifty 4-month-old male APP/PS1 mice were randomly divided into a model group, an MCC950 group(10 mg·kg~(-1)), and low-, medium-, and high-dose Heixiaoyao Powder groups(6.45, 12.89, and 25.78 g·kg~(-1)). Thirty male C57BL/6J mice of the same age and strain were randomly divided into a blank group, a blank + intragastric intervention group, and a blank + intraperitoneal injection group. Drug intervention lasted 90 days. Morris water maze test was used to detect learning and cognitive ability. Nissl staining and transmission electron microscopy were used to observe the pathological morphology and ultrastructure of hippocampal neurons. Immunofluorescence was used to detect the positive expression of M1-type marker CD16/32~+/Iba-1~+, M2-type marker CD206~+/Iba-1~+ of MG and the expression of hippocampal ROS. The colorimetric method was used to detect the content of malondialdehyde(MDA) and superoxide dismutase(SOD) in the hippocampus. Enzyme linked immunosorbent assay(ELISA) was used to detect the levels of inflammatory factors, including interleukin-6(IL-6), interleukin-8(IL-8), and tumor necrosis factor-α(TNF-α), in the hippocampus. Western blot was used to detect the protein expression of β-amyloid protein(Aβ), Iba-1, CD16/32, CD206, NOX2, NF-κB, p-NF-κB, NF-κB inhibitor alpha(IκBα), and p-IKBα in the hippocampus. The results showed that as compared with the blank group, the model group showed prolonged target quadrant movement distance and escape latency(P<0.01), shortened target quadrant retention time and percentage(P<0.01), disorganized neuronal cells with swelling, nuclear disappearance or bias, reduced number of cells, dissolved or absent Nissl bodies, and a clear area in the cytoplasm, damaged and shrunk cell membrane with abnormal cell morphology, few organelles in the cytoplasm, reduced and swollen mitochondria, increased MG M1-type marker CD16/32~+/Iba-1~+(P<0.01), decreased M2-type marker CD206~+/Iba-1~+(P<0.01), increased ROS activity and MDA content(P<0.01), decreased SOD level(P<0.01), elevated inflammatory factors IL-6, IL-8, and TNF-α(P<0.01), up-regulated protein expression and phosphorylation of Aβ, CD16/32, Iba-1, NOX2, NF-κB, and IKBα(P<0.01), and down-regulated CD206(P<0.01). There was no statistically significant difference between the blank group, the blank + intragastric intervention group, and the blank + intraperitoneal injection group. After the intervention of Heixiaoyao Powder, the Heixiaoyao Powder groups showed shortened target quadrant movement distance and escape latency(P<0.01), prolonged target quadrant retention time and percentage(P<0.01), increased and neatly arranged cells with relieved swelling, increased Nissl bodies, regular cell morphology, and intact cell membrane, relieved swelling of mitochondria, slightly expanded endoplasmic reticulum, decreased CD16/32~+/Iba-1~+(P<0.05 or P<0.01), increased CD206~+/Iba-1~+(P<0.01), decreased ROS activity and MDA content(P<0.01), increased SOD level(P<0.01), decreased content of inflammatory factors IL-6, IL-8, and TNF-α(P<0.01), down-regulated protein expression and phosphorylation of Aβ, CD16/32, Iba-1, NOX2, NF-κB, and IKBα(P<0.01), and up-regulated CD206(P<0.01). In conclusion, Heixiaoyao Powder can alleviate neuronal damage and improve the learning and memory abilities of APP/PS1 mice. The mechanism of action may be related to the inhibition of NOX2/ROS/NF-κB signaling pathway, regulating the polarization of MG, increasing the expression of M2 type, inhibiting the expression of M1 type, and reducing the release of inflammatory factor.