ABSTRACT Traumatic brain injury (TBI) is a leading cause of death and disability. This study aims to reveal the molecular mechanism of TBI through bioinformatics and explore the neuroprotective role of anisodamine (ANI). Three TBI‐related microarray datasets (GSE59645, GSE111452 and GSE58484) were downloaded, and analyzed for obtaining differentially expressed genes (DEGs). The genes in the intersection were analyzed with gene ontology (GO) analysis and Kyoto Encyclopedia of Genes and Genomes (KEGG) enrichment analysis, and a protein‐protein interaction (PPI) network was constructed. Cytoscape was used to construct pharmacological networks and identify hub genes. Molecular docking was applied to evaluate the ability of an active ingredient to bind to a target, and the binding ability between ANI and HMOX1 were further validated by molecular dynamics simulation and cellular thermal shift assay. Lipopolysaccharide (LPS) induced microglia activation was used to simulate TBI conditions in vitro , and then the effects of ANI were tested. Cell viability was assessed by cell counting Kit 8, levels of inflammatory cytokines and NO were detected by qRT‐PCR and Griess reagent, and apoptosis levels were detected by flow cytometry. TBI mouse models were constructed by controlled cortical impact (CCI), and after ANI treatment, the neurological injury was evaluated by mNSS, TTC staining, wet‐dry method, HE staining, Nissl staining and TUNEL staining. 248 TBI‐related DEGs were identified. These genes were significantly associated with inflammatory response. 6 core genes were further identified, including CCL2, CD44, TIMP1, SERPINE1, HMOX1 and CCNA2. Both scoparone and anisodamine (ANI) had good binding activity with these 6 proteins. In vitro experiments confirmed that ANI inhibited the activation of microglia and reduce neuroinflammation and apoptosis, partly via modulating HMOX1. In vivo experiments validated that ANI could significantly improve neurological function and suppressed neuronal apoptosis in TBI model. ANI exerts neuroprotective function in the secondary injury of TBI, suggesting it is an option to treat TBI, and the treatment time window and safety requires further exploration in the following work.