Melatonin and Sleep Aids: What Works and What to Watch For

Melatonin may help with jet lag but does little for ongoing insomnia. Here is what the evidence says about melatonin, antihistamine sleep aids and supplements, plus safer first steps.

HealthPathCore9 min read
An amber supplement bottle with a blank label surrounded by loose capsules and tablets, small wooden bowls and green leaves on a white surface

The short answer

Melatonin may help with jet lag and some body clock problems, but evidence for ongoing insomnia is weak, and labels do not always match contents. Antihistamine sleep aids cause next-day grogginess and are riskier for older adults. CBT for insomnia is the recommended first treatment, and insomnia lasting more than a few weeks deserves a doctor visit.

Key takeaways

  • Melatonin is a hormone that signals night to your body clock, and in the US it is sold as a dietary supplement that the FDA does not approve for safety and effectiveness before sale.
  • NCCIH says melatonin may help with jet lag and delayed sleep-wake phase disorder, while NHLBI states research has not proven it effective for insomnia.
  • In a 2023 study described by NCCIH, 22 of 25 melatonin gummy products were inaccurately labeled, and some held more than three times the stated amount.
  • A CDC estimate cited by NCCIH counted about 11,000 emergency visits from 2019 to 2022 for young children who swallowed melatonin unsupervised, so store it like medicine.
  • Over-the-counter sleep aids such as diphenhydramine and doxylamine are sedating antihistamines meant for occasional sleeplessness, and MedlinePlus advises against diphenhydramine for most older adults.
  • Valerian, magnesium and chamomile have weak or inconsistent evidence for insomnia.
  • Cognitive behavioral therapy for insomnia (CBT-I) is a 6- to 8-week program that NHLBI says is usually the first recommended treatment for long-term insomnia.
  • Loud snoring, gasping during sleep, or insomnia lasting more than a few weeks are reasons to see a doctor rather than reach for another sleep aid.

When you have been staring at the ceiling for an hour, the pharmacy aisle starts to look tempting. Melatonin gummies, "PM" tablets, valerian capsules and magnesium powders all promise a better night, and most of them are sold without a prescription.

Some of these products help in specific situations, some have weak evidence, and a few carry risks that are easy to overlook, especially for older adults and young children. Sleep is closely tied to mood, stress and mental health, so it is worth choosing carefully. This article explains what each option is, what the evidence says, and when a sleep problem needs a doctor rather than a supplement. It cannot diagnose you, but it can help you decide what to try and what to ask.

What is melatonin, and how does it work?

Melatonin is a hormone your brain makes in response to darkness. It helps set the timing of your circadian rhythm, your roughly 24-hour internal clock, and signals to your body that it is night. Light at night, including bright screens, can hold back its release.

That is an important distinction. Melatonin is more of a timing signal than a sedative, which is why it tends to help most when your body clock is out of sync with the clock on the wall, as with jet lag, rather than when stress or worry is keeping you awake.

In the United States, melatonin is sold as a dietary supplement. According to the FDA, it does not have the authority to approve dietary supplements for safety and effectiveness before they are sold, so the company that makes them is responsible for what goes into the bottle. In some other countries, melatonin is available only by prescription.

How do common sleep aids compare?

The options on the shelf work in different ways and come with different trade-offs. This table summarizes what each one is and how strong the evidence is, in words rather than numbers.

