Xanax 2 mg bar also known as alprazolam, is a prescription medication used to treat anxiety and panic disorders. This type of medication belongs in a class called benzodiazepines, which work on the brain and central nervous system in order to bring about a calming effect on the user.