MDMA, commonly known as ecstasy or “X,” takes about 40 hours to clear more than 95% from your body. That’s roughly two days. But drug tests can detect traces for much longer depending on the type of test, with urine tests picking it up for 2 to 4 days and hair tests reaching back as far as 90 days.
How Your Body Breaks Down MDMA
MDMA has an elimination half-life of about 7 to 8 hours. That means every 7 to 8 hours, the concentration in your blood drops by half. It takes roughly five half-lives for your body to clear over 95% of any drug, which puts MDMA’s total clearance time at around 40 hours.
Your liver does most of the work, converting MDMA into several byproducts. One of these, MDA, is itself psychoactive and sticks around longer, with a half-life of 10 to 12 hours. Another metabolite called HMMA lingers even longer, with a half-life of 11 to 13 hours. These byproducts are what drug tests often look for, which is why detection windows extend well past the point where you feel any effects.
Detection Times by Test Type
Urine
Urine testing is the most common method for workplace and legal drug screens. After a typical recreational dose (70 to 150 mg), MDMA itself is detectable in urine for a median of about 71 hours at a lower dose and 95 hours at a higher dose. That’s roughly 3 to 4 days. In some individuals, though, detection stretched to nearly 150 hours, or just over 6 days. The metabolite HMMA was detectable even longer, up to 6.6 days after a higher dose.
Federal workplace drug tests use an initial screening cutoff of 500 nanograms per milliliter for MDMA. If that screen comes back positive, a confirmation test with a lower threshold of 250 ng/mL is run. A higher dose or repeated use means more of the drug and its byproducts accumulate in your system, pushing detection further out.
Saliva (Oral Fluid)
Oral fluid tests can detect MDMA within 15 minutes to an hour after use. The typical detection window is 1 to 2 days for a single recreational dose, though some samples tested positive up to 71 hours. Saliva tests use a much lower cutoff than urine, 50 ng/mL for screening and 25 ng/mL for confirmation, which makes them quite sensitive during that window.
Blood
Blood tests have the shortest useful window. MDMA is measurable in blood within minutes and peaks around 1.5 to 3 hours after ingestion. Because the half-life in blood is about 8 hours, levels drop below detectable thresholds within roughly 1 to 2 days. Blood testing is rarely used for standard drug screening but may be used in emergency rooms or accident investigations.
Hair
Hair follicle tests have the longest detection window by far. As hair grows, drug metabolites get incorporated into the shaft. The standard 1.5-inch sample captures approximately 90 days of drug use, at a rate of about one month per half inch. Hair testing won’t catch very recent use (it typically takes 1 to 2 weeks for new hair containing the drug to grow out far enough to collect), but it’s effective for identifying patterns of use over the previous three months.
What Affects How Long It Stays
Dose: This is the most straightforward factor. A higher dose produces more MDMA and more metabolites, all of which take longer to fall below test thresholds. In controlled studies, participants given a higher dose (about 1.6 mg/kg body weight) had MDMA detectable in urine for a median of 95 hours compared to 71 hours at a lower dose.
Genetics: Your liver relies on a specific enzyme to process MDMA. About 5 to 10% of people of European descent are “poor metabolizers,” meaning they have a less active version of this enzyme. In these individuals, peak blood concentrations of MDMA are about 15% higher and peak levels of MDA are 50% higher compared to normal metabolizers. However, MDMA actually shuts down this enzyme in everyone within about an hour of taking it, which somewhat levels the playing field. The genetic difference matters most in the first hour or so after dosing.
Body composition and hydration: MDMA is distributed throughout body water and tissue. People with higher body mass or more body fat may process the drug differently, though individual variation is significant regardless of size. Hydration affects urine concentration, which can make a marginally positive sample test either above or below the cutoff, but it doesn’t speed up actual elimination from your body.
Frequency of use: Taking multiple doses or using MDMA repeatedly over a short period leads to accumulation. The body’s ability to process each additional dose becomes less efficient because MDMA inhibits the very enzyme responsible for breaking it down. This means a second dose doesn’t just add to the existing amount; it can disproportionately raise blood levels and extend the time it takes to fully clear.
How Long Effects and Aftereffects Last
The subjective effects of MDMA typically begin 30 to 60 minutes after swallowing a pill and last 3 to 5 hours. But the drug remains in your system well after the high fades. The persistence of after-effects like fatigue, low mood, and difficulty concentrating for one to two days after use aligns with the 40-hour clearance timeline. Your body is still processing and eliminating the drug and its active byproducts during that window, even though the peak experience is long over.