Sleep aidWhat it isEvidence, in wordsMain cautions
MelatoninA hormone sold as a dietary supplement in the USMay help with jet lag and some body clock timing problems; not recommended for long-term insomniaLabels may not match contents; headache, dizziness, nausea, daytime sleepiness; keep away from children
DiphenhydramineAn older, sedating antihistamine in many "PM" and nighttime productsCauses drowsiness, but it is meant for occasional sleeplessness, not a nightly habitNext-day grogginess, dry mouth, trouble urinating; generally not advised for older adults
DoxylamineAnother sedating antihistamine sold for occasional sleeplessnessWorks similarly to diphenhydramine, with the same short-term roleSimilar side effects and the same extra caution for older adults
ValerianAn herbal supplement made from a plant rootInconsistent results; its value for insomnia has not been shownHeadache, stomach upset, vivid dreams; do not combine with alcohol or sedatives
MagnesiumA mineral sold as a supplementVery little research for sleep, and the studies that exist are low qualityToo much can cause diarrhea, nausea and cramping
ChamomileAn herb, usually taken as teaNo conclusive evidence from clinical trialsPossible allergic reactions, especially if you are allergic to ragweed
CBT for insomnia (CBT-I)A structured, short-term therapy program for sleepUsually recommended as the first treatment for long-term insomniaTakes several weeks of effort; you may feel sleepier during the first weeks

Does melatonin actually help you sleep?

Melatonin may help in a few specific situations, but its effect on ordinary insomnia is modest at best. According to the National Center for Complementary and Integrative Health (NCCIH), the best support is for jet lag, and it may also help people with delayed sleep-wake phase disorder, a body clock problem in which you cannot fall asleep until very late and struggle to wake in the morning.

For chronic insomnia, the picture is weaker. NCCIH notes that a 2022 review found melatonin helped people with insomnia fall asleep somewhat faster but did not improve sleep quality or time spent awake during the night, and sleep medicine guidelines have recommended against using it to treat chronic insomnia. NHLBI states that research has not proven melatonin to be an effective treatment for insomnia.

So if your problem is a shifted body clock, melatonin may be worth discussing with your doctor. If your problem is lying awake with a busy mind, or waking at 3am and not getting back to sleep, it is unlikely to be the answer on its own.

Is melatonin safe?

Short-term use appears to be safe for most adults, according to NCCIH, but there is little information about long-term safety, and that matters because many people end up taking it every night for months or years.

What side effects can it cause?

Reported side effects in adults include headache, dizziness, nausea and sleepiness. NHLBI also lists daytime sleepiness, upset stomach, worsening depression, and changes in blood pressure. In older adults, melatonin may stay active in the body longer and cause daytime drowsiness.

Talk to your doctor before taking it if you take any prescription medicine, and especially if you have epilepsy or take a blood thinner, because NCCIH advises medical supervision in those cases. Research on safety during pregnancy and breastfeeding is lacking.

Does the label match what is in the bottle?

Not always. Because supplements are not approved before sale, the amount on the label and the amount in the product can differ. NCCIH describes a 2023 study in which 22 of 25 melatonin gummy products tested were inaccurately labeled, and some contained more than three times the amount stated. If you use melatonin, look for a product with a third-party testing seal and start with the lowest dose.

Why should gummies be kept away from children?

Melatonin gummies look and taste like candy, and accidental ingestion by young children has risen sharply. NCCIH cites a CDC estimate of about 11,000 emergency department visits from 2019 to 2022 for children aged 5 and under who swallowed melatonin unsupervised, many involving gummies. Store melatonin up high and out of sight, like any medicine. If a child swallows some, call Poison Help at 1-800-222-1222, and call 911 if they are hard to wake or having trouble breathing.

Do not give melatonin to a child for sleep without talking to their pediatrician first, since the right dose, timing and long-term effects in children are not known.

Are over-the-counter sleeping pills safe?

Over-the-counter sleeping pills are generally reasonable for an occasional bad night in healthy adults, but they are not designed for nightly use, and they carry more risk as you get older. Most contain a sedating antihistamine, either diphenhydramine or doxylamine, the same type of drug used for allergies.

MedlinePlus lists drowsiness, dizziness, and dry mouth, nose and throat among the side effects of diphenhydramine, along with vision problems and difficult urination as reasons to call a doctor. Alcohol adds to the drowsiness. Many people also feel groggy the next morning, so do not drive or use machinery until you know how the medicine affects you.

For older adults, the caution is stronger. MedlinePlus states that diphenhydramine generally should not be used in older adults except for serious allergic reactions, because safer options exist. NHLBI also advises talking to a doctor before trying antihistamine sleep aids, since they can be unsafe for some people.

