How Long Does It Take for Medication to Get Out of Your System?

Opioids

Nervous about an upcoming urine drug test? It’s normal to feel worried about what might show up on the results.

Whatever the reason, knowing a drug’s detection time can help you feel more prepared. So, how long does it take for medication to get out of your system?

Below, we’ve outlined the typical timelines for both prescription and illicit drugs.

Understanding Drug Half-Life and Elimination

Before we talk about how long a drug stays in your system, let’s start with a key term: the half-life.

Half-life is the length of time it takes for your body to reduce the amount of the drug by half.

A shorter half-life means your body clears the substance faster. However, it also tends to cause more intense, quick-onset withdrawal symptoms.

It typically takes about five to six half-lives for a drug to be almost completely gone from your system.

However, that doesn’t mean it’s no longer undetectable.

Even after the main drug is gone, leftover byproducts called metabolites can still be found on a drug test.

So, you might pass a blood test but still test positive in a urine, saliva, or hair test days (or even weeks) later.

Common Factors That Affect Drug Elimination

So, what makes prescription drugs (or illicit substances) stay in your system longer? The answer depends on these factors:

  • Type of drug
  • Drug’s half-life (the longer the half-life, the more time it takes to clear out)
  • Frequency of use
  • Dose taken
  • Method of use (oral, injection, snorting)
  • Metabolism rate (the faster the metabolism, the quicker it is to eliminate drugs)
  • Body fat percentage (the higher the fat, the longer a fat-soluble drug stays in your body)
  • Age
  • Hydration and nutrition
  • Liver or kidney function

The last three factors all affect your body’s ability to process and remove substances.

blood test

Types of Drug Tests and Drug Detection Windows

Each test type has a different detection window based on the excretion of drugs or their metabolites.

The choice of test depends on the context: workplace screening, addiction treatment planning, emergency medical intervention, etc.

Test TypeDetection WindowBest For
Urine test1–30 daysGeneral screening, most common, cost-effective
Blood testHours to 1–2 daysRecent use, medical setting
Saliva test1–3 daysRecent use
Hair testUp to 90 daysLong-term or repeated use

The Food and Drug Administration (FDA) sets standards for drug tests before they can be sold to healthcare professionals and providers.

Meanwhile, the National Institute on Drug Abuse (NIDA) is focused on research to improve drug testing.

medication

Detection Times of Prescription Drugs

Some prescription medications are likely to be misused due to their mind-altering effects. Let’s look at how long these drugs stay detectable:

1. Benzodiazepines (Xanax, Valium, Ativan)

Benzos are classified according to half-life: short-, intermediate-, and long-acting. 

  • Uses: Anxiety, panic attacks, insomnia
  • Commonly misused due to: Sedative-hypnotic effects, rapid tolerance buildup
  • Half-life:
    • Short-acting benzos (Xanax): 6–27 hours
    • Intermediate-acting (Ativan): 10–20 hours
    • Long-acting benzos (Valium): 20–80 hours
  • Urine test: 1–30 days
  • Saliva test: 1–3 days
  • Blood test: 6–48 hours
  • Hair test: Up to 90 days

2. Opioids (oxycodone, hydrocodone, fentanyl)

Opioid addiction treatment plans often use methadone or buprenorphine to help manage withdrawal symptoms.

  • Uses: Acute and chronic pain
  • Commonly misused due to: Euphoric and pain-relieving effects
  • Half-life:
    • Oxycodone: 3–5 hours
    • Fentanyl: 3–12 hours
    • Hydrocodone: 3.5–9 hours
  • Urine test: 1–4 days
  • Saliva test: 1–2 days
  • Blood test: 12 hours to 1 day
  • Hair test: Up to 90 days

3. Amphetamines (Adderall, Ritalin)

Amphetamines are a type of stimulant classified as a Schedule II controlled substance.

  • Uses: ADHD (attention-deficit hyperactivity disorder), narcolepsy, binge-eating disorder
  • Commonly misused due to: Energetic, euphoric, aphrodisiac effects
  • Half-life: 9–14 hours
  • Urine test: 1–4 days
  • Saliva test: 1–2 days
  • Blood test: 12 hours to 2 days
  • Hair test: Up to 90 days

4. Barbiturates

Common side effects of using barbiturates include sleepiness, drowsiness, and light intoxication.

  • Uses: Seizures, epilepsy, insomnia, anesthesia (rare today)
  • Commonly misused due to: Sedative-hypnotic, relaxing effect
  • Half-life: 1–5 days, depending on whether it’s short- or long-acting
  • Urine test: 1–7 days
  • Blood test: 1–2 days
  • Hair test: Up to 90 days
meth

Detection Times of Illicit Drugs

Detection windows differ by drug type.

1. Methamphetamine

