Most opioids clear your urine within 1 to 4 days after a single dose, but the exact window depends on which opioid, what type of test, and how long you’ve been taking it. Chronic use can extend detection times dramatically, with some opioids showing up for weeks. Here’s what determines how long they stick around.
Urine Detection Windows by Opioid
Urine testing is by far the most common method for opioid screening, whether for employment, pain management monitoring, or legal purposes. Detection times vary significantly from one opioid to another:
- Codeine: 1 to 2 days
- Hydromorphone: 1 to 2 days
- Oxycodone (immediate release): 1 to 1.5 days
- Oxycodone (extended release): 1.5 to 3 days
- Fentanyl (short-term use): 2 to 3 days
- Heroin/morphine: up to 3 days
- Tramadol: 2 to 4 days
- Methadone: 3 to 4 days, sometimes up to 14 days
These windows assume a single dose or short-term use in someone with normal metabolism. They’re a starting point, not a guarantee.
How Chronic Use Changes the Timeline
If you’ve been taking an opioid regularly for weeks or months, expect detection times to stretch well beyond the ranges above. Fentanyl is the most striking example. A single dose clears urine in about 3 days, but chronic use can keep it detectable for up to 4 weeks. This happens because fentanyl is highly fat-soluble, meaning it accumulates in fatty tissue over time and slowly releases back into the bloodstream long after you stop taking it.
Methadone behaves similarly. While a one-time dose may clear in 3 to 4 days, people on long-term, high-dose methadone therapy can test positive for considerably longer. The drug and its byproducts build up with repeated dosing and take much longer to fully wash out.
Blood, Saliva, and Hair Testing
Blood tests have the shortest detection window of any method. Most opioids are only detectable in blood for 6 to 24 hours, making blood tests useful mainly in emergency or overdose situations rather than routine screening.
Oral fluid (saliva) testing is increasingly used in workplace programs. Federal guidelines now include saliva panels for opioids, with cutoff levels set much lower than urine tests. For example, the screening threshold for codeine and morphine in saliva is 30 ng/mL, compared to 2,000 ng/mL in urine. Saliva generally detects opioids for 1 to 3 days, though the exact window depends on the substance.
Hair follicle tests have the longest reach. They can detect opioid use from roughly 90 days prior, since drug metabolites get incorporated into the hair shaft as it grows. Hair testing doesn’t capture the last few days of use very well, though, because it takes about a week for new hair growth to emerge from the scalp.
Why Elimination Speed Varies Between Opioids
Each opioid has a different half-life, which is the time it takes your body to clear half the drug from your bloodstream. Shorter half-lives mean faster elimination:
- Morphine: 1.5 to 2 hours
- Codeine: 2 to 4 hours
- Hydromorphone: 2 to 3 hours
- Hydrocodone: about 4 hours
- Oxycodone: about 4 hours
- Oxymorphone: 7 to 10 hours
It typically takes 4 to 5 half-lives to eliminate a drug almost entirely. So a drug with a 4-hour half-life is mostly gone from your blood within 16 to 20 hours. But “gone from your blood” and “undetectable on a drug test” are different things, because your body converts opioids into metabolites that linger in urine much longer than the original drug stays in your bloodstream.
How Your Body Processes Opioids
Your liver does most of the work breaking down opioids, using two main pathways. The first involves a group of liver enzymes called CYP450, particularly two subtypes: CYP3A4 and CYP2D6. These enzymes handle the breakdown of codeine, hydrocodone, oxycodone, tramadol, fentanyl, and methadone. The second pathway uses a different enzyme called UGT2B7, which is the primary route for clearing morphine, hydromorphone, and oxymorphone.
This matters because the CYP2D6 enzyme is genetically variable. A small percentage of the population produces very little of it, meaning they break down certain opioids much more slowly. Others are “ultra-rapid metabolizers” who clear the same drugs unusually fast. If you’ve ever felt like a standard dose of pain medication hit you harder than expected, or barely worked at all, genetic differences in these enzymes may be the reason.
Other medications can also interfere. Drugs that compete for or block CYP450 enzymes slow opioid clearance, potentially keeping levels elevated longer. Drugs that ramp up enzyme activity do the opposite, speeding elimination. This is one reason your pharmacist asks about everything you’re taking.
Body Composition, Age, and Kidney Function
Several personal factors influence how quickly you clear opioids. Body fat percentage is one of the most significant. Fat-soluble opioids like fentanyl distribute into fatty tissue and release slowly over time. People with higher body fat may retain these drugs longer than leaner individuals, even at the same dose.
Age plays a meaningful role too. As you get older, liver blood flow drops by roughly 40%, which directly slows the clearance of drugs that depend on the liver for processing. Morphine is one of those drugs. Kidney function also declines with age, losing about 0.75 mL per minute of filtration capacity each year starting around age 40. Since many opioid metabolites leave the body through urine, reduced kidney function means those metabolites stick around longer.
Body composition shifts with aging as well. Fat content increases by 20% to 40% while total body water decreases by 10% to 15%. This combination means fat-soluble drugs have more tissue to accumulate in and water-soluble drugs become more concentrated. Both effects can extend the time an opioid or its metabolites remain detectable.
Hydration status and overall metabolic health contribute too, though to a lesser degree than the factors above.
What Drug Tests Actually Look For
Drug tests don’t just look for the opioid itself. They screen for specific breakdown products, called metabolites, that your body produces as it processes the drug. This is how labs can sometimes tell which opioid you took, even though many opioids are chemically related.
Heroin, for instance, converts rapidly into a metabolite called 6-MAM, which is conclusive proof of heroin use. But 6-MAM has an extremely short half-life and is only detectable in urine for about 8 hours. After that, heroin’s remaining metabolites look identical to morphine, making it harder to distinguish the two. Codeine also breaks down into morphine, and hydrocodone breaks down into hydromorphone, which can complicate interpretation.
Federal workplace drug testing panels now screen for opioids across several categories with different sensitivity thresholds. Fentanyl testing uses an extremely low cutoff of just 1 ng/mL in urine, reflecting both its potency and the small amounts needed to produce an effect. Codeine and morphine have a much higher screening cutoff of 2,000 ng/mL, which was deliberately raised in 1998 to avoid false positives from poppy seed consumption.
False Positives on Opioid Screens
Initial opioid screening uses a method called immunoassay, which is fast but not perfectly specific. Several non-opioid medications can trigger a false positive, including dextromethorphan (a common cough suppressant), diphenhydramine (the active ingredient in Benadryl), quetiapine (an antipsychotic), and certain antibiotics like levofloxacin and ofloxacin. Even naloxone, which is used to reverse opioid overdoses, has been reported to cause false positives on some screening panels.
If an initial screen comes back positive, a confirmatory test using a more precise technique is run to verify the result and identify exactly which substance is present. Confirmatory tests are highly accurate and effectively rule out false positives. If you’re taking any medications that might cross-react, disclosing them before the test can save time and confusion.