A few practical points:

  • Some nighttime products combine a sleep antihistamine with a pain reliever, so check the label to avoid doubling up on acetaminophen or ibuprofen.
  • Do not combine an over-the-counter sleep aid with prescription sleep medicine or alcohol.
  • These products should not be used to make a child sleepy.
  • If you find you need one most nights for more than two weeks, talk to your doctor.

Do valerian, magnesium, or other supplements help?

The evidence for most sleep supplements is weak. NCCIH reports that studies of valerian have had inconsistent results and its value for insomnia has not been shown, and the American Academy of Sleep Medicine has recommended against using it for chronic insomnia. Chamomile has no conclusive evidence from clinical trials, though a warm caffeine-free drink can be a pleasant part of a wind-down routine.

Magnesium has very little research behind it for sleep. NCCIH notes that the few studies in older adults with insomnia were small and low quality, and a broader review found conflicting results. Supplements can also cause diarrhea, nausea and cramping if you take too much. If you are curious, read about whether you need a magnesium supplement at all before buying one, since nuts, seeds, beans, whole grains and leafy greens all supply it.

"Natural" does not automatically mean safe. Valerian can add to the effects of alcohol and sedatives, and rare cases of liver injury have been reported. Tell your doctor or pharmacist about every supplement you take.

Cognitive behavioral therapy for insomnia (CBT-I) is a structured program that changes the habits and thoughts that keep insomnia going. NHLBI describes it as a 6- to 8-week treatment that is usually recommended as the first option for long-term insomnia, ahead of sleeping pills.

CBT-I typically combines several parts:

  • Stimulus control: going to bed only when sleepy and getting up if you cannot sleep, so your brain links bed with sleep again.
  • Sleep restriction: limiting time in bed to roughly the time you actually sleep, then widening it as sleep becomes more solid.
  • Cognitive therapy: working on the worry and frustration about sleep that keep you alert.
  • Relaxation training and sleep education: practical tools and habits that support sleep.

It can be delivered by a doctor, nurse or therapist, in person, by phone or online. Unlike a pill, the skills tend to keep working after the program ends. The everyday habits that support it, such as a fixed wake time and a cool, dark bedroom, overlap with techniques for falling asleep faster on a rough night.

What about prescription sleep medicines?

Prescription sleep medicines can help some people with insomnia, usually alongside CBT-I and for a defined period, but they also carry risks that your doctor will weigh against the benefit. NHLBI lists several types, including drugs that act on the brain's sleep-wake signals.

The FDA has warned that the prescription "Z-drugs" eszopiclone, zaleplon and zolpidem can cause complex sleep behaviors, such as sleepwalking or driving while not fully awake, which have led to serious injuries and deaths. All insomnia medicines can also impair driving and alertness the next morning. Never combine them with alcohol or other sleep aids, and follow the dosing instructions exactly.

When should you see a doctor about sleep problems?

See your doctor if trouble sleeping has lasted more than a few weeks, if it is affecting your mood, work or safety, or if you find yourself relying on a sleep aid most nights. NHLBI defines chronic insomnia as trouble sleeping three or more nights a week for more than three months that cannot be fully explained by another health problem, but you do not need to wait that long to get help.

Get checked sooner if:

  • You snore loudly, or someone has seen you stop breathing or gasp for air during sleep. These can be signs of obstructive sleep apnea, which needs testing rather than a sleep aid.
  • You are very sleepy during the day despite spending enough time in bed.
  • Your legs feel restless or uncomfortable at night.
  • Low mood, anxiety or worry is keeping you awake.
  • You started a new medicine around the time the problem began.

Insomnia often has a cause that can be treated directly, and exploring the common causes of insomnia can help you prepare for that conversation. Bring a two-week sleep diary showing bedtimes, wake times, naps, caffeine, alcohol, and any sleep aids you took.

Call 911 if a child or adult who has taken a sleep aid is hard to wake, confused, or breathing slowly. If sleepless nights come with thoughts of harming yourself, call or text 988 to reach the 988 Suicide and Crisis Lifeline, which is free and open around the clock.

Common questions

Does melatonin work for insomnia?
Not very well. NCCIH reports that melatonin may help people fall asleep a little faster but does not improve sleep quality or night waking, and sleep medicine guidelines recommend against it for chronic insomnia. It is more useful for jet lag and body clock timing problems. CBT for insomnia is the recommended first treatment for long-term insomnia.
Is it safe to take melatonin every night?
Short-term use appears safe for most adults, but long-term safety has not been established. Side effects can include headache, dizziness, nausea and daytime sleepiness. Talk to your doctor before taking it nightly, especially if you take other medicines, have epilepsy, use a blood thinner, or are pregnant or breastfeeding, where research is lacking.
What happens if a child eats melatonin gummies?
Effects are often mild, such as sleepiness, but some children have needed hospital care, and accidental swallowing has risen sharply. Call Poison Help at 1-800-222-1222 right away for advice on what to do. Call 911 if the child is hard to wake, confused, or having trouble breathing. Store all melatonin up high and out of sight.
Is diphenhydramine safe to take for sleep?
For an occasional night in a healthy adult it is generally reasonable, but it is not meant for nightly use. It can cause next-day grogginess, dizziness, dry mouth and trouble urinating, and alcohol adds to the drowsiness. MedlinePlus says it generally should not be used by older adults except for serious allergic reactions. Ask your doctor first.
Does magnesium help you sleep?
The evidence is weak. NCCIH says there is very little research on magnesium for insomnia, and the few studies in older adults were small and low quality, while a broader review found conflicting results. Too much from supplements can cause diarrhea, nausea and cramping. Nuts, seeds, beans and leafy greens supply magnesium from food.
What is CBT-I and how long does it take?
CBT-I, cognitive behavioral therapy for insomnia, is a structured program that retrains sleep habits and the worry around sleep using stimulus control, sleep restriction, cognitive therapy and relaxation. NHLBI describes it as a 6- to 8-week treatment and usually the first option for long-term insomnia. It can be done in person, by phone or online.
When should I see a doctor about insomnia?
See a doctor if poor sleep lasts more than a few weeks, affects your mood or safety, or you need a sleep aid most nights. Go sooner for loud snoring, gasping or pauses in breathing during sleep, heavy daytime sleepiness, or restless legs. If sleeplessness comes with thoughts of self-harm, call or text 988.

Sources

Published research and guidance this page draws on. Check the original where a detail matters to you.

  1. 1Melatonin: What You Need To KnowNational Center for Complementary and Integrative Health (NIH)
  2. 2Sleep Disorders and Complementary Health ApproachesNational Center for Complementary and Integrative Health (NIH)
  3. 3ValerianNational Center for Complementary and Integrative Health (NIH)
  4. 4FDA 101: Dietary SupplementsU.S. Food and Drug Administration
  5. 5Taking Z-drugs for Insomnia? Know the RisksU.S. Food and Drug Administration
  6. 6DiphenhydramineMedlinePlus, U.S. National Library of Medicine
  7. 7InsomniaMedlinePlus, U.S. National Library of Medicine
  8. 8Insomnia: What Is Insomnia?National Heart, Lung, and Blood Institute (NIH)
  9. 9Insomnia: TreatmentNational Heart, Lung, and Blood Institute (NIH)
  10. 10Sleep Apnea: What Is Sleep Apnea?National Heart, Lung, and Blood Institute (NIH)
#sleep#insomnia#melatonin#supplements

This article is for general education and is not a substitute for professional medical advice. Speak with a qualified healthcare provider about your individual circumstances.

About HealthPathCore

An independent health knowledge library

Every article here is built from published research and guidance issued by named health bodies, written in plain language, and dated so you can see how current it is. When the evidence moves, we come back and correct the piece.

How we research and write

More in Mental Health

Clearer health, in your inbox

One practical, evidence-checked email a week. No spam, no hype, and you can unsubscribe anytime.

Made with Modulify