The best choice depends on what is keeping you awake. Melatonin has the strongest evidence, but mainly as a body-clock signal: for jet lag, and to a lesser extent for a delayed sleep schedule. For simply falling asleep faster, its effect is real but small. Valerian's benefit shows up mostly in how people rate their own sleep, rarely in sleep measurements. Magnesium's evidence is modest and low certainty.
None of the three is a good fix for waking in the night. For insomnia that has lasted months, cognitive behavioural therapy for insomnia (CBT-I) has far stronger guideline backing than any of them.
One more thing before you compare: melatonin is prescription-only in Ireland and the UK. This page is written for US readers, where it's sold as a dietary supplement.
Falling asleep. A 2013 meta-analysis pooled 19 trials with 1,683 people who had primary sleep disorders. Melatonin shortened the time to fall asleep by about 7 minutes and added about 8 minutes of sleep compared with placebo. The authors called the effects modest. They noted the absolute benefit was smaller than that of other insomnia medicines.
Dose and timing. A 2024 dose-response meta-analysis of 26 trials found the effect on sleep onset rose with dose, peaking at 4mg a day. Taking it further ahead of bedtime also predicted a better effect. The authors suggested about 3 hours before bedtime may work better than the common 30 minutes. Our melatonin dose-response explainer goes through this in detail.
Jet lag. A Cochrane review from 2002 is old but still useful. In 9 of its 10 trials, melatonin reduced jet lag after flights crossing five or more time zones. In those trials it was taken close to bedtime at the destination. Doses from 0.5mg to 5mg worked similarly, and doses above 5mg appeared no more effective. Taken at the wrong time of day, it can cause sleepiness and slow adaptation. For more on light, timing and shift work, read what actually resets your sleep clock.
Other clock problems. The US National Center for Complementary and Integrative Health (NCCIH) says melatonin appears to help people with delayed sleep–wake phase disorder. It adds that it's unclear whether the benefits outweigh possible harms. NCCIH describes studies in shift workers as generally small or inconclusive.
Chronic insomnia. The American Academy of Sleep Medicine (AASM) suggests clinicians not use melatonin for difficulty falling or staying asleep in chronic insomnia. This is a weak recommendation based on trials of 2mg.
Safety. A 2022 review of high-dose melatonin (10mg or more) found more drowsiness, headache and dizziness than placebo. It found no detectable rise in serious side effects. Only 4 of its 79 trials were at low risk of bias, so the confidence intervals were wide. NCCIH says long-term safety is unclear. It says people with epilepsy or on blood thinners need medical supervision, and that safety in pregnancy and breastfeeding hasn't been well studied.
Label accuracy. In a 2017 analysis of 31 supplements, melatonin content didn't match the label for most of them. A 2023 study found 22 of 25 US melatonin gummies were inaccurately labelled.
Where it's legal. In the US, melatonin is a dietary supplement. In the UK, the MHRA says it is authorised only as a prescription medicine. The NHS says it's mainly prescribed for short-term sleep problems in people aged 55 and over. In Ireland, the Food Safety Authority of Ireland says melatonin is a medicinal product. It isn't permitted in food supplements and should only be taken when prescribed. If you live in either country, talk to your GP.
Valerian is the most mixed of the three.
Studies summarised by the US NIH Office of Dietary Supplements used 400–900mg of aqueous extract, or 600mg of a standardised extract. One study reported more morning sleepiness after 900mg.
Safety. NCCIH lists headache, stomach upset, mental dullness, excitability, uneasiness and vivid dreams as side effects. Liver injury has been reported in very rare cases. Don't combine valerian with alcohol or sedatives. Its safety in pregnancy and breastfeeding isn't known, and children under 3 shouldn't take it. For the full evidence, read valerian root for sleep.
A 2026 systematic review of 12 trials found inconsistent results and low to very low certainty. It concluded that the evidence does not support magnesium as a routine insomnia treatment. It may help some people's self-rated sleep a little. The best-known recent trial gave 250mg of elemental magnesium as bisglycinate for four weeks. Insomnia scores fell slightly more than on placebo (p = 0.049), and the effect size was small. We've broken it down in what the new magnesium trial found.
Safety. The NIH sets a 350mg daily upper limit for supplemental magnesium. Check with a doctor first if you have kidney disease or take bisphosphonates, certain antibiotics, diuretics or long-term acid-reducing medicines.
"I can't switch off and fall asleep." Melatonin has the most consistent, though small, effect on time to fall asleep. Timing seems to matter as much as dose. Magnesium is a non-hormonal alternative with weaker, low-certainty evidence. Valerian may help you feel you slept better, but measured sleep onset doesn't change.
"My body clock is off: jet lag or a late schedule." This is where melatonin's evidence is strongest. Getting the timing right matters more than taking more. Neither valerian nor magnesium has evidence here.
"I wake at 3am and can't get back to sleep." None of the three performs well here. The AASM makes weak recommendations against melatonin and valerian for staying asleep. Frequent waking can also go with sleep apnoea. The NHS lists loud snoring, gasping or choking noises, and breathing that stops and starts. Those need a doctor, not a supplement.
"Stress or racing thoughts keep me up." None of the three has good evidence for stress-driven sleeplessness. CBT-I, a structured psychological treatment, is the option with strong guideline support. The AASM strongly recommends it for chronic insomnia, and our CBT-I guide explains how it works. See a doctor if poor sleep has lasted months or is making it hard to cope.
Important safety points:
We have not published batch certificates of analysis for these products. US orders ship free, and a 90-day money-back guarantee covers your first order.
What's the most effective melatonin dose? In pooled trials, the effect on sleep onset peaked at about 4mg a day. That's a research finding, not a personal dose. Ask your doctor or pharmacist what suits you.
Can I buy melatonin in Ireland or the UK? Not as a supplement. It's a prescription-only medicine in both countries, so talk to your GP.
Is it safe to take valerian with a glass of wine? NCCIH says valerian shouldn't be taken with alcohol or sedatives.
Can I take Sleep Formula and Sleep Support together? No. Together they contain 12mg of melatonin. Use one or the other.
Should I try a supplement or CBT-I for long-term insomnia? US sleep medicine guidance strongly recommends CBT-I for chronic insomnia. It makes only weak recommendations against melatonin and valerian. Start with your doctor.
These statements have not been evaluated by the Food and Drug Administration. These products are not intended to diagnose, treat, cure, or prevent any disease. This article is for general information and is not medical advice. Talk to your doctor or pharmacist before starting a supplement, especially if you take medication, are pregnant or breastfeeding, or have a medical condition.
Last updated: November 2026