
Opioid testing can feel like an overwhelming, scary thing. You might have to do it as part of a treatment plan, or maybe you have to take a drug test for your job and have no idea what to expect. This uncertainty can be all the more stressful if you’ve recently taken opioids. Now the big question you’re asking is how long do opioids stay in your system?
The amount of time that an opioid will stay in your system depends on several factors, including the drug type, the dose, and how frequently you use. Each type of test—saliva, urine, blood, or hair—offers different detection windows, which also vary depending on which opioid you’ve taken. It's also important to understand how withdrawal factors in, and whether Medications for Opioid Use Disorder (MOUD) show up on tests.
In the context of OUD care, a drug test is never intended to trick or catch you; they are an essential part of addiction management. This article will explain all of that, and more—hopefully giving you some peace of mind if you have a drug test coming up.
The difference between short-acting and long-acting opioids is simple: one lasts longer in your system than the other. When it comes to medication, short-acting opioids typically work for short-term relief from pain or on an as-needed basis. Meanwhile, long-acting opioids are slow -release drugs, with the effects typically felt longer.
Some examples of short-acting opioids are:
Short-acting opioids are typically used for pain management or to mitigate opioid withdrawal symptoms. They offer fast release of the opioid’s effect, but have a shorter lifespan.
Some long-acting opioids are:
Long-acting opioids release drugs more slowly and stay in your system for longer.
Then there’s the half-life for each opioid—or the amount of time it takes for the drug to be half gone from your body. It can help medical professionals provide accurate dosing and understand how much of a substance is left in your system. Additionally, it can be critical to ensure you don’t overdose.

Notably, short-acting and long-acting detection isn’t always the same as short-acting and long-acting feeling. For instance, fentanyl is a short-acting drug in the sense that its effects will come on quickly and last a short period of time. Yet, fentanyl’s effects might end, and withdrawal can set in without fentanyl fully leaving the body.
Fentanyl is lipophilic, meaning it stays in your fat. “Fentanyl, although very much also an opioid, is actually ‘sticky’ to fat stores in ways other opioids aren’t,” says Dr. Stephen Martin, an addiction medicine physician at Boulder Care. “Fentanyl, although very much also an opioid, is actually ‘sticky’ to fat stores in ways other opioids aren’t.”
We will refer to fentanyl as short-acting throughout this article due to its quick effects. However, its long-lasting presence in the body is also critical to acknowledge.
Below are some of the different opioids and their typical opioid detection windows for some drug tests:
Opioids will typically show up in urine tests for up to two to three days. This window is the case for heroin, while some research suggests that codeine and morphine might present up to four and five days after use, respectively.
According to Dr. Shannon Boustead, an addiction medication physician at Boulder Care, urine tests are typically used in the following settings:
Opioids can appear in blood tests between 6 and 24 hours after use. Blood testing can be a great way to get a large sample and ensure it belongs to the person in question. It’s typically used during emergency or accident situations to determine whether drugs are involved.
However, blood testing’s short detection time, high cost, and invasive nature are all deterrents to use. It also might not work for people with poor veins. Plus, it requires a trained individual to not only test the sample but take it.
A saliva test can detect opioids in your system between 36 and 48 hours after use depending on the specific substance or medication.
Doing a saliva test for opioids typically involves using a cotton pad or swab on your inner cheeks and gums. It will take a matter of minutes for a result if tested at the point of collection, but it might take a day or two if the sample is sent to a lab. A lab test will be more accurate than one done in the moment, with the best tests being 97% accurate. This number is based on all drugs, though opioids can be easier to detect than drugs such as cannabis.
Saliva tests offer advantages like fast results, easy to do, and lower risk of tampering than some other options. However, like blood tests, they offer a relatively short window. Other drawbacks include false positives and a limited sample amount.
A test of your hair strands might be able to locate any type of opioid up to 90 days after use. Hair tests typically involve a small bit of your hair being cut close to your scalp. Hair testing is effective for looking at substance use over a wide time frame, but otherwise, it is not as effective as methods like urine testing.
Several things determine the amount of time that opioids remain in your body, including:
Then there are the things that determine how long opioids can be detected in your body, such as your:
Yes, the type of opioid can determine how long it stays in your system and can be detected. Take fentanyl, for instance, with its sticky fat stores. Despite being a short-acting opioid, it often stays in the body for much longer than substances like heroin or codeine. Fentanyl’s duration in the body depends on dose, frequency, and more.
Understanding these different factors can help you make decisions about drug testing, prepare for results, and have honest conversations with medical professionals.

