None of that changes person to person in a predictable way, which is exactly why so many people end up frustrated by a number they found online that didn't match their own situation. The opioid matters. So does the test, and so does your own body. Before getting into specific detection windows, it helps to understand why a drug test catches what it catches, and why it sometimes doesn't.
Would a test catch this at all?
That's the question underneath most searches like this one. A drug test is a chemical process that looks for traces of a substance or its breakdown products, called metabolites, in a biological sample. A test can detect opioids directly or indirectly, through these metabolites. The body doesn't eliminate every opioid at the same speed.
Each drug has what clinicians call a half-life, which is simply how long it takes the body to clear half of the drug from the bloodstream. A short half-life means the drug moves through quickly. A long half-life means it lingers, which is part of what determines detection time.
Different opioids also latch onto the body's opioid receptors differently, and that shapes how each one gets broken down and how long it lingers in the body. Dose, frequency, and how recently you used all play a role too, and we'll get into those specifics further down. What matters here is the bigger split: a natural opiate like morphine or codeine, a semi-synthetic one like oxycodone or hydrocodone, and a fully synthetic one like fentanyl or methadone each behave differently under a standard test. Prescribed or not, these panels weren't built to catch all of them equally (Milone, 2012).
How long does each one stay in the body?
The table below breaks down typical windows for each opioid across the four main testing methods. Treat these as general ranges, not guarantees. Plenty of people fall outside them for reasons we'll walk through, and that doesn't mean anything went wrong with the test or with you. How recently you used, and which method is testing for it, both move the number around.
|
Opioid
|
Urine
|
Blood
|
Saliva
|
Hair
|
|
Oxycodone
|
Up to 30 hours
|
Not established*
|
Up to 34 hours
|
~90 days†
|
|
Hydrocodone
|
Up to 28 hours
|
Not established*
|
Up to 30 hours
|
~90 days†
|
|
Morphine
|
Up to 2 days
|
Not established*
|
Up to 3 days
|
~90 days†
|
|
Codeine
|
1–several days‡
|
12–16 hours
|
7–21 hours
|
~90 days†
|
|
Heroin
|
Hours (6-MAM)§
|
Minutes§
|
1–8 days
|
~90 days†
|
|
Fentanyl
|
0.5–10+ days
|
Not established*
|
Not established*
|
~90 days†
|
|
Methadone
|
Up to 7 days
|
Not established*
|
5–9+ days
|
~90 days†
|
Important: These are typical ranges based on available research, not fixed timelines. Opioids can stay in your system longer or shorter than these ranges depending on your individual biology and circumstances. A few cells read “Not established” on purpose: no controlled study has pinned down a precise window for that opioid in that specimen type, so rather than print a number that doesn’t exist in the research, we’re telling you plainly where the evidence stops.
A quick guide to the symbols in that table. The dagger (†) marks the hair column, and unlike the rest of the table, that roughly 90-day figure isn’t a per-drug finding. It reflects how hair itself grows, at close to half an inch a month, with older growth carrying a record of older use (Sharma et al., 2016). The double dagger (‡) marks windows drawn from people with heavy, repeated opioid use rather than a single measured dose, since that’s the research that actually exists for those numbers (Vindenes et al., 2014; Øiestad et al., 2018). And the section mark (§) reflects heroin’s own unusual chemistry, which the next few paragraphs explain in more detail.
Urine tests can detect opioid use for about a day and a half to four days after a single dose in most cases, extending considerably in people who use opioids heavily or repeatedly (Cone et al., 2013a, 2013b; Øiestad et al., 2018). A saliva test typically has a similar or somewhat shorter window for a single dose, though heavy or repeated use can stretch that out to a week or more (Cone et al., 2015a, 2015b; Kim et al., 2002; Vindenes et al., 2014).
Heroin itself doesn’t stick around long enough to test for directly. It converts into other compounds within minutes of entering the body, which is why the table above lists heroin’s own blood and urine windows in minutes and hours rather than days (Smith et al., 2001). The compound labs actually look for is 6-monoacetylmorphine, or 6-MAM, a breakdown product that only heroin’s own metabolism produces. It typically shows up only in the very first urine sample someone provides after use, which is exactly what makes it useful: because nothing else creates 6-MAM, a positive result points to recent heroin use specifically, rather than another opiate like morphine or codeine (Luong et al., 2012). Morphine, heroin’s longer-lasting metabolite, is what typically remains detectable for a day or two afterward (Øiestad et al., 2018). Semi-synthetic opioids like oxycodone work on a different timeline, and that's usually where the next question comes in.
Figuring out what your insurance actually covers can remove one real barrier to treatment. Verify your benefits with Wish Recovery in just a few minutes, no obligation.
Why did the test come back clean when something felt different?

