Skip to main content
Medically Approved

The scoop on sleep medications

twitter share buttonfacebook share buttonlinkedin share buttonemail article button
Melatonin just not doing the trick? Here’s what to know about how prescription medications could help with insomnia.
Written by Emily Shiffer
Updated on October 5, 2022

Do you toss and turn all night? Is it hard for you to fall asleep? Or do you doze off right away but then wake up a couple of hours later? If this is you, you’re probably tired of feeling tired. And you’re not alone. According to a 2018 study, 1 in 4 Americans get insomnia each year. The good news: 75% of people recover from it within 12 months.

Insomnia is a type of sleep disorder that can take a toll on your daily life and overall health. One way to deal with it is by taking a prescription medication.

“Cognitive behavioral therapy [CBT] and other nonpharmacologic therapies are the first-line treatments for insomnia. But medications are still frequently used,” says Funke Afolabi-Brown, MD. She’s a sleep doctor and founder of Restful Sleep MD.

Medications may be used if CBT doesn’t improve your sleep. They’re also prescribed for people with anxiety, depression or other mental health issues that can affect quality of sleep.

Dr. Afolabi-Brown adds that sleep medication should be taken on an as-needed basis. And it should be used for as short a time as possible. Over time, sleep medication may not work as well. And you could become dependent on it.

If your doctor thinks medication might be right for you, you’ll need to see a sleep specialist. This person will get your medical history and a list of allergies and medications you take.

Depending on your history, you might undergo other tests. “For example, if you snore, you may need to have a sleep study to check for sleep apnea,” says Dr. Afolabi-Brown. These tests are important for determining your type of insomnia. 

“For example, if you have trouble falling asleep, a short-acting medication will be beneficial,” says Dr. Afolabi-Brown. “But if the trouble is staying asleep, you may need a longer-acting medication.”

Have you gotten your free Optum Perks® prescription discount card? It could save you up to 80% at the pharmacy. Get it now.

Types of sleep medications

There are many different sleep medications your doctor may prescribe. Here are some of the most common:


Dopexin is an antidepressant that blocks receptors in the brain called histamines. Histamines are a type of neurotransmitter. Blocking them slows down brain activity, which helps people get to sleep.

“Doxepin helps decrease the time it takes to fall asleep and increases the time from sleep onset to waking. This increases total sleep time,” says Dr. Afolabi-Brown. You should sleep better within a few days of taking it.

A caveat: Doxepin is highly sedating. You should take it about 30 minutes before bedtime. And make sure you can be in bed for at least 7 to 8 hours.

Doxepin also comes with a lot of side effects. “They include drowsiness, agitation, confusion, nausea, blood abnormalities and hypertension,” says Dr. Afolabi-Brown.

As with many antidepressants, it can interact with other medications.

Doxepin is not habit-forming and doesn’t carry risk for abuse.


Eszopiclone (Lunesta®) is in a category of medications called Z-drugs. Scientists aren’t exactly sure how the medication works. It’s thought to increase the amount of a chemical in your brain called gamma-aminobutyric acid (GABA). This chemical slows activity in your brain, helping you to sleep.

“Eszopiclone has a longer half-life than the other Z-drugs. And that’s helpful for sleep maintenance,” says Dr. Afolabi-Brown. Your sleep should improve within 7 to 10 days of taking the medication.

Because it lasts so long, there’s a chance you’ll feel sleepy during the day. Your doctor may reduce the amount of medication to prevent this.

“Patients have also reported a metallic taste in their mouth,” says Dr. Afolabi-Brown.

Be sure to take this medication only as directed. Don’t take more of it, take it more often or take it longer than your doctor ordered. It may become habit-forming (causing mental or physical dependence).


Zaleplon is a type of fast-onset Z-drug. It quickly slows down the nervous system. “The peak effect is about 1 hour, making it helpful for people with trouble falling asleep,” says Dr. Afolabi-Brown. “The fast action allows it to be taken right before bed.”

It’s not used for people who can’t stay asleep at night.

Dr. Afolabi-Brown says you need to avoid high-fat meals when taking zaleplon. It may keep you from absorbing the medication.

Zaleplon can be habit-forming. Don’t take a larger dose, take it more often or take it for a longer time than prescribed by your doctor.

Also, don’t stop taking zaleplon suddenly. You could have withdrawal symptoms, including anxiety, stomach and muscle cramps, nausea, vomiting, sweating and shakiness. Your doctor will decrease your dose gradually.

Recommended reading: How your internal clock affects your health.

Pharmacists looking at medications.

Save up to 80% on your medications

Get prescriptions for as low as $4 with our free discount card, redeemable at over 64,000 pharmacies nationwide.

Get free card


Zolpidem was the first Z-drug for insomnia approved by the Food and Drug Administration (FDA) in December 1992. It also interacts with GABA to slow brain activity. “It has different formulas, including immediate-release and extended-release,” says Dr. Afolabi-Brown. “The immediate-release is good for sleep-onset insomnia. The extended-release formulation is better for sleep-maintenance insomnia.”

The medication comes in these forms:

  • Tablet (Ambien®)
  • Sublingual tablet, which is placed under the tongue (Edluar™, Intermezzo®)
  • Oral spray (ZolpiMist®)

Dr. Afolabi-Brown adds that you should take zolpidem on an empty stomach. Food can prevent your body from absorbing it.

“The most common side effects are headaches, drowsiness and dizziness,” says Dr. Afolabi-Brown. It may also cause high blood pressure and heart issues.


Lemborexant (Dayvigo®) is in a group of medications called dual orexin receptor antagonists (DORAs). It blocks orexin receptors in the brain. Orexin regulates appetite, wakefulness and arousal. When the receptors are less active, it allows for better sleep.

“It can cause daytime sleepiness and increased risk of falls. And it should be taken immediately before bed — at least 7 hours before awakening,” says Dr. Afolabi-Brown.

She notes that patients with narcolepsy shouldn’t take lemborexant. And it’s a controlled substance, so people who have problems with drugs or alcohol shouldn’t take it.

Lemborexant can be habit-forming if not taken as ordered by your doctor.


Ramelteon is in a class of medications called melatonin receptor agonists.

“Melatonin is produced by the brain. When this receptor is stimulated, it causes sleepiness,” explains Dr. Afolabi-Brown. “Ramelteon has a short half-life, so it’s beneficial for people who have trouble falling asleep.”

She says it’s not addictive and doesn’t cause withdrawal symptoms when stopped. It also has fewer side effects than other sleep medications.

“Some side effects are headache, sleepiness and throat pain. If you have liver problems, the dose may be adjusted,” says Dr. Afolabi-Brown.

The bottom line: If you’re having trouble sleeping, talk to your doctor. Lifestyle changes and over-the-counter supplements can help. But if those aren’t enough, there are medications that can help get your sleep back on track.

 Did you know that our prescription discount card can help you save money? It’s free and can be used at more than 64,000 pharmacies nationwide.

Additional sources:
Insomnia stats: University of Pennsylvania School of Medicine
Sleep disorder drug information: U.S. Food and Drug Administration