Opioids can still be detected in your system even after you start withdrawal. “When I was using heroin, even though the drug could still be detected in my system for days, I would begin withdrawing around eight hours after my last dose,” says Campbell. “So if I used at 6, 7, or 8 PM, I would be in withdrawal the next morning.” A urine test, for instance, can still detect heroin up to two to three days after use.
The lack of a connection between detection and withdrawal is even more obvious for short-acting opioids like fentanyl. “Because fentanyl stays in the system for weeks after someone’s last time using it, the testing doesn’t keep up with reality and people can even be punished for fentanyl use though they actually stopped—in a punitive abstinence-based system,” says Dr. Martin.
There’s a potential psychological impact when you’re on the other side of withdrawal but still testing positive for opioids. It can be incredibly frustrating to still see substances showing up in your system, despite working to stay off them. The right medical professionals should provide you with trust and understanding during this time, knowing that this is a normal part of going off opioids.
Opioid medication can also show up on a drug test. For instance, if you’re taking buprenorphine through Suboxone or Subutex, then it can appear on your test. “This is exactly what should happen—it confirms you're taking your medication as prescribed,” says Dr. Boustead. “Your care team may also look at the ratio between buprenorphine and norbuprenorphine. When buprenorphine is taken as prescribed and metabolized normally, norbuprenorphine tends to appear at levels equal to or greater than buprenorphine.”
Each MOUD medication has a specific detection window:
At Boulder Care we never want you to feel like drug testing is a means of punishing you. Drug testing should simply be about safety, nothing else. “Drug tests are a tool, not a verdict.
When a test is used as part of a trusting, supportive clinical relationship, it can genuinely help,” says Dr. Boustead. “It can catch a dangerous interaction before it becomes a crisis. It can document progress in a way that matters to you and to the people around you. It can open a conversation.”
We understand that your past experiences of drug testing might have been demeaning and never want you to feel that way. “Addiction already carries immense shame. When treatment systems add additional layers of humiliation, it makes recovery harder—not easier,” says Campbell.
xf“I’m encouraged that more organizations, physicians, researchers, and people in recovery are re-examining these practices. We can maintain safety and accountability without sacrificing dignity. People with opioid use disorder deserve to be treated like patients with a medical condition—not suspects.”
Arming yourself with information on how opioids react and last in your system can be critical. Understanding how long different opioids can stay in your system can help with things such as:
For instance, Campbell reflects on feeling withdrawal eight hours after using heroin. “However, if I didn’t wait at least 24 hours before taking Suboxone (buprenorphine), I would go into precipitated withdrawal—which is sudden, intense withdrawal caused by taking buprenorphine too soon. That experience is severe and frightening.”
Being prepared with an understanding of these factors can make treatment easier to navigate and stop you from experiencing unnecessary discomfort.

Drug tests can be empowering. “Seeing a result that's consistent with your treatment goals is confirmation that what you're doing is working,” says Dr. Bousead. Over time, those results can be a source of documented progress. But that only works when tests are interpreted with context, nuance, and care.”
Boulder Care is here and able to support you through opioid use disorder treatment. We believe in maintaining trust, care, and open communication with each person who needs our help. We never want you to feel embarrassed or demeaned, instead feeling empowered as you move through your treatment.
Each drug test has a specific opioid detection window and every opioid can only show up for a certain amount of time. For instance, saliva tests only detect most opioids up to 36 hours after use.
No, opioid withdrawal occurs when a person’s opioid intake decreases, causing symptoms such as sweating, restlessness, and nausea. However, a person can still have opioids in their system when entering withdrawal.
Yes, opioids can show up on a urine test. Typically, a urine test can detect opioids up to two to three days after use.
At Boulder Care, we’re committed to providing clear, evidence-based information about opioid and alcohol use disorder recovery. Learn more about our editorial standards and medical review process.