There is no single best sleep medication. Prescription options like trazodone (25-100 mg) or low-dose doxepin (3-6 mg) target specific problems, while over-the-counter choices like melatonin (0.5-3 mg) and magnesium (200-400 mg) work differently. CBT-I remains the first-line treatment for chronic insomnia.
Choosing the right sleep medication starts with one question: are you struggling to fall asleep, or to stay asleep? That distinction, more than brand names or marketing, determines which prescription or over-the-counter option is actually a fit. It also matters that medication is not automatically the first step — cognitive behavioral therapy for insomnia (CBT-I) produces better long-term remission than sleep medication alone, with no dependency or rebound insomnia risk, which is why it is the recommended first-line treatment for chronic insomnia. For more on that non-drug approach, see insomnia and how to sleep better.
There is no universal "best" prescription sleep medication because doctors match the drug to the specific sleep complaint. Trazodone, an antidepressant used off-label for sleep, is the most commonly prescribed insomnia medication in the United States. The typical sleep dose is 25-100 mg at night, and most people start at 25-50 mg.
For people who fall asleep fine but wake up in the early morning hours, low-dose doxepin (3-6 mg) is often preferred. It is a selective H1 (histamine) antagonist at this low dose and is generally considered a first-line option for sleep maintenance in older adults, since it improves the ability to stay asleep through the last third of the night.
Grouped by category, the common sleep medications people ask about are: prescription drugs used for insomnia (trazodone, low-dose doxepin), over-the-counter supplements (melatonin, magnesium, ashwagandha, L-theanine), and the non-drug gold standard, CBT-I. CBT-I outperforms medication for long-term remission from chronic insomnia, with an odds ratio of roughly 1.82 for remission at one year compared to medication alone, and without the dependency risk that comes with ongoing drug use.
Melatonin is the most recognizable over-the-counter sleep aid, but it is a chronobiotic — a timing hormone — rather than a direct sedative. The typical starting dose is 0.5-1 mg, with a common effective range of 1-3 mg taken about 30 minutes before bed. Doses above 5 mg are not shown to work better, and 10 mg is considered the practical ceiling. Melatonin works best for jet lag or a shifted body clock and has more limited benefit for primary insomnia.
Magnesium is the other well-studied option, generally used at 200-400 mg of elemental magnesium about 30-60 minutes before bed. In a randomized controlled trial, magnesium bisglycinate specifically reduced time to fall asleep by about 17.8 minutes and increased deep sleep by about 19.3%. Read more in magnesium for sleep.
Antihistamine-based sleep aids are also sold over the counter as a broad category, though a pharmacist is the best resource for comparing specific products and how they may interact with other medications you take.
Beyond the prescription and over-the-counter categories, several supplements are used specifically as medicine to help you sleep. Ashwagandha (KSM-66 extract) at 600 mg or more per day shows moderate evidence for improving how quickly people fall asleep and overall sleep efficiency, though long-term data beyond 12 weeks is still limited. L-theanine, well tolerated at doses up to 450 mg per day, tends to improve how rested people feel subjectively, with smaller effects on objectively measured sleep.
The best medicine for sleep depends entirely on the problem being solved. For circadian issues like jet lag, melatonin is the better-matched tool. For difficulty staying asleep, low-dose doxepin or magnesium may be more appropriate. For chronic insomnia lasting months, CBT-I is the treatment with the strongest long-term evidence. There is no single supplement or drug that works best for everyone.
Sleep need itself varies dramatically by age — from 14-17 hours for newborns down to 8-10 hours for teenagers — which is one reason medication guidance built for adults does not automatically transfer to children. Dosing information for melatonin and other sleep aids above is based on adult data, so any medication or supplement for a child's sleep, including melatonin gummies, should be discussed with a pediatrician first. Sleep organizations generally recommend addressing sleep habits and routines — see how to sleep better — before considering medication for a child.
A growing area of sleep medicine research targets the brain's orexin (hypocretin) system, a signaling pathway from the lateral hypothalamus that stabilizes the transitions between sleep and wakefulness. A deficiency in this system is what causes narcolepsy type 1, which is part of why orexin signaling has become a focus for newer medication development. Because treatment options and approvals in this area change over time, ask your doctor or pharmacist which newer sleep medications are currently considered appropriate for your specific situation.
The most reliable way to find the right sleep medicine near you is to start with your primary care doctor or a local pharmacist, who can review your symptoms and medical history before recommending an over-the-counter option or a prescription. If your main issue is loud snoring, gasping for air, or heavy daytime sleepiness, ask about a referral to a sleep specialist rather than starting with medication — those symptoms point toward sleep apnea, which medication does not treat. Read more in CPAP machines for sleep apnea. If the problem is ongoing insomnia, three or more nights a week for three months or longer, ask specifically about CBT-I, covered in more depth at insomnia.
Talk to a doctor before starting or combining any sleep medication, and seek medical advice if:
A doctor or pharmacist can confirm the right option and dose for your specific situation.