How Long Are Opiates Detectable in Urine?

Most opiates are detectable in urine for roughly one and a half to four days after a single dose, though the exact window varies by drug, how much was taken, and how often someone has been using. A single dose of morphine or heroin generally clears within two to three days, while methadone and buprenorphine can linger considerably longer. The picture gets more complicated with chronic use, where certain drugs, particularly fentanyl, have been documented in urine for months after the last dose. Understanding why these windows shift so dramatically requires looking at each drug individually and at the biological factors that speed up or slow down elimination.

Typical Detection Windows by Opiate

The detection window for any opiate depends on its specific metabolism and how quickly the body converts it into excretable byproducts. For the drugs most commonly encountered in urine testing, the general single-dose windows look like this:

  • Codeine: One to two days. Codeine and its metabolites are rapidly excreted, with most of the drug appearing in urine within the first 24 hours after a dose.1PubMed. Forensic drug testing for opiates, III. Urinary excretion rates of morphine and codeine following codeine administration
  • Morphine: Two to three days. The body converts morphine into two main glucuronide metabolites, which are water-soluble and filtered through the kidneys relatively efficiently.2PubMed Central. Morphine-3-Glucuronide, Physiology and Behavior
  • Heroin: Two to three days. Heroin itself breaks down within minutes into 6-monoacetylmorphine and then into morphine, so the test is really picking up morphine and its metabolites rather than heroin directly.
  • Oxycodone and hydrocodone: Two to four days, depending on dose and formulation. Extended-release versions may push the window slightly longer.
  • Methadone: Up to about a week or longer in chronic users, partly because of its long half-life.
  • Fentanyl: Traditionally cited as one to three days, but this estimate is now recognized as badly outdated for people with heavy or prolonged use.

These windows assume a single typical dose in someone with normal kidney function and average hydration. For people who use regularly, expect them to stretch, sometimes dramatically. In general, chronic users can show positive results for about a week after their last dose across most opiates, and in extreme cases far longer.3PubMed. Detection times of drugs of abuse in blood, urine, and oral fluid

Why Fentanyl Stays Detectable Far Longer Than Old Guidelines Suggest

Fentanyl is where the standard “one to three days” advice falls apart most spectacularly. Older reference guides and many workplace testing protocols still treat fentanyl as a short-acting drug that washes out quickly. But case reports and clinical studies tell a very different story for people who have been using fentanyl regularly, especially the illicitly manufactured supply that now dominates the opioid crisis.

Two patients with opioid use disorder continued testing positive for fentanyl on urine drug screens for 170 and 210 days after their last reported use.4PubMed. Prolonged Fentanyl Detection on Urine Drug Testing: A Case for Revising Interpretation Frameworks in the Setting of Chronic Use In another case series tracking pregnant and postpartum individuals in a medication-assisted treatment program, low levels of norfentanyl (fentanyl’s primary metabolite) were detectable in urine for 126, 231, and even 294 days after the last fentanyl use. These patients were confirmed abstinent throughout the monitoring period by other measures, including consistently negative fentanyl levels and compliant weekly drug tests that were positive only for their prescribed buprenorphine.5PubMed Central. Prolonged detection of urine norfentanyl in individuals enrolled in a medication for opioid use disorder in pregnancy and postpartum program: a case series

The likely explanation involves fentanyl’s fat-solubility. In chronic users, fentanyl accumulates in fatty tissues and then slowly leaches back into the bloodstream over weeks or months. A study measuring urinary half-lives found wide variability: fentanyl’s urinary half-life ranged from about 1.5 to 29 hours, while norfentanyl’s ranged from about 5 to 27 hours. When the researchers modeled predicted detection windows, they estimated fentanyl could be detectable for half a day to about 5.5 days, and norfentanyl for roughly 3 to 11 days.6American Journal on Addictions. Case Series: Magnitude and duration of fentanyl and xylazine detection in the urine of persons with opioid use disorder But those modeled windows are based on measurable half-life decay. The 170-to-294-day real-world positive results in chronic users suggest that tissue-depot release can extend detection far beyond what pharmacokinetic models predict from a single exposure. If you are in a treatment program and your urine keeps coming back positive for fentanyl metabolites months after you stopped, that does not automatically mean relapse. It is worth discussing with your provider rather than having the result misinterpreted.

