I don’t know about your medicine cabinet, but mine is a jumble of mostly expired drugs: the muscle relaxants I got when I threw out my back a few years ago; the anti- nausea medicine I never took during my stomach woes last summer; the Xanax to occasionally help me cope with the dizzying state of the world.

I’ve often wondered what I should do with these expired medicines — whether and how I should get rid of them, if they’re unsafe to use or whether some might still work perfectly well. I dug into the research and reached out to three eminent pharmacists, one of whom has studied expired medicines, to gain some insight.

With guidance from the U.S. Food and Drug Administration, manufacturers set drug expiration dates based on tests they have conducted to determine how long the medication will remain safe and effective.

An expiration date “represents a promise that the medication is good at least that long, if properly stored,” explained Dan Sheridan, a medication safety pharmacist at OhioHealth Marion General Hospital. Many expiration dates are set between one and five years after the drug is made.

For many prescription drugs, however, what you see on your bottle is not an expiration date but a “beyond use” date. (On my prescriptions, this date appears after the words “Discard by.”) The beyond use date is typically sooner than the medication’s original expiration date, explained James Stevenson, a pharmacist at the University of Michigan College of Pharmacy and the chief clinical officer at the health care technology company Omnicell. That’s because a pharmacist often has to handle, mix with other ingredients and move a medicine into a new container in order to give it to you, and doing so reduces the amount of time it will be usable, he said.

For some drugs, the beyond use date is just a few days or weeks after the medicine is dispensed. “A powdered antibiotic suspension may be good on the pharmacy shelf for two years, but for only 14 days once the pharmacy adds water and dispenses it to the patient,” Sheridan explained.

Although expiration and beyond use dates provide useful information — you can feel confident your medicine will work for at least that long if it’s been properly stored (more on that in a minute) — drugs don’t necessarily become dangerous or less potent once that date has passed, said Lee Cantrell, a clinical pharmacist with the School of Pharmacy at the University of California, San Francisco.

In a small 2012 study, Cantrell and three colleagues tested eight drugs, containing 14 widely differing active ingredients, that had been sitting unopened in a pharmacy closet with expiration dates that had passed between 28 and 40 years earlier. They found that 86% of the drugs’ ingredients were still present in the concentrations they were supposed to be. The findings suggest that some medications, like acetaminophen and the opioid painkiller hydrocodone, retain their potency “for a long, long time,” he said.

Cantrell pointed out, though, that he and his colleagues did not actually test the drugs in people. “I can’t say that it’s OK to take expired medication,” he said. The FDA also recommends against taking expired drugs. However, he has been working at the California Poison Control Center in San Diego for nearly 30 years, and said people called the center regularly after realizing they had taken expired medicines, worried about what would happen. To his knowledge, nothing bad ever has, he said.

Cantrell’s study is one of just a few published studies that have evaluated the chemistry of expired medicines. In a study published in 2006, researchers with the FDA and the pharmaceutical company Sandoz tested 122 drug products and found that 88% were still safe to use an average of 5.5 years past their expiration date.

In fact, the FDA sometimes tests expired drugs needed for public health emergencies and extends their expiration dates if they are found to work and be safe.

When considering whether to take an expired drug, use your common sense. It’s safer to take an expired drug to treat a health nuisance — like ibuprofen to aid a headache or allergy medicine to treat mild hay fever — than it is to take one to treat a serious medical condition, Cantrell said.

Antibiotics belong to one class of drugs that you shouldn’t use past the expiration date, Stevenson said. If you take an antibiotic that is not as strong as it should be, “that could actually be harmful,” he said, because the drug might not effectively fight your infection. Research from the 1960s also linked expired tetracycline to kidney problems, perhaps because the antibiotic produces dangerous chemicals when it breaks down, but it’s unclear if current formulations pose this risk.

Sheridan also cautioned against using expired eye drops — they can become contaminated with microorganisms; and expired nitroglycerin, as the explosive that is also used to treat chest pain in people with heart disease loses its potency over time. The American Diabetes Association does not recommend using insulin past its expiration date, either.

Most drugs can be discarded in the trash, but the FDA recommends that you mix them with coffee grounds, dirt or cat litter so they are less appealing to children or pets who might consider eating them, and that they should be sealed in a bag or container. Some drugs that have abuse potential, including those containing opioids, should not be thrown away.

According to the FDA, these drugs can be flushed down the toilet, but the Environmental Protection Agency warns that doing so can cause drugs to contaminate drinking water, rivers and lakes, since many water treatment plants are not equipped to remove medicines. Sheridan instead recommended dropping drugs into secure medication disposal boxes found at pharmacies. Also, the Drug Enforcement Administration partners with local governments to collect drugs on designated “National Prescription Drug Take Back Day” events.