Xanax is the branded name for the generic medication called alprazolam. Xanax is a prescription drug used to treat anxiety disorders and anxiety that is caused by depression. It can also be used for sleeping disorders (such as insomnia). Xanax is also used to treat patients suffering from panic disorders / panic attacks induced by situations that cause panic such as embarrassment, social anxiety, and helplessness. Xanax is a drug that works by regulating abnormal excitement stimulation in the brain.