How long Xanax stays in urine depends on the dose of Xanax taken, and if it’s been taken frequently in the past. For example, traces of Xanax can be found in urine for at least a week – sometimes up to six weeks after the medication was last taken.