Xanax (alprazolam) can stay in the body for anywhere from about 31 hours to as long as 134.5 hours (approximately 1.3 to 5.6 days), depending on individual factors. The drug's effects typically wear off within 8 to 12 hours, but the presence of the drug in the system can be detected for 2 to 5 days or even longer in some cases. The average half-life of Xanax is about 11 hours, meaning it takes about 11 hours for the body to eliminate half of the dose. After about 4 to 5 half-lives (around 2 to 3 days), most of the drug is eliminated from the body, though detection windows depend on the testing method and individual metabolism. Factors such as age, weight, liver and kidney function, metabolism, dosage, and frequency of use influence how long Xanax stays in the system.