Numerous previous studies reported that ferulic acid exerts anxiolytic activity. However, the mechanisms have yet to be elucidated. The current study aimed to investigate the anxiolytic effect of trans-ferulic acid (TFA), a stereoisomer of ferulic acid, and evaluated its underlying mechanism using in vivo and computational studies. For this, different experimental doses of TFA (25, 50, and 75 mg/kg) were administered orally to Swiss albino mice, and various behavioral methods of open field, hole board, swing box, and light–dark tests were carried out. Diazepam (DZP), a positive allosteric modulator of the GABAA receptor, was employed as a positive control at a dose of 2 mg/kg, and distilled water served as a vehicle. Additionally, molecular docking was performed to estimate the binding affinities of the TFA and DZP toward the GABAA receptor subunits of α2 and α3, which are associated with the anxiolytic effect; visualizations of the ligand-receptor interaction were carried out using various computational tools. Our findings indicate that TFA dose-dependently reduces the locomotor activity of the animals in comparison with the controls, calming their behaviors. In addition, TFA exerted the highest binding affinity (−5.8 kcal/mol) to the α2 subunit of the GABAA receptor by forming several hydrogen and hydrophobic bonds. Taken together, our findings suggest that TFA exerts a similar effect to DZP, and the compound exerts moderate anxiolytic activity through the GABAergic interaction pathway. We suggest further clinical studies to develop TFA as a reliable anxiolytic agent.