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 may lead to dependence in some cases.
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.
Up to 40% of U.S. adults 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 things to keep in mind before you start taking sleep 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.
Chronic insomnia is when you have difficulty sleeping at least 3 days a week for at least 3 months. 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.
Medications, pain conditions, or mental health conditions, such as depression or anxiety, can all cause insomnia. So can certain habits, such as eating or scrolling on your phone shortly before bed. Other times, there is no easy explanation for why a person can’t sleep.
Depending on the type of insomnia you have, a healthcare professional 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 team know which is more troubling for you.
Prescription sleep medications used for treating insomnia and sleep disturbances generally fall within one of the following categories:
Benzodiazepines, also known as “benzos”
Non-benzodiazepine sedative hypnotics or “z-drugs”
Melatonin receptor agonists
Orexin receptor antagonists
Certain antidepressants
Most healthcare professionals will have you return to their office a few weeks after starting one of these sleep medications to see if your symptoms have improved at all. They may also ask you if you’re having any side effects and how often you needed to take the medication.
Beating insomnia: Real people share their experiences with insomnia and how they were able to get the sleep they needed.
Over-the-counter (OTC) options: Read about the available OTC sleep medications — plus their safety and effectiveness — here.
Fall asleep quickly: Experts review their top tips for falling asleep fast — no medication required.
Most sleep 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 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. It's a 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 to help you sleep. Some benzodiazepines, such as estazolam or triazolam (Halcion), are FDA approved to treat insomnia. Benzodiazepines that are approved for anxiety, such as clonazepam (Klonopin), 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. But while both have a risk of misuse, benzodiazepines are more likely than z-drugs to do so. Both types of sleep medications are also associated with an increased risk of death and memory problems. Z-drugs 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 healthcare team.
Longer-acting z-drugs or benzodiazepines are sometimes prescribed 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 sleep medications include z-drugs such as zolpidem ER (Ambien CR) and eszopiclone (Lunesta), and benzodiazepines such as flurazepam and temazepam (Restoril).
Side effects: These medications have the same side effects as shorter-acting z-drugs and benzodiazepines. In addition, as mentioned above, longer-acting medications have an even higher risk of drowsiness, grogginess, or a headache the next morning.
Ramelteon (Rozerem) is another choice for helping you fall asleep. It’s a melatonin receptor agonist. 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’s side effects are generally mild, and it’s not habit forming. Common side effects include dizziness, nausea, and next-day drowsiness. Very rarely, people taking ramelteon have reported worsening depression and thoughts of suicide.
If you or someone you know is having thoughts of suicide, you’re not alone, and help is available. Call the National Suicide Prevention Lifeline at 988, or text “HOME” to 741-741 to reach the Crisis Text Line.
Though trazodone is an antidepressant, it's often prescribed as an off-label sleep medication. Trazodone commonly causes drowsiness as a side effect. Some healthcare professionals prescribe it at a low dose to help you fall asleep more easily.
Side effects: Common trazodone side effects include daytime sleepiness, dry mouth, 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 take trazodone.
Doxepin (Silenor) is a tricyclic antidepressant that’s FDA approved to treat insomnia. When used for insomnia, it’s recommended to take smaller dosages (3 mg to 6 mg). Larger dosages (10 mg or more) are approved for depression and anxiety.
Side effects: Doxepin isn’t habit forming, but it does have a number of side effects to consider. It commonly causes dry mouth, constipation, and dizziness. It can also raise your blood pressure or heart rate and increase the risk of falls, especially in older adults.
The newest class of sleep medications — called orexin receptor antagonists (ORAs) — work by blocking orexin, a natural chemical that tells your body it’s time to wake up. ORAs include suvorexant (Belsomra) and lemborexant (Dayvigo).
Side effects: Clinical studies haven’t found ORAs to be 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 prescriber about whether ORAs are the best match for your insomnia.
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 at least a 7- to 8-hour window to sleep after taking your medication to reduce this risk. One exception is sublingual zolpidem, which you can take if you have 4 hours or more left to sleep.
As with any medication, those prescribed to treat insomnia come with risks. Although it’s up to you and your prescriber to discuss your personal risks, there are a few things you should be aware of when it comes to sleep medication risks.
As mentioned above, 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 may also experience withdrawal symptoms like vomiting and sweating when you try to go without them. You can help prevent physical dependence by taking them only when needed.
Because they are habit forming, these medications are considered controlled substances by the Drug Enforcement Administration. Controlled substances are medications that have special restrictions on how they are prescribed. For example, you normally have to see a healthcare professional in-person at least once before receiving a prescription for a controlled substance.
Sleep medications 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. Also, some side effects — like falls — can be more harmful for older adults. If you choose to take these medications, work with your healthcare team closely and only take the lowest effective dose.
If you drink alcohol or take other medications that cause drowsiness, such as opioids or muscle relaxers, you should avoid taking sleep medications if possible. Mixing products such as zolpidem, lorazepam, and eszopiclone with alcohol or other sedating medications is dangerous. It can even be fatal. Make sure your prescriber knows about all the medications you take, including those from other healthcare professionals you see.
Over-the-counter (OTC) sleep aids are plentiful. But just like prescription sleep 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 OTC medications for insomnia contain one of the ingredients listed below.
Diphenhydramine, the active ingredient in Benadryl, is an antihistamine that’s found in OTC sleep aids under different names. Most people who take diphenhydramine get very drowsy within an hour of taking it. It’s not recommended to take diphenhydramine for sleep for longer than 14 days in a row.
Side effects: Diphenhydramine can cause side effects, such as dizziness, dry mouth, and memory issues. If you are over 65 years of age, you should avoid it due to a greater risk of serious side effects, including a higher risk of falls.
Doxylamine, the active ingredient in Unisom, belongs to the same class of medications as diphenhydramine: antihistamines. Compared to diphenhydramine, it lasts longer in the body. As with other OTC options, you shouldn’t take it regularly.
Side effects: Doxylamine has similar side effects to diphenhydramine. It’s also not recommended if you’re over 65 years old.
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 medications, we don’t know if it’s safe to take every night for chronic insomnia. The evidence surrounding taking melatonin for insomnia is mixed. Some say it helps with insomnia, while others show it makes no difference.
Side effects: Since melatonin is a supplement for sleep, it is not regulated like prescription or OTC medications are. Information regarding its possible side effects and safety are more limited. Most people seem to tolerate it well, though. It can cause next-day drowsiness, nausea, and headaches. However, there have been reports of people taking too much due to bottles containing more melatonin than the label advertises.
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 cognitive behavioral therapy. But if you think you may need sleep medication, talk to your healthcare team 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’s recommended to take these medications over the short term to minimize the health risks.
Costello, R. B., et al. (2014). The effectiveness of melatonin for promoting healthy sleep: A rapid evidence assessment of the literature. Nutrition Journal.
Howell, H. R., et al. (2011). Prescription sleep aids for the treatment of insomnia. U.S. Pharmacist.
Kripke, D. F., et al. (2016). Hypnotic drug risks of mortality, infection, depression, and cancer: But lack of benefit. F1000 Research.
Lupin Pharmaceuticals,Inc. (2020). Zolpidem tartrate- zolpidem tartrate tablet [package insert].
Muehlan, C., et al. (2023). The orexin story and orexin receptor antagonists for the treatment of insomnia. Journal of Sleep Research.
Pacheco, D., et al. (2023). Symptoms of insomnia. SleepFoundation.org.
Salzman, C. (2020). Do benzodiazepines cause Alzheimer’s disease? The American Journal of Psychiatry.
Sateia, M. J., et al. (2017). New Guideline. American Academy of Sleep Medicine.
Xia, L. B., et al. (2023). A review of physiological functions of orexin: From instinctive responses to subjective cognition. Medicine.