Xanax is a brand name for alprazolam, which is a medication belonging to the benzodiazepine class. It is primarily used to treat anxiety disorders, panic disorders, and sometimes insomnia.