Medications for insomnia
What sleep medications are used, where the newer orexin antagonists fit, and why CBT-I is still first-line.
First-line options
Before any medication, the framework: CBT-I. Cognitive behavioral therapy for insomnia beats hypnotics for durable improvement in sleep and daytime function. It works, and the effect outlasts the therapy course. Online CBT-I programs (SHUTi, Sleepio, VA's CBT-i Coach) are reasonable when in-person access is limited. Sleep hygiene, stimulus control, sleep restriction, and cognitive restructuring are the ingredients. Medication is added to CBT-I or used when CBT-I isn't the right fit.
For medications, the current first-line picture:
Orexin receptor antagonists
The dual orexin receptor antagonists (DORAs) are the newest class and increasingly favored for chronic insomnia because of a lower dependence and cognitive-impairment profile compared to z-drugs and benzodiazepines.
Suvorexant (Belsomra) at 10 to 20 mg was the first DORA, approved 2014. Onset is 30 to 60 minutes. Half-life is around 12 hours, which can leave morning grogginess for some patients.
Lemborexant (Dayvigo) at 5 to 10 mg was approved 2019. Faster onset than suvorexant, similar duration.
Daridorexant (Quviviq) at 25 to 50 mg was approved 2022. Shorter half-life (roughly 8 hours), designed to minimize next-day residual effects.
DORAs help with both sleep onset and sleep maintenance. They aren't Schedule IV (they're Schedule IV for DEA scheduling but have less dependence liability than z-drugs). Cost is the main limiter, since most are still brand-name and expensive.
Z-drugs
The z-drugs (non-benzodiazepine hypnotics) still work and are still widely prescribed for short-term use.
Zolpidem (Ambien, Ambien CR, Intermezzo, Edluar, Zolpimist) at 5 to 10 mg is the workhorse. IR is for sleep onset (30 minutes onset, 6 to 8 hours), CR is for maintenance. Intermezzo is a sublingual formulation for middle-of-the-night awakenings.
Eszopiclone (Lunesta) at 1 to 3 mg helps both sleep onset and maintenance. Longer half-life than zolpidem. Metallic taste is the common complaint.
Zaleplon (Sonata) at 5 to 20 mg has the shortest half-life. Useful for sleep onset only, and can be dosed as late as 4 hours before waking without residual effects.
The z-drugs carry a boxed warning for complex sleep behaviors (sleep-driving, sleep-eating). They have real dependence potential with chronic use, tolerance can develop, and they should ideally be used short-term (4 to 6 weeks) or intermittently rather than nightly for years. In older adults, they're on the Beers Criteria list because of falls and cognitive risk.
Ramelteon
Ramelteon (Rozerem) at 8 mg is a melatonin receptor agonist. It helps sleep onset but does little for sleep maintenance. Not a controlled substance, no dependence risk, minimal cognitive effects. Useful for older adults or patients who can't take z-drugs. Cost is a limiter.
Over-the-counter melatonin at 0.5 to 3 mg has some evidence for sleep onset, is very cheap, and is often tried before ramelteon. Quality control varies across OTC brands. See OTC and natural sleep aids.
Second-line and augmentation
Sedating antidepressants (off-label except doxepin)
Sedating antidepressants at low doses are prescribed heavily for insomnia. The evidence varies by agent and dose.
Doxepin is FDA-approved for insomnia at very low doses (3 mg and 6 mg, brand name Silenor). At those doses it acts primarily as an H1 antihistamine with minimal anticholinergic effect. Good evidence for sleep maintenance. Higher doses (25 to 300 mg) are used off-label but come with more anticholinergic burden.
Trazodone at 25 to 150 mg is one of the most-prescribed sleep medications despite modest evidence. It works for many patients, is cheap, and doesn't carry the dependence risk of controlled substances. Orthostatic hypotension in older adults is a real concern. Priapism is rare but serious.
Mirtazapine at 7.5 to 15 mg for sleep specifically (higher doses activate more than sedate). Best when insomnia comes with depression, anxiety, and poor appetite. Weight gain is substantial with sustained use.
Amitriptyline at 10 to 50 mg is used off-label for insomnia. Sedating, anticholinergic burden, cardiac risk in overdose. Beers-listed. Rarely first choice now unless there's a comorbid pain reason.
Benzodiazepines
Some benzodiazepines are FDA-approved for insomnia specifically: temazepam (Restoril), triazolam (Halcion), flurazepam (Dalmane). Others (lorazepam, clonazepam) are used off-label.
The concerns are the usual benzodiazepine concerns: tolerance, dependence, cognitive effects, falls in older adults, respiratory depression combined with opioids or alcohol. They're rarely first-line for insomnia now. Reasonable in short-term use for acute insomnia in select patients, or as part of an existing anxiety regimen when insomnia is a piece of the anxiety picture. See the benzodiazepine class page.
Antipsychotics for insomnia (rare, off-label)
Low-dose quetiapine (25 to 100 mg) is prescribed off-label for insomnia. It works. It also comes with metabolic effects (weight, glucose, lipids) that don't belong in a routine insomnia treatment, and it carries the class boxed warning for mortality in dementia. It's a poor choice for uncomplicated insomnia. Reasonable in select patients with treatment-resistant insomnia and no other options, or when there's a psychiatric indication (bipolar, schizophrenia) that also warrants an antipsychotic. See the antipsychotic class page for the fuller picture.
Olanzapine similarly. Rarely appropriate for isolated insomnia.
Antihistamines (OTC and prescription)
Diphenhydramine (Benadryl, Tylenol PM, Advil PM) and doxylamine (Unisom) are the OTC sleep antihistamines. They work in the short term, but tolerance develops quickly, and the anticholinergic burden is real. Beers Criteria specifically lists first-generation antihistamines as inappropriate in older adults. Chronic use has been associated with dementia risk in some observational studies.
Hydroxyzine is the prescription antihistamine used for anxiety and PRN sleep. Sedating, anticholinergic, non-habit-forming. Reasonable for short-term or PRN use.
Gabapentinoids
Gabapentin at 100 to 900 mg at bedtime is used off-label for insomnia, particularly when there's comorbid pain, restless legs, or anxiety. Pregabalin similarly. Sedation is the main side effect.
Sodium oxybate
Sodium oxybate (Xyrem) is FDA-approved for narcolepsy with cataplexy and for idiopathic hypersomnia. Not used for routine insomnia. It's tightly controlled REMS.
When to consider a different approach
The medication isn't working
If a sleep medication isn't working, the questions to run through:
- Is CBT-I on board? Medications work better with behavioral treatment.
- Is there an underlying condition? Untreated obstructive sleep apnea is the single most common miss. Restless legs syndrome, chronic pain, depression, anxiety, PTSD, hyperthyroidism, and prostatic hypertrophy (nocturia) all masquerade as primary insomnia.
- Is there a schedule problem? Delayed sleep phase, shift work, and irregular sleep-wake schedules respond to timing interventions more than to sedatives.
- Is caffeine, alcohol, or nicotine in the picture? All three sabotage sleep. Alcohol is the biggest one that patients underrate.
- Is the dose right, and is the pharmacokinetics matched to the problem? Sleep-onset problem uses a fast-onset, shorter-duration agent. Sleep-maintenance problem needs a longer-duration agent.
Long-term hypnotic use
Nightly hypnotic use for years is common and often reasonable, but it's also often the wrong answer to a problem that started years earlier. Tapering is possible and usually done gradually while CBT-I supports the transition. Cross-titrating a benzodiazepine or z-drug down to a lower dose or switching to a DORA or ramelteon while behavioral treatment engages is a reasonable path.
Complex sleep behaviors
Sleep-driving, sleep-eating, and sleep-related activities without memory are boxed warnings for the z-drugs and can happen at usual doses. If they occur, the medication should be stopped and switched.
Special considerations
Older adults
The Beers Criteria list flags benzodiazepines, z-drugs, first-generation antihistamines, and TCAs as inappropriate in older adults. Ramelteon, low-dose doxepin (3 to 6 mg), trazodone at low doses (25 to 50 mg, watching orthostasis), and the DORAs are the safer options. See Beers Criteria for psychiatric medications.
Falls and delirium risks are real with any sedative in older adults. In dementia patients specifically, avoiding z-drugs and benzodiazepines is the standard, and trazodone at low dose is often the practical choice when a medication is needed.
Pregnancy
Medication use for insomnia in pregnancy is a nuanced decision. CBT-I is preferred. Diphenhydramine and doxylamine have been used with reasonable safety data. Trazodone and mirtazapine have some reproductive data. See the pregnancy safety reference.
Obstructive sleep apnea
Sedatives can worsen OSA. Insomnia that hasn't responded to hypnotics and comes with snoring, witnessed apnea, or daytime sleepiness deserves a sleep study before more medication is added.
Comorbid depression
If insomnia is a symptom of depression, treating the depression often improves sleep, sometimes with a mildly sedating antidepressant (mirtazapine at 7.5 to 30 mg, trazodone as adjunct) as the primary agent.
Comorbid anxiety
If insomnia is a symptom of anxiety, treating the anxiety (SSRI or SNRI) is usually more useful than layering a hypnotic. Short-term hypnotic bridging while the SSRI titrates in is reasonable.
Comorbid PTSD
Trauma-related nightmares and insomnia respond to prazosin (off-label) at 1 to 15 mg at bedtime. Trauma-focused therapy is the anchor treatment. See medications for PTSD.
Comorbid substance use
Benzodiazepines and z-drugs are usually avoided in patients with alcohol or opioid use disorders. DORAs, ramelteon, and low-dose sedating antidepressants (doxepin, trazodone, mirtazapine) are reasonable. Sleep problems are common in early recovery and often improve with time.
What tips the choice
- Short-term insomnia (jet lag, situational stress): a short course of a z-drug or a DORA, or ramelteon. Melatonin OTC is a reasonable first try.
- Chronic insomnia, no comorbidities: CBT-I first, and if medication is added, a DORA is the preferred long-term option in current practice.
- Sleep onset problem primarily: zaleplon, ramelteon, zolpidem IR, or a DORA.
- Sleep maintenance problem primarily: zolpidem CR, eszopiclone, low-dose doxepin, or a DORA.
- Both onset and maintenance: eszopiclone, DORA, or trazodone.
- Older adult: ramelteon, low-dose doxepin (3 to 6 mg), or a DORA. Avoid z-drugs, benzodiazepines, and first-gen antihistamines.
- Depression comorbid: mirtazapine or trazodone as part of the antidepressant regimen.
- Anxiety comorbid: treat the anxiety, add a short-term hypnotic if needed.
- PTSD comorbid with nightmares: prazosin, plus a hypnotic for sleep onset if needed.
- Substance use history: DORAs, ramelteon, or sedating antidepressants at low dose.
- Pregnancy: CBT-I preferred. Diphenhydramine or doxylamine have some safety data.
- Chronic pain contributing: gabapentin or low-dose amitriptyline (in younger patients), or duloxetine if pain is neuropathic and depression is present.
Common questions
How long is it safe to take a sleeping pill? Depends on the pill. Z-drugs and benzodiazepines are usually recommended for 2 to 4 weeks at a stretch, with intermittent rather than nightly dosing. DORAs, ramelteon, and low-dose doxepin have been used long-term with fewer dependence and cognitive concerns. Trazodone off-label is often used for years. Any long-term use should include periodic reassessment of whether the medication is still needed and whether CBT-I could reduce or replace it.
Isn't melatonin natural, so it must be safe? Melatonin is a hormone your body makes, and low-dose supplementation has a reasonable safety profile. The catches: OTC melatonin is not FDA-regulated, and content vs. label can vary widely across brands (some studies have found labels off by 40% or more). Timing matters more than dose for most sleep-onset use (0.5 to 3 mg, 30 to 60 minutes before target bedtime). Higher doses (5 to 10 mg) don't work better and can cause morning grogginess.
Why is CBT-I first-line if pills work? CBT-I outperforms medication for durable improvement in sleep. Medications work while you take them. CBT-I retrains the sleep system and the effect persists after the therapy ends. Combined treatment (medication plus CBT-I) is often the practical answer, with the goal of tapering the medication as CBT-I engages.
Can I combine sleep medications? Usually not without a prescriber's guidance. Combining benzodiazepines with z-drugs, or either with alcohol, or with opioids raises overdose risk substantially. Combining trazodone with a DORA is reasonable in some clinical scenarios but should be discussed. Layering multiple sedatives is one of the more common ways patients end up with next-day impairment or falls.
What about medical cannabis for sleep? Cannabis has some acute sedative effect (particularly indica strains and edibles) but suppresses REM sleep and can cause rebound insomnia when discontinued. Long-term use is associated with tolerance, and daytime cognitive effects can be substantial. It's not a first-line treatment, and the evidence base is limited compared to the standard options.
Sources
This guide draws on current prescribing information, treatment guidelines, and public health references. It is reviewed for clinical accuracy and updated as guidance changes.
- American Academy of Sleep Medicine. Clinical practice guideline for the pharmacologic treatment of chronic insomnia in adults.
- American College of Physicians. Management of chronic insomnia disorder in adults.
- National Institute of Mental Health. Sleep.
- MedlinePlus, U.S. National Library of Medicine.
THE KNOWLEDGE PATH
Walk this topic outward.
- GUIDE Medications for insomnia (current)
- CLASS SSRIs
- MEDICATION Sertraline (Zoloft)
- CONDITION Major Depressive Disorder (on Shrinkopedia)
- CARE Consider depression evaluation at shrinkMD
The Knowledge Path is a curated walk. Every step is one decision away from the next.
Managing a medication needs a prescriber
Any psychiatric medication has to be started and adjusted by a clinician who can follow you over time. If you don't have a prescriber, our guides section explains the options, including in-person care and telepsychiatry, and how to choose between them.