Alprazolam (Xanax) is a medication that belongs to the drug class doctors call “benzodiazepines.” People take it to relieve symptoms of anxiety and panic disorders.

The average person eliminates half a Xanax dose from their system in about 11.2 hours, according to the Xanax prescribing information. It can take days before your body fully eliminates Xanax from your system.

However, tests can detect Xanax in a person’s system for much longer. Factors like the dose and a person’s overall health may affect how long this takes.

Keep reading to find out how long Xanax stays in your body — and how long different testing methods may detect it.

Different benzodiazepines work for various amounts of time. For example, midazolam (Nayzilam) is a short-acting benzodiazepine while clonazepam (Klonopin) is a longer-acting one. Xanax is somewhere in the middle.

When you take Xanax, your body absorbs it, and a large part of it binds to circulating proteins. In about 1 to 2 hours, Xanax reaches its peak (maximum) concentration in your body. While doctors don’t know exactly how it works, they do know it depresses the central nervous system to help relieve anxiety.

After that, your body starts breaking it down, and its effects start to lessen.

Just because Xanax stays in your system, doesn’t mean that you feel its effects as long. You’ll usually start to feel less anxious within 1 to 2 hours of taking it. If you take it regularly, you may be able to maintain the concentrations of Xanax in your blood so you don’t feel like it’s worn off.

Pharmaceutical manufacturers also make extended-release versions of Xanax. These are made to last longer in your system so you don’t have to take as much each day. These formulations could last longer in your system.

Doctors can test for the presence of Xanax in a variety of ways. The method may determine how long a test can detect Xanax. These include:

  • Blood. It can vary how long laboratories can detect Xanax in your blood. Most people have about half the dose of Xanax in their blood within a day. However, it can take several days longer for the body to completely eliminate Xanax, according to the Xanax prescribing information. Even if you don’t feel the anxiety-relieving effects anymore, a laboratory may be able to detect Xanax in the blood for up to 4 to 5 days.
  • Hair. Laboratories can detect Xanax in head hair for up to 3 months, according to the United States Drug Testing Laboratories. Because body hair doesn’t usually grow as quickly, a laboratory may test a positive result for up to 12 months after taking Xanax.
  • Saliva. A 2015 study of 25 people using saliva samples found the maximum time Xanax stayed detectable in a person’s oral fluid was 2 1/2 days.
  • Urine. Not all drug tests can identify benzodiazepines or Xanax specifically, according to an article in the Journal Laboratory Medicine. However, some urine drug screens can detect Xanax for up to 5 days.

These timeframes can vary based on how quickly your body breaks down Xanax and the sensitivity of the laboratory test.

Doctors don’t conduct a lot of studies on pregnant women and medications because they don’t want to hurt their babies. This means a lot of medical knowledge comes from reports of or studies that indicate possible problems.

Doctors assume that Xanax does cross the placenta and therefore can affect a baby. Most doctors will recommend stopping taking Xanax at least for the first trimester to try and reduce birth defects.

If you take Xanax while pregnant, it’s possible your baby could be born with Xanax in its system. It’s really important you have an honest discussion with your doctor if you’re pregnant about how much Xanax you take and how it can affect your baby.

Yes, Xanax can pass through breast milk. An older study from 1995 studied the presence of Xanax in breast milk, and found the average half-life of Xanax in breast milk was about 14.5 hours, according to the British Journal of Clinical Pharmacology.

Breastfeeding while taking Xanax could cause a baby to be more sedated, affecting their breathing. Xanax also can reduce the risks for seizures, so when a baby withdraws from Xanax, they could have a seizure.

Most doctors won’t recommend taking Xanax while breastfeeding unless absolutely necessary. They can usually prescribe medicines that are shorter acting or have a different action in the body, so they’re less likely to affect a baby.

Several factors affect how long Xanax stays in your system. Some make it stay in your system longer while others mean it stays in for less time.

Xanax lasts longer in these circumstances:

  • Alcoholic liver disease. Because the liver helps break down Xanax, a person whose liver doesn’t work as well will take longer to break it down. The average half-life for Xanax in this population is 19.7 hours, according to the Xanax prescribing information.
  • Elderly. Older people usually take longer to break down Xanax. The average half-life in an elderly person is about 16.3 hours, according to the Xanax prescribing information.
  • Obesity. The half-life of Xanax in a person with obesity is 21.8 hours on average — that’s 10 hours more than in a person who is “average sized,” according to the Xanax prescribing information.

Xanax may last a shorter amount of time if a person takes certain medications that speed up the elimination of medicines. Doctors call these medicines “inducers.” They include:

Doctors prescribe these medicines to reduce seizure activity.

Other examples that can speed up the elimination of medicines include St. John’s wort, which is a supplement used to improve moods, and rifampin (Rifadin), which is used for infections.

Xanax isn’t the longest-acting benzodiazepines, but it isn’t the shortest either. Your body will usually metabolize most of the Xanax in a day. The rest you may not feel, but will still be there in detectable levels.