Xanax is the brand name for alprazolam, a medication in the benzodiazepine class. It is commonly prescribed to treat anxiety disorders, panic disorders, and occasionally insomnia. Xanax works by enhancing the effect of a neurotransmitter called GABA (gamma-aminobutyric acid), which has a calming effect on the brain and nervous system.