Xanax, also known by its generic name alprazolam, is a prescription medicine that belongs to a group of medications called benzodiazepines. Doctors may prescribe alprazolam for certain anxiety and panic disorders. It works by affecting activity in the brain and nervous system, helping produce a calming effect.