This is one of the most confusing parts of opioid testing, and it has a concrete explanation. Most standard drug panels use a method called an immunoassay. It's a fast chemical test tuned to react when it detects a specific molecular shape.
These panels were originally calibrated to recognize morphine's shape. That worked well enough when the most common opioids in circulation were natural opiates like morphine and codeine.
The problem is that semi-synthetic and fully synthetic opioids have different molecular shapes. Oxycodone, for example, needs roughly six times the concentration of morphine to trigger a positive on many standard opiate panels. Hydrocodone detection is inconsistent across different panel brands (Milone, 2012).
Then there's fentanyl. It's fully synthetic, and its molecular structure is different enough from morphine that standard panels essentially can't see it. A separate, fentanyl-specific test is required to detect it (Milone, 2012).
CDC-reported data found that when patients confirmed to have fentanyl in their system were tested, a fentanyl-specific test identified roughly 8 in 10 of them, while the standard opiate screen caught only about 1 in 4 of the same group (Dezman et al., 2020). That gap is significant.
Labs are increasingly running separate confirmatory tests designed for newer synthetic opioids, because the older standard panels were never built to catch them. Cross-reactivity data, meaning what a panel is tuned for versus what it truly encounters, is difficult even for laboratory professionals to interpret. Manufacturers' own documentation on this is rarely straightforward (Krasowski et al., 2020).
A confusing result doesn't have to stay confusing. Talk to someone on Wish Recovery's team who can walk through what it actually means for you.
Why didn't it show up the same way it did for someone else?
Two people can take the same opioid, in the same amount, on the same day, and still walk away with different test results. Biology explains it: specifically, how well your body metabolizes and clears the drug in the first place.
Liver and kidney function (hepatic and renal function, in clinical terms) probably does the most work here, but it's not the only variable. Body mass, urine pH and concentration, how often you've used, the dose, and how recently the last use happened all push the number in one direction or another (Doriety & Farrington, 2021). If your liver or kidneys aren't working at full capacity, whether from a health condition, age, or something else in your system, opioids tend to stick around longer than the typical ranges suggest.
False positives are also a real part of this picture, and they're worth addressing without any judgment attached. Poppy seeds contain trace amounts of morphine and codeine. Research confirms that eating just a couple of servings can be enough to trigger a positive morphine reading on a urine screen within hours (Smith et al., 2014).
Certain over-the-counter medications can also trigger unexpected results on immunoassay screens. A positive result on an initial screen is not a final answer. A confirmatory test, run at a higher threshold, is what separates a genuine result from a testing artifact.
Wondering what treatment might actually cost? Wish Recovery can check your insurance benefitsand give you a straight, no-pressure answer.
A drug test result is a data point. It tells you something about timing and opioid detection, but it doesn't tell the whole story of what someone needs.
Research comparing urine and hair testing found that hair testing identified prescription opioid use, including oxycodone, in roughly 1 in 5 cases where urine testing had missed it entirely (Palamar et al., 2019). Even the professionals running these tests find the manufacturers' own data on what a panel does and doesn't catch difficult to interpret consistently (Reschly-Krasowski & Krasowski, 2018). Any result deserves to be read by someone who understands its limits.
For people navigating opioid use disorder, a test result is often the beginning of a larger conversation, not a conclusion.