Also known as meth, crystal, ice, this stimulant has a high potential for addiction. Chronic use damages both physical and mental health, and long-term substance abuse often requires intensive inpatient care.

  • Half-life: 10–12 hours
  • Urine test: 1–4 days
  • Saliva test: 1–2 days
  • Blood test: 1–3 days
  • Hair test: Up to 90 days

2. Cannabis (THC)

THC is lipophilic, meaning it’s stored in body fat. Occasional users may clear it pretty quickly, while regular users store them for a longer period.

  • Half-life: 1–10 days based on frequency of use
  • Urine test:
    • Single use: 3 days
    • Moderate use: 5–7 days
    • Daily use: Up to 30+ days
  • Saliva test: Up to 24 hours
  • Blood test: Up to 2 days
  • Hair test: Up to 90 days

3. MDMA (Ecstasy)

This party drug has both energizing and hallucinogenic effects. It can cause severe emotional crashes and dehydration after the high wears off.

  • Half-life: About 8 hours
  • Urine test: 2–4 days
  • Saliva test: 1–2 days
  • Blood test: 1–2 days
  • Hair test: Up to 90 days

4. PCP (Phencyclidine)

PCP is a hallucinogenic drug known to induce many troubling side effects, including erratic, violent, and suicidal behaviors. It’s fat-soluble, so it can leave the body slowly.  

  • Half-life: About 21 hours
  • Urine test: Up to 8 days
  • Saliva test: 1–2 days
  • Blood test: 1–2 days
  • Hair test: Up to 90 days

5. Opiates (heroin, morphine, codeine)

Opiates are fast-acting but don’t stay in the body for too long unless used heavily or for a long time. heroin, for example, breaks down into morphine very quickly, and that’s what shows up on most drug tests.

  • Half-life:
    • Heroin: minutes (converts to morphine)
    • Morphine: 2–4 hours
    • Codeine: 3–4 hours
  • Urine test: 1–3 days
  • Saliva test: 1–2 days
  • Blood test: 1–2 days
  • Hair test: Up to 90 days
Residential Detoxification

Detox and Drug Elimination

It’s important to remember that detox doesn’t instantly wipe drugs from your body. Your system still has to do the work of breaking down and clearing the substances naturally.

What detox can do is help you manage withdrawal symptoms and make you as comfortable as possible. It’s often the first step in a substance use disorder recovery plan.

As we’ve touched on, several factors can affect how long it takes for drugs to fully leave your system.

As your body starts to eliminate these substances, it also begins to adjust to their absence. That’s when you experience withdrawal.

During detox, you may experience these symptoms:

  • Nausea or vomiting
  • Anxiety or irritability
  • Insomnia or nightmares
  • Muscle pain or tremors
  • Cravings or depression

For some drugs, withdrawal can be dangerous. That’s why a medically supervised detox is often recommended, especially for benzos, opioids, and barbiturates.

These drugs can have serious complications, like seizures or respiratory distress. In some cases, this can be life-threatening or even fatal.

During a supervised detox, doctors may use a variety of tools to help. These can include gradually reducing your dose (tapering), giving you medications to ease withdrawal symptoms, and providing mental health counseling.

How Long Does Detox Take?

The duration of detox varies. Depending on the substance used and other factors, it can last anywhere from a few days to several weeks.

Let’s take benzos, for example.

Detox for low-dose users (someone taking a daily prescribed dose for a few months) usually takes around 4 weeks of tapering in an outpatient setting.

For people who have been using high doses for a long time (e.g., 40 mg diazepam daily for 8 months or more), inpatient detox is necessary.

Here, doctors can provide 24/7 care and taper you off the drug slowly. They can switch you to a long-acting benzo to stabilize you before starting the taper. This can also last up to a few weeks.

doctor and medication

How Addiction Treatment Helps

Detox on its own doesn’t treat substance use disorder. You need a comprehensive drug addiction treatment plan to recover.

That said, occasional drug use doesn’t equal addiction. But if you develop strong cravings, seek drugs despite negative consequences, and need more to feel the same high, it’s time to explore treatment options. 

We at Long Island Treatment Centers can help. We offer:

We have medical professionals who can monitor your progress with periodic drug screens and tailor treatment based on your results.

Drug Testing During Addiction Treatment

Drug tests are a common part of addiction treatment programs, whether that’s inpatient, outpatient, or sober living. They’re also often required for court-mandated recovery plans.

These tests, especially urine screenings, are used to monitor a person’s progress and help prevent a relapse.

Final Thoughts

How long it takes for medication to get out of your system depends on more than just its half-life. Your overall health, how long you’ve been using, and the dosage all play a role.

Did you find the answer for the specific drug you had in mind? If so, chances are you’re looking for either reassurance or a starting point to change.

If it’s change you’re considering, it sounds like you’re ready to take the next step. Call us if you need help.

Additional Sources:

Written by the The Long Island Treatment Center Editorial Team