How Long Do Opioids Stay In Your Urine?

Medically Reviewed by Johnelle Smith, M.D.

Updated on June 15, 2026

Opioids are a class of drugs used to relieve moderate to severe pain. As drugs that can be highly addictive, prescribed use of them is typically monitored. Urine tests, the most common type of drug screening, can detect opioids for two to four days on average.

Looking for Addiction or Mental Health Treatment?

AddictionResource.net is an advertising-supported site. Ads on this site are from companies that compensate us and are always clearly identified. This compensation does not influence our facility rankings, resource guides, or other editorially-independent information published on this site.

Learn More About Our Advertisers

At Recovery Guide, our mission is to connect as many individuals struggling with mental health and substance abuse disorders to reputable treatment facilities.

To achieve this goal, we set strict guidelines for our editorial team to follow when writing about facilities and utilize behavioral healthcare experts to review medical content for accuracy.

While we receive compensation in the form of paid advertisements, these advertisements have absolutely no impact on our content due to our editorial independence policy.

Opioids are a class of drugs, ranging from prescription pain medications like oxycodone and hydrocodone to illicit substances like heroin, that are prescribed for moderate to severe pain but carry a high potential for misuse, dependence, and addiction. Because of that risk, opioid use is closely monitored in clinical, legal, and workplace settings through regular drug testing.

Urine testing is the most widely used method for detecting opioid use, accounting for the majority of drug screens ordered by healthcare providers, employers, courts, and addiction treatment programs. On average, most opioids can be detected in urine for two to four days after the last dose — though that window varies significantly depending on the specific opioid, how long someone has been using it, and other factors.

Learn more about detecting opioids through various drug tests

How Long Can Opioids Be Detected In Urine?

Opioid drugs can be detected in the urine for two to four days on average. This time-frame varies depending on the type of opioid someone has taken.

Common opioids and their average detection times in urine include:

Short-acting opioid drugs will pass through the system more quickly compared to long-acting opioids. In addition to the type of opioid, several other personal and biological factors can also influence detection times.

Factors That Can Affect How Long Opioids Stay In Urine

Average detection times for opioids may not be applicable to everyone. The amount of time an opioid stays in a person’s urine can depend on a range of factors.

Factors that can affect opioid detection times include:

  • age
  • dose taken
  • method of use (e.g. oral, snorting, injecting)
  • body mass
  • drug tolerance
  • metabolism
  • liver and kidney function
  • use of other drugs
Ad
Get Support
If you or someone you love is struggling with addiction, getting help is just a phone call away, or consider trying therapy online with BetterHelp.
Exclusive offer: 20% Off BetterHelp*
Try Therapy Online With BetterHelp
As a BetterHelp affiliate, we receive commissions if you purchase through the BetterHelp links above.
*Get 20% off your first month of BetterHelp. This offer is only available to users who have never received therapy with BetterHelp.

How Opioids Are Detected In Urine

Opioids can be detected in the urine either unchanged or by their metabolites. Metabolites are the substances drugs are broken down to as they are metabolized in the body. Some types of urine screening methods are more sensitive than others. In addition, some opioids may be detected as other opioids in the body due to their similar chemical structure.

For instance, someone who has used heroin may also test positive for morphine or codeine. Someone who has taken codeine may also test positive for hydrocodone.

Why Are Opioid Drug Tests Used?

Urine tests for opioid use may be ordered for a variety of reasons.

Common reasons why urine tests are used:

  • pre-employment screening
  • prescription drug monitoring program
  • workplace drug testing
  • court-ordered drug testing

People with substance use disorders may also be tested for opioid use to confirm compliance with their treatment plan, as part of an addiction rehab program.

Treatment Services For Opioid Addiction

If you or a loved one is worried about testing positive for opioid use, this may indicate a need for opioid addiction treatment.

Common treatment options for opioid use disorder include:

  • dual diagnosis treatment
  • cognitive behavioral therapy (CBT)
  • dialectical behavior therapy (DBT)
  • group therapy
  • medication-assisted treatment (MAT)
  • medical detox
  • residential treatment
  • outpatient programs
  • 12-step recovery groups
  • counseling
  • family therapy

Browse our directory or reach out to the Substance Abuse and Mental Health Services Administration (SAMHSA) for more information about addiction recovery.

This page does not provide medical advice. See more

Addiction Resource aims to provide only the most current, accurate information in regards to addiction and addiction treatment, which means we only reference the most credible sources available.

These include peer-reviewed journals, government entities and academic institutions, and leaders in addiction healthcare and advocacy. Learn more about how we safeguard our content by viewing our editorial policy.

  • Was this Helpful?
  • YesNo