We start medical detox and prescription drug detox at Wish Recovery by figuring out exactly what was used, how much, and how your body is responding right now, beyond a single toxicology screen. Treatment planning takes in the full picture: the withdrawal symptoms, the effects on your body, your history, and what you actually need going forward. And because a medical team is watching around the clock through detox and into treatment, nothing gets missed. No one goes through it by themselves.
Dianna S., NP, went through our program herself before becoming a nurse practitioner, and she said something that's stuck with our team: "It's important to find a place where they understand your individualized needs."
Every care plan we build starts from that idea.
You're not meant to carry this alone
Whatever brought you here, whether you're struggling with opioid use yourself or watching someone you love go through it, the questions you're asking matter. Understanding what a test does and doesn't detect is one piece of a larger picture, and you deserve clarity on all of it. If you're ready to talk about what comes next, we're here. And if you're reading this for someone you love, that care you're showing them is real and it counts.
Whatever's still unclear, you don't have to figure it out solo. Reach out to Wish Recovery today, and we'll take it from there.
This article is for general information only. It isn't a substitute for professional medical advice, diagnosis, or treatment.
Frequently asked questions
How long will you test positive for opioids?
It comes down to which opioid, which test, and your own biology. Most short-acting opioids clear a urine screen in one to four days after last use, stretching to about a week if you're using regularly. Blood and saliva windows run shorter, usually hours up to a day. Hair is the outlier. It holds a record for roughly 90 days.
How long does oxycodone stay in your system?
Oxycodone is typically detected in urine for up to about 30 hours after a single dose, and up to about 34 hours in saliva (Cone et al., 2013a, 2015a). Chronic or heavy use can extend both windows well beyond that. A precise blood detection window hasn’t been established in controlled studies, though oxycodone appears in blood within 30 minutes to 2 hours of use and clears comparatively quickly (Cone et al., 2015a). Hair is the exception again: a test can pick up oxycodone use from roughly 90 days back, though that figure comes from how hair grows rather than anything specific to oxycodone itself (Sharma et al., 2016). Where you land in any of these ranges still depends on how often you've used, the dose, and how your liver and kidneys are handling it.
What factors affect how long opioids stay in your system?
Half-life is the big one. Methadone has a long half-life and lingers in the body for days, while heroin and codeine clear out much faster because their half-lives are short. Beyond that, dose, how often you use, how recently, body mass, and urine pH and concentration all shift the window, and so does how well your liver and kidneys are functioning. The drug class matters too: natural opiates, semi-synthetic opioids, and fully synthetic opioids don't metabolize the same way, so a heroin test and a fentanyl test aren't really measuring the same thing. Every opioid, whether it's oxycodone, hydrocodone, morphine, codeine, or methadone, has its own detection profile worth understanding on its own terms.
Can eating a poppy seed muffin or bagel before a drug test cause a false positive?
Yes, it can. Poppy seeds contain trace amounts of morphine and codeine, and research confirms that eating just a couple of servings can be enough to trigger a positive morphine reading on a urine screen within hours. Federal testing thresholds account for this, which is exactly why a positive initial screen should never be the last word. A confirmatory test comes next, before anyone draws conclusions.
Can you speed up how fast opioids leave your system?
There's no reliable shortcut. Time and healthy liver and kidney function are what clear opioids from your system. Drinking excessive amounts of water can dilute a urine sample and flag the test as inconclusive, which often raises more questions than it answers and can carry its own risks. Supporting your body with rest, hydration at normal levels, and medical care during withdrawal is the most honest path forward.
References
Doriety, L., & Farrington, E. (2021). Urine drug screening: What pediatric clinicians need to know to optimize patient care. Journal of Pediatric Health Care, 35(4), 449–455. https://doi.org/10.1016/j.pedhc.2020.12.004
Milone, M. C. (2012). Laboratory testing for prescription opioids. Journal of Medical Toxicology, 8(4), 408–416. https://doi.org/10.1007/s13181-012-0274-7
Sharma, G., Oden, N. L., & VanVeldhuisen, P. (2016). Hair analysis and its concordance with self-report for drug users presenting in emergency department. Drug and Alcohol Dependence, 167, 149–155. https://doi.org/10.1016/j.drugalcdep.2016.08.007
Luong, S., Shimmon, R., Hook, J., & Fu, S. (2012). 2-Nitro-6-monoacetylmorphine: potential marker for monitoring the presence of 6-monoacetylmorphine in urine adulterated with potassium nitrite. Analytical and Bioanalytical Chemistry, 403(7), 2057–2063. https://doi.org/10.1007/s00216-012-6017-4
Dezman, Z., Schwartz, B., & Billing, A. (2020). Notes from the field: High prevalence of fentanyl detected by the Maryland Emergency Department Drug Surveillance System — Baltimore, Maryland, 2019. MMWR Morbidity and Mortality Weekly Report, 69(23), 724–726. https://doi.org/10.15585/mmwr.mm6923a3
Krasowski, M. D., McMillin, G. A., & Melanson, S. E. F. (2020). Interpretation and utility of drug of abuse screening immunoassays: Insights from laboratory drug testing proficiency surveys. Archives of Pathology & Laboratory Medicine, 144(2), 177–184. https://doi.org/10.5858/arpa.2018-0562-cp
Smith, M. L., Nichols, D. C., Underwood, P., et al. (2014). Morphine and codeine concentrations in human urine following controlled poppy seeds administration of known opiate content. Forensic Science International, 241, 87–90. https://doi.org/10.1016/j.forsciint.2014.04.042
Palamar, J. J., Le, A., & Guarino, H. (2019). A comparison of the utility of urine- and hair testing in detecting self-reported drug use among young adult opioid users. Drug and Alcohol Dependence, 200, 161–167. https://doi.org/10.1016/j.drugalcdep.2019.04.008
Reschly-Krasowski, J. M., & Krasowski, M. D. (2018). A difficult challenge for the clinical laboratory: Accessing and interpreting manufacturer cross-reactivity data for immunoassays used in urine drug testing. Academic Pathology, 5, 2374289518811797. https://doi.org/10.1177/2374289518811797
Cone, E. J., Heltsley, R., & Black, D. L. (2013a). Prescription opioids I: Metabolism and excretion patterns of oxycodone in urine following controlled single-dose administration. Journal of Analytical Toxicology, 37(5), 255–264. https://doi.org/10.1093/jat/bkt031
Cone, E. J., Heltsley, R., & Black, D. L. (2013b). Prescription opioids II: Metabolism and excretion patterns of hydrocodone in urine following controlled single-dose administration. Journal of Analytical Toxicology, 37(8), 486–494. https://doi.org/10.1093/jat/bkt066
Cone, E. J., DePriest, A. Z., & Heltsley, R. (2015a). Prescription opioids III: Disposition of oxycodone in oral fluid and blood following controlled single-dose administration. Journal of Analytical Toxicology, 39(3), 192–202. https://doi.org/10.1093/jat/bku176
Cone, E. J., DePriest, A. Z., & Heltsley, R. (2015b). Prescription opioids IV: Disposition of hydrocodone in oral fluid and blood following single-dose administration. Journal of Analytical Toxicology, 39(7), 510–518. https://doi.org/10.1093/jat/bkv050
Kim, I., Barnes, A. J., Oyler, J. M., et al. (2002). Plasma and oral fluid pharmacokinetics and pharmacodynamics after oral codeine administration. Clinical Chemistry, 48(9), 1486–1496. https://doi.org/10.1093/clinchem/48.9.1486
Smith, M. L., Shimomura, E. T., Summers, J. G., et al. (2001). Urinary excretion profiles for total morphine, free morphine, and 6-acetylmorphine following smoked and intravenous heroin. Journal of Analytical Toxicology, 25(7), 504–514. https://doi.org/10.1093/jat/25.7.504
Cone, E. J., & Huestis, M. A. (2007). Interpretation of oral fluid tests for drugs of abuse. Annals of the New York Academy of Sciences, 1098(1), 51–103. https://doi.org/10.1196/annals.1384.037
Vindenes, V., Enger, A., & Nordal, K. (2014). Very long detection times after high and repeated intake of heroin and methadone, measured in oral fluid. Scandinavian Journal of Forensic Science, 20(2), 34–41. https://doi.org/10.2478/sjfs-2014-0004
Øiestad, E. L., Krabseth, H.-M., & Huestis, M. A. (2018). Interpreting oral fluid drug results in prisoners: Monitoring current drug intake and detection times for drugs self-administered prior to detention. Forensic Toxicology, 37(1), 59–74. https://doi.org/10.1007/s11419-018-0434-9
Bird, H., Clarke, W., & Hendrix, C. W. (2025). Case series: Magnitude and duration of fentanyl and xylazine detection in the urine of persons with opioid use disorder. American Journal on Addictions, 34(4), 465–469. https://doi.org/10.1111/ajad.70015