Kidney Disease and Other Factors That Extend the Window

Your kidneys are the primary exit route for opiate metabolites, so anything that slows kidney function pushes the detection window outward. The effect can be substantial. In people with chronic kidney disease, the half-life of morphine’s main metabolite (morphine glucuronide) extends from a normal range of about 4 to 14 hours all the way up to 119 hours. On top of that, peak blood concentrations of morphine in kidney disease patients run about 50 percent higher than in people with healthy kidneys, and tramadol’s half-life doubles.7PubMed Central. Opioid Prescription in Patients With Chronic Kidney Disease: A Systematic Review of Comparing Safety and Efficacy of Opioid Use in Chronic Kidney Disease Patients This matters both for how long a test stays positive and for safety: impaired kidneys mean metabolites build up, which can intensify side effects and overdose risk.

Beyond kidney function, several other factors influence how quickly you clear opiates. Age slows metabolism generally, as liver enzyme activity and kidney filtration both decline. Body composition plays a role because fat-soluble drugs like fentanyl accumulate in adipose tissue and release slowly. Hydration matters too, not because drinking water flushes out the drug faster in any meaningful way, but because dehydration concentrates urine and may push a borderline sample above the positive threshold, while overhydration dilutes the sample and may push it below. Genetic differences in liver enzymes also contribute. Most fentanyl is metabolized through a specific liver enzyme pathway, and a study looking at genetic variants of that enzyme found that about 71 percent of a fentanyl dose is excreted as norfentanyl, with only about 4 percent as unchanged fentanyl, though the genetic variants studied did not produce significant differences in excretion rates.8PubMed. Impact of CYP3A5*3 on plasma exposure and urinary excretion of fentanyl and norfentanyl in the early postsurgical period

Dilute Samples and How Labs Handle Them

Drinking large amounts of water before a drug test is one of the oldest tricks people try, and labs are well aware of it. A dilute urine sample has a low concentration of creatinine, a waste product from muscle metabolism that the body excretes at a fairly steady rate. When creatinine is abnormally low, the lab flags the sample as dilute, which can trigger a retest or be treated as a refused test depending on the testing protocol.

Research on workplace drug testing found that normalizing drug concentrations against creatinine levels produced a statistically significant increase in the number of positive results across every drug category tested. The effect was meaningful for opiates and even larger for some other substances.9PubMed. Creatinine normalization of workplace urine drug tests: does it make a difference? In other words, dilution does suppress positive results, and creatinine normalization recovers some of those missed positives. If your sample comes back flagged as dilute, expect to be asked to test again under conditions that reduce the chance of over-hydration, sometimes with observed water intake restrictions beforehand.

Poppy Seeds and Innocent Positives

The poppy seed defense sounds like a joke, but it is grounded in real chemistry. Poppy seeds come from the same plant that produces opium, and they can carry enough residual morphine and codeine to trigger a positive urine test. After eating three poppy-seed bagels, one study found urine concentrations of 2,797 nanograms per milliliter of morphine at three hours and 676 nanograms per milliliter at 22 hours, well above common screening cutoffs.10PubMed. Excretion of codeine and morphine following ingestion of poppy seeds A more recent study measuring urine after ingestion of raw poppy seeds found morphine levels reaching over 4,200 nanograms per milliliter, with detectable codeine for at least six hours.11PubMed Central. Concentrations of Morphine and Codeine in Paired Oral Fluid and Urine Specimens Following Ingestion of a Poppy Seed Roll and Raw Poppy Seeds

