Treating Insomnia: Which Sleeping Pill Is Right for You? - GoodRx
provider image
Welcome! You’re in GoodRx for healthcare professionals. Now, you’ll enjoy a streamlined experience created specifically for healthcare professionals.
HomeHealth ConditionsInsomnia

What Are the Best Sleep Medications for Insomnia?

Christina Aungst, PharmDKatie E. Golden, MD
Updated on November 21, 2022

Key takeaways:

  • Several different types of sleep medications can treat insomnia. Some help you fall asleep, while others help you stay asleep. 

  • Sleep medications are intended for short-term use. Taking them long term can lead to dependence. 

  • Taking medication for insomnia has significant risks — even over the short term. Side effects include memory problems, falls, and even death. So it is important to understand the risks before you start taking one. 

A person lying awake in bed, staring at their ceiling.
PRImageFactory/iStock via Getty Images Plus

Nearly a third of all adults in the U.S. experience insomnia. So you aren’t alone if you have difficulty falling asleep or staying asleep

If you have tried insomnia treatments like lifestyle changes and cognitive behavioral therapy  without much improvement, you might be considering sleep medication. But there are some important things to keep in mind before you start taking medication for insomnia. First, these medications have significant risks. Second, it’s best to take them only for short periods of time. There is also no convincing evidence that sleep medications improve long-term health. 

With these caveats in mind, let’s dive into the different prescription and non-prescription medication options available to help with sleep.  

What is insomnia? 

Insomnia is when you have difficulty sleeping more than 3 days a week. This can mean you have trouble falling asleep. But it can also mean you have trouble staying asleep or you wake up too early and can’t get back to sleep. 

What causes insomnia?

Insomnia might be caused by medications, pain conditions, or mental health issues like depression or anxiety. Other times, there is no easy explanation for why a person can’t sleep.

Depending on the type of insomnia you have, your healthcare provider may recommend one or more of the following sleep medications. Some of these medications are better for helping you fall asleep, while others are better at helping you stay asleep. So make sure you let your provider know which is more troubling for you.

Common prescription sleep medications for insomnia

Prescription sleep medications used to treat sleep disturbances generally fall within one of the following categories: 

Most providers will have you return to their office a few weeks after starting one of these medications to see if your sleep has improved at all. They may also ask you if you’re having any side effects and how often you needed to take the medication.

Which medications are best for insomnia?

Most insomnia medications are better at helping you fall asleep, rather than helping you stay asleep. There are several options available, as outlined by the American Academy of Sleep Medicine.

Z-drugs and benzodiazepines

Z-drugs like zolpidem (Ambien) and zaleplon (Sonata) are commonly prescribed to help you fall asleep, especially if you don’t have chronic insomnia. They can be taken as needed and usually work within an hour.

An interesting Z-drug option is sublingual zolpidem (Intermezzo). It's a very low dose of zolpidem that dissolves quickly under your tongue and only lasts for a few hours. It’s meant for those who wake up halfway through the night and only have about 4 hours left until they need to get up.

Benzodiazepines are another option. Some benzodiazepines like estazolam (Prosom) or triazolam (Halcion) are FDA-approved to treat insomnia. Benzodiazepines for anxiety, like lorazepam (Ativan), might be prescribed if anxiety and insomnia are both issues.

Side effects: These medications can be habit-forming and are not recommended for long-term use. They are associated with increased risk of death and memory problems. Some of these medications can also cause people to hallucinate, have vivid nightmares, or perform actions like cooking and driving while asleep. If any of these side effects happen to you, discuss alternatives with your provider.

Ramelteon (Rozerem)

Ramelteon (Rozerem) is another choice for helping you fall asleep. It works in the same area of the body as melatonin — the body’s natural sleep hormone — to help promote sleep in a similar way. 

Side effects: Ramelteon tends to cause less side effects compared to other sleeping medications and is not habit forming, but many people say it doesn’t work as well.

Trazodone (Desyrel)

Though trazodone (Desyrel) is better known as an antidepressant, it is often used as an off-label treatment for insomnia. Trazodone causes drowsiness, so healthcare providers might prescribe it at a low dose to help you fall asleep more easily.

Side effects: Common side effects include daytime sleepiness, headache, and dizziness when standing up too quickly. It is not habit forming. There is a rare but very serious risk of a painful sustained erection (priapism) that can occur in male patients who use trazodone.

Doxepin (Silenor)

Doxepin is an older antidepressant that is also used to help with insomnia. Just like trazodone, at low doses it can help you fall asleep and stay asleep. It is not habit forming, so it is considered a safer option than z-drugs or benzodiazepines.   

Side effects: People with glaucoma or certain bladder/prostate problems shouldn’t use doxepin. It can also cause problems with blood pressure and heart rate, especially in older patients. And it may cause dizziness and increase the risk of falls. 

Longer-acting benzodiazepine receptor agonists (BzRAs)

These medications are sometimes used to help people who wake up too early. This is because they last longer in the body. But this also means they may cause more of a hangover sensation the following morning. 

Examples of medium- to long-acting medications are Z-drugs like zolpidem ER (Ambien CR) and eszopiclone (Lunesta), and benzodiazepines like flurazepam (Dalmane) and temazepam (Restoril).

Side effects: These medications have the same side effects as shorter-acting z-drug. In addition, as mentioned above, longer-acting medications have an even higher risk of drowsiness, grogginess, or a headache the next morning.

Orexin receptor antagonists

The newest class of sleep medications — called orexin receptor antagonists (ORAs) — work by blocking natural chemicals that tell your body it’s time to wake up. ORAs include Belsomra and Dayvigo. The downside is that they tend to be more expensive than other options. 

Side effects: ORAs are not habit forming like other sleep medications. Some people may engage in activities during sleep while taking this medication — like walking, driving, or eating. If any of these happen to you, talk to your doctor about whether ORAs are the best match for your insomnia.

When should I take these medications? 

Take your prescribed medication right before you plan to go to bed. Many people feel the effects within an hour of their dose. 

A “hangover” effect from any of these medications is possible the next morning. You might feel groggy or drowsy or have a headache. This is especially true if you wake up before the medication has fully worn off. It helps if you have a 7- to 8-hour window to sleep after taking your medication to reduce this risk. One exception is Intermezzo, which you can take if you have 4 hours or more left to sleep.

Risks with prescription sleep medications

As with any medication, those used to help with insomnia do come with risks. Although it’s up to you and your provider to discuss your personal risks, here are a few things you should be aware of.

They can be habit forming

Benzodiazepines and Z-drugs can be habit forming. This means that if you take them on a nightly basis, your body can become dependent on them to sleep. It can be very difficult to stop taking them if you’ve been on them for a while. You can have withdrawal symptoms like vomiting and sweating when you try to go without them. You can help prevent physical dependence on these medications by taking them only when needed.

Because they are habit forming, these medications are considered controlled substances by the Drug Enforcement Administration (DEA). Controlled substances are medications that have special restrictions on how they are prescribed. For example, you normally have to see a provider in-person (at least once) before receiving a prescription for a controlled substance. 

Older adults should be extra careful

Medications to treat insomnia can be dangerous for older adults. They may experience more intense side effects from these medications, and they are more likely to become physically dependent on habit-forming ones. If you choose to take these medications, work with your healthcare provider closely and use the lowest effective dose.

Don’t mix them with other medications or alcohol

Finally, if you drink alcohol or take other medications that cause drowsiness, such as opioids or muscle relaxers, you should avoid using medications that help you fall asleep. Mixing products like zolpidem, lorazepam, and eszopiclone with alcohol or other sedating medications is dangerous. It can even be fatal. Make sure your provider knows about all the medications you take, including those from other providers you see.

Over-the-counter options for treating insomnia

Over-the-counter (OTC) sleep aids are plentiful, but just like prescription medications, they have not been shown to improve long-term health in any significant way. In fact, the American Academy of Sleep Medicine says to avoid them when treating chronic insomnia. But, when used sparingly, OTC sleep aids can be an alternative if you do not want to take prescription sleep medications.

Most sleep aids contain one of the ingredients listed below.

Diphenhydramine

Diphenhydramine, the active ingredient in Benadryl, is also found in OTC sleep aids under different names. Most people who take diphenhydramine get very drowsy within an hour of taking it. 

Side effects: Diphenhydramine can cause problems with dizziness, falls, memory issues, urination, and prolonged grogginess. If you are over 65 years of age, you should avoid it due to the many risks.

Doxylamine

Doxylamine, the active ingredient in Unisom, belongs to the same class of medications as diphenhydramine: antihistamines. As with other OTC options, you shouldn’t take it regularly. 

Side effects: Doxylamine has similar side effects to diphenhydramine. It is not a good idea to take it if you’re over 65 years old.

Melatonin

Melatonin is the hormone our body produces when the sun goes down that helps us fall asleep. Many people think of OTC melatonin supplements as a natural way to get some shuteye. While it doesn’t carry as many risks as other sleep aids, we don’t know if it’s safe to take every night for chronic insomnia. Current studies on using melatonin for insomnia are mixed: Some say it helps with insomnia, while others show it makes no difference. 

Side effects: The American Academy of Sleep Medicine has issued a warning about melatonin’s safety in kids. Since melatonin is a supplement for sleep and not a drug, it is not regulated like other medications are. There have been reports of overdose since bottles may contain more melatonin than the label advertises. It can cause next-day drowsiness, nausea, and headaches.

The bottom line

Insomnia is a common problem, and it can have a significant impact on your life. The most effective and safest way to treat insomnia is with good sleep habits and behavioral therapy. But if you think you may need medication, talk to your provider about which option is best for you. And be sure to consider the side effects of that medication as well — for many people, the risks may outweigh the benefits. 

No matter what you decide, it is important to only use these medications over the short term to minimize the health risks.

References

Costello, R. B., et al. (2014). The effectiveness of melatonin for promoting healthy sleep: A rapid evidence assessment of the literature. Nutrition Journal.

Deshong, A., et al. (2022). Sleep disorders. The Sleep Doctor.

View All References (8)

Katwala, J., et al. (2013). Therapeutic rationale for low dose doxepin in insomnia patients. Asian Pacific Journal of Tropical Disease.

Kripke, D. F., et al. (2016). Hypnotic drug risks of mortality, infection, depression, and cancer: But lack of benefit. F1000 Research.

Pergolizzi, J. V., et al. (2014). Fast-acting sublingual zolpidem for middle-of-the-night wakefulness. Sleep Disorders.

Roehrs, T., et al. (1994). Sedative, memory, and performance effect of hypnotics. Pharmacology.

Sateia, M. J., et al. (2017). New Guideline. American Academy of Sleep Medicine.

Tejada, I. S. D., et al. (1991). Pathophysiology of prolonged penile erection associated with trazodone use. The Journal of Urology.

Vargas, I., et al. (2020). Acute and chronic insomnia: What has time and/or hyperarousal got to do with it?. Brain Sciences.

Yahia, K., et al. (2017). Trazodone for insomnia: A systematic review. Innovations in Clinical Neuroscience.

GoodRx Health has strict sourcing policies and relies on primary sources such as medical organizations, governmental agencies, academic institutions, and peer-reviewed scientific journals. Learn more about how we ensure our content is accurate, thorough, and unbiased by reading our editorial guidelines.

Was this page helpful?

Habits for a Healthier Mind!

Sign up for our GoodRx Mental Well-being Newsletter to receive up-to-date information on the latest medications, tips, and savings that are most relevant to you.

By signing up, I agree to GoodRx's Terms and Privacy Policy, and to receive marketing messages from GoodRx.