You can find yourself facing a drug test for any number of reasons: a run in with the law, a job interview, an on the job accident or a random screening. Sometimes it happens without warning. If you’re lucky you’ll get advance notice, so you have some time to plan and prepare.

In that case, it’s important to know: how long does weed stay in your system?

The answer to that question depends on several factors. The first variable is you. Your gender, age, weight, and metabolism all affect how quickly your body breaks down and flushes out THC and its metabolites. Cannabinoids (like THC) are fat soluble, meaning they are absorbed and stored by the body’s fat cells. So the higher your body mass index (BMI) the more THC you are going to have stored in your body, and the longer it will take to flush out.

The second thing to consider is your usage. What kind of weed are you smoking? How potent is it? How much do you smoke, and how often? Dosage and frequency of use both determine how long weed stays in your system. The more THC you put into your body, the longer it takes to flush it out. So an occasional user will test clean a lot sooner than a heavy, habitual user. Pretty simple, right?

The third thing to consider is the testing method. The type of drug test being administered — urine, hair, blood, saliva — determines how long the substance can be detected. We’ll cover each type of test in detail below.

Urine Test

The urine test is by far the most common type of drug test administered by employers and the court system. Unfortunately, weed is detectable in your urine for much longer than in your blood or saliva. The exact amount of time varies a lot from person to person. It’s not an exact science, so the following are estimates only:

Occasional user: may test positive 3 — 7 days after last use

Frequent smoker (3-4 times per week): 1 — 2 weeks

Daily smoker: 2 — 3 weeks

Heavy smoker (multiple times per day): 30 days+

Hair Test

The hair test is used occasionally by employers, schools, and the court system. It generally takes about a week for cannabis metabolites to bind to hair follicles, but once it does — it stays. Labs usually only test about a 1 ½ inch segment of hair, cut close to scalp. But that little clipping gives them a detection window between 7 — 90 days. No matter how much, or how little, you smoke.

Saliva Test

Saliva tests are becoming more and more common, especially in jurisdictions where marijuana use has been legalized. It is ideal for detecting recent use, since cannabis is detectable in your saliva with an hour after use, and usually does not linger for more than a day.

Occasional users: will test positive 1 — 12 hours after last use

Frequent & daily users: 12 — 48 hours

Heavy, long term users: 2 days+

Blood Test

Blood tests may sometimes be administered as part of an accident investigation, to help determine whether or not the subject was intoxicated at the time of the incident. Cannabis is detectable in the bloodstream almost immediately after smoking. THC levels peak 3 to 10 minutes after inhalation, and rapidly recede. After 6 hours, only trace amounts remain.

Edibles are a different story. It takes 1 — 2 hours for ingested cannabis to show up in your bloodstream, and even then the levels are relatively low. That’s because the THC from edibles is processed by the liver, instead of immediately entering the bloodstream through your lungs.

Some states have set a limit of 5 nanograms per milliliter of blood, beyond which they consider a person intoxicated. Occasional users will only test over that limit if they have smoked in the last few hours. But chronic, heavy users may retain that much or more cannabis in their bloodstream at all times, and it can take as long as a month to fall below that legal limit.

Remember these times are only estimates, designed to give you some idea of what to expect. The only way to know for sure whether or not you’re clean is to test yourself.