This is not limited to Western baked goods. A Malaysian study found that eating curry containing poppy seeds could produce urine morphine concentrations above 300 nanograms per milliliter, and that water intake after the meal significantly influenced how concentrated the opiate content was in subsequent urine samples.12Forensic Science International. Profiling of morphine and codeine in urine after the ingestion of curry containing poppy seed as an evidence for opiates defence in Malaysia The United States federal workplace testing program raised its screening cutoff for opiates from 300 to 2,000 nanograms per milliliter in 2010 specifically to reduce poppy-seed false positives, but not all testing programs use the higher cutoff. If you have a drug test coming up, the safest approach is to avoid poppy-seed products for at least two to three days beforehand.

Medications That Can Trigger a False Positive

Poppy seeds get most of the attention, but certain prescription medications can also cause a positive opiate screen when no opiates are present. Several fluoroquinolone antibiotics, including levofloxacin and ofloxacin, cross-react with multiple commercial opiate immunoassay platforms. Other quinolones like ciprofloxacin and gatifloxacin triggered false positives on some but not all assay types.13JAMA. Quinolones and False-Positive Urine Screening for Opiates by Immunoassay Technology These are widely prescribed antibiotics, so this is not an obscure edge case.

Rifampin, an antibiotic used to treat tuberculosis, is another culprit. A case report documented a 12-year-old tuberculosis patient whose urine tested positive for opiates on an immunoassay screen. When the lab spiked drug-free urine with rifampin and ran it through the same platform, it again produced a positive result. Confirmatory testing by a more precise method showed no opiates were present.14PubMed Central. A case of false positive opiate immunoassay results from rifampin (rifampicin) treatment If you are on any of these medications and facing a drug test, inform the testing program in advance or request confirmatory testing if the screen comes back positive.

Why Standard Screens Miss Many Synthetic Opioids

Standard urine opiate immunoassays were designed decades ago to detect natural and semi-synthetic opiates like morphine, codeine, and heroin. They work by recognizing molecular shapes that resemble morphine. The problem is that many newer synthetic opioids look nothing like morphine at the molecular level, so the antibodies in the test simply do not recognize them.

Fentanyl is the most clinically relevant example. Most standard “opiate” screens will not detect fentanyl or its metabolites at all. Labs that want to test for fentanyl need a separate, fentanyl-specific immunoassay or confirmatory method. The same goes for methadone, buprenorphine, and tramadol, all of which require their own dedicated assays. A study evaluating four commercial immunoassays against 216 fentanyl analogs and other synthetic opioids found that all four assays detected only 106 of the 216 compounds. Twenty-eight opioids were not detected by any assay, and 17 of those were emerging synthetic opioids that have appeared in the illicit drug supply.15PubMed. Determining the detection of 216 fentanyl analogs and synthetic opioids and predicting epitopes using four commercial immunoassays

This means a negative urine drug test does not rule out opioid use. Someone using illicit fentanyl might test negative on a standard opiate screen if the lab did not also run a fentanyl-specific panel. And as the synthetic drug landscape shifts, with new analogs appearing regularly, even fentanyl-specific assays cannot keep up with every novel compound. If accurate detection matters, whether for clinical care, legal proceedings, or treatment programs, the testing panel needs to be matched to the drugs actually in circulation.

Screening Versus Confirmatory Testing

Most urine drug testing happens in two stages. The first is an immunoassay screen, which is fast and inexpensive but has meaningful limitations. Immunoassays use antibodies that react to molecular structures resembling the target drug. They are designed to be sensitive enough to catch true positives, but the tradeoff is that they also flag some substances that share structural features with the target, producing false positives like the quinolone and rifampin examples above.

When a screen comes back positive, a second confirmatory test is run using a technique like liquid chromatography with tandem mass spectrometry. This method physically separates and identifies individual molecules in the sample, so it can distinguish morphine from codeine, tell you whether 6-monoacetylmorphine (the heroin marker) is present, and rule out cross-reacting medications. Labs use both methods together to achieve high sensitivity on the initial pass and high specificity on confirmation.16PubMed Central. Laboratory testing for prescription opioids The sensitivity of the testing method also varies across different opioids, with some drugs being much easier to detect than others on any given platform.

A practical implication: if you receive a positive screen result but believe it is incorrect, request confirmatory testing. In medical, legal, and workplace contexts, a positive immunoassay alone should not be treated as definitive. Reputable testing programs already require confirmation before taking action, but not every setting follows best practice.

When the Test Says Morphine but the Drug Was Something Else

Interpreting opiate-positive urine results is more complicated than it looks because multiple drugs produce the same metabolites. Both heroin and codeine are metabolized into morphine, which means a urine sample positive for morphine could come from heroin use, codeine use, or actual morphine use.17Clinical Chemistry. Concentration Ratios of Morphine to Codeine in Blood of Impaired Drivers as Evidence of Heroin Use and not Medication with Codeine For forensic or clinical purposes, labs look for additional markers to distinguish the source. The presence of 6-monoacetylmorphine in the sample is considered specific to heroin use, since it is an intermediate metabolite unique to heroin’s breakdown pathway. But 6-monoacetylmorphine is detectable for only a few hours after heroin use, so it is often missed entirely if the sample is collected later.

Metabolomics research has tried to improve this by identifying broader patterns of metabolic byproducts associated with different opioid exposures. One study analyzing nearly 15,000 urine features found that different opioid classes leave distinct metabolic fingerprints: opiate exposure was associated with opioid metabolites alongside acetaminophen metabolites and norfentanyl, while heroin exposure correlated with 6-monoacetylmorphine and other specific markers.18PubMed Central. Retrospective Metabolomics Profiling of Clinical Urine Drug Screen Samples Reveals Features Associated with Opiate Exposure This kind of profiling is still largely a research tool, but it illustrates the direction the field is heading: away from single-marker detection and toward pattern-based identification that can more reliably tell you what someone actually took.

How Urine Compares to Hair, Blood, and Saliva

Urine occupies a middle ground among biological matrices for drug detection. Blood testing has the shortest window, typically one to two days for most opioids, and captures what is actively circulating rather than what has already been metabolized. Oral fluid (saliva) is similarly brief, with most drugs detectable for roughly 5 to 48 hours.3PubMed. Detection times of drugs of abuse in blood, urine, and oral fluid Hair testing offers the longest window by far, potentially reaching back 90 days or more, because drug metabolites become incorporated into the hair shaft as it grows. However, hair testing has its own problems: it can be influenced by hair color, environmental contamination, and cosmetic treatments, and it cannot detect very recent use since it takes time for new hair growth to emerge from the follicle.

The choice of matrix depends on what information is needed. Urine is preferred for most clinical and workplace testing because it balances a reasonable detection window with relatively straightforward collection and well-established cutoff values. Blood is better for acute intoxication assessment, such as in emergency departments or impaired-driving investigations. Hair is useful for documenting patterns of use over a longer period, such as in child custody evaluations or pre-employment screening where a broader history matters. Saliva testing is gaining ground in roadside testing because collection is observed, reducing the chance of sample substitution. Each matrix answers a slightly different question, and none is perfect for every purpose.

Xylazine and Emerging Adulterants

The illicit drug supply has become increasingly complex, and urine testing protocols are struggling to keep pace. Xylazine, a veterinary sedative that has become a common adulterant in illicit fentanyl, is not detected by any standard urine drug screen. It requires its own specific assay, and most clinical labs do not routinely test for it. Estimated urinary detection windows for xylazine range from about half a day to five days, with considerable individual variability.6American Journal on Addictions. Case Series: Magnitude and duration of fentanyl and xylazine detection in the urine of persons with opioid use disorder

The practical consequence is that a person using street fentanyl is likely also being exposed to xylazine and possibly other novel substances, none of which will show up on a standard drug test. Clinicians treating opioid use disorder are increasingly aware that a “clean” urine screen may not mean what it used to. For patients and their providers, this reinforces the importance of knowing exactly which analytes the lab is testing for, rather than assuming that a multi-panel drug screen covers everything currently in circulation. Treatment decisions, legal consequences, and clinical assessments all depend on understanding both the capabilities and the blind spots of the testing method being used.