Skip to content

Supplement comparison

Magnesium vs Melatonin

Short answer: 2 studies on file gave Magnesium and Melatonin as separate treatments in the same trial (listed below by title); each grade below was still set for that supplement on its own. Both have graded results for 6 of the same conditions: type 2 diabetes, insomnia, metabolic syndrome and 3 more. Magnesium's top grade for an improvement there is B (type 2 diabetes); Melatonin's top grade for an improvement there is B (insomnia). A grade rates how strong the evidence is, not how large the effect is, so it does not say which one works better. Prescription options exist too; talk them through with your doctor.

Grades and study counts are computed from the same rows as the Magnesium and Melatonin pages. This page compares evidence only; it sells nothing.

Studies that gave each as a separate treatment

The evidence side by side

  • Strong
  • Moderate
  • Limited
  • Very limited

6 conditions where both have graded results with linked studies. Each grade was set for that supplement on its own: a grade on the left was not tested against the grade on the right.

Type 2 Diabetes

Type 2 Diabetes supplement stack: doses and evidence

OutcomeMagnesiumMelatonin
Blood glucose
Improves · 6 studies
Mixed effect · 1 study
Glycemic Control
Improves · 6 studies

Studied as: Not listed: ask a clinician

Not graded for this
Low-density lipoprotein (LDL)
Improves · 3 studies

Studied as: oral magnesium; LDL fell mainly with inorganic forms (oxide, chloride) in the diabetes meta-analysis

Not graded for this

Insomnia

Sleep Health (Sleep Quality & Insomnia) supplement stack: doses and evidence

OutcomeMagnesiumMelatonin
Sleep Disturbance Signs and Symptoms
Improves · 5 studies

Studied as: Not listed: ask a clinician

Not graded for this
Sleep Latency
Improves · 3 studies

Studied as: Not listed: ask a clinician

Not graded for this
Sleep Efficiency
Improves · 2 studies

Studied as: Not listed: ask a clinician

Not graded for this
Insomnia Signs and Symptoms
Mixed effect · 2 studies
Improves · 6 studies

Studied as: prolonged-release melatonin by mouth before bedtime (trials in adults 55 and over); sleep onset about 5 to 7 minutes faster; a 2022 review found no clear gain in adults with chronic insomnia

Sleep QualityNot graded for this
Improves · 6 studies

Studied as: melatonin by mouth; trials of prolonged-release melatonin nightly before bedtime for 3 weeks in adults 55 and over with insomnia; pooled trials used a range of doses and forms

Metabolic Syndrome

Metabolic Syndrome supplement stack: doses and evidence

OutcomeMagnesiumMelatonin
HbA1c
Improves · 3 studies

Studied as: Not listed: ask a clinician

Not graded for this
High-density lipoprotein (HDL)
Improves · 3 studies

Studied as: Not listed: ask a clinician

Not graded for this
Blood glucose
Improves · 1 study
Not graded for this
Anti-Oxidant Enzyme ProfileNot graded for this
Improves · 1 study

Sleep Health

Sleep Health (Sleep Quality & Insomnia) supplement stack: doses and evidence

OutcomeMagnesiumMelatonin
C-Reactive Protein (CRP)
Mixed effect · 3 studies

Studied as: magnesium (oxide, citrate or chloride) taken by mouth by adults for 4 to 26 weeks, compared with placebo; CRP is a blood marker of inflammation, not a sleep measure

Not graded for this
Sleep QualityNot graded for this
Improves · 6 studies

Studied as: oral melatonin; trials of prolonged-release melatonin taken nightly 1-2 hours before bedtime for 3 weeks in adults 55+ with insomnia; pooled trials used a range of doses and forms; one network meta-analysis found no material overall benefit

Insomnia Signs and SymptomsNot graded for this
Improves · 6 studies

Studied as: prolonged-release melatonin before bedtime (trials in adults 55+; one trial in people with sleep apnoea plus insomnia; one migraine-prevention trial); sleep onset about 5-7 minutes faster

Depression

Depression (Major Depressive Disorder) supplement stack: doses and evidence

OutcomeMagnesiumMelatonin
C-Reactive Protein (CRP)
No effect · 1 study
Not graded for this
Depression SymptomsNot graded for this
No effect · 2 studies

Chronic Obstructive Pulmonary Disease (COPD)

Chronic Obstructive Pulmonary Disease (COPD) supplement stack: doses and evidence

OutcomeMagnesiumMelatonin
Lung Function
No effect · 1 study

Studied as: Oral magnesium citrate taken by mouth daily for 6 months by older adults with stable COPD (intravenous magnesium for acute attacks is a different, hospital treatment and does not support this row).

Not graded for this
DyspneaNot graded for this
Improves · 2 studies

Studied as: Melatonin taken by mouth nightly for 3 months by adults with COPD.

8 graded results in conditions both have been studied for are not set side by side here: they came from studies in pregnancy, children, teenagers, cancer or kidney disease (dialysis included), from animal or lab work only, or from studies that did not test the sport a condition is named for, or they measure a stress hormone rather than a health result. Each supplement's page lists them.

Safety and interactions

For each supplement, our library safety line where we have one, and every reviewed safety item from its page, in full.

Magnesium

  • Kidney disease and older age raise the risk of magnesium overload (hypermagnesemia), which can cause weakness, low blood pressure and slow breathing. A case-control study of older people on magnesium oxide found low kidney clearance (creatinine clearance of 28.2 mL/min or less) was the main risk factor, and 900 mg a day or more was also flagged, though not statistically significant: overload occurred in 11.6% of those taking 900 mg or more, 27.0% of those with low clearance and 53.1% of those with both. Do not take magnesium supplements or laxatives with kidney disease unless a doctor checks your levels. (PMID 30136128; PMID 37897255)
  • Magnesium limits: the upper limit for adults from supplements is 350 mg a day, and diarrhoea is the usual first sign of too much. In a case series of 4 elderly people with constipation who took magnesium oxide as a laxative, high blood magnesium with symptoms developed and 1 died; kidney disease and older age are the risk factors, so check any magnesium laxative or supplement with your doctor if either applies to you. Cramping and nausea can also occur, especially with magnesium oxide and citrate. Take more than 350 mg a day from supplements only under medical supervision. (PMID 37487817; PMID 30136128)
  • Magnesium binds some medicines in the gut and can stop them being absorbed, including tetracycline and quinolone antibiotics and osteoporosis drugs such as alendronate. Take them a few hours apart and ask a pharmacist about the timing. Tell your doctor if you take water pills or acid-reducing drugs, which can change magnesium levels.
  • See a doctor for a sudden, severe or changed headache, migraine with weakness or speech problems, leg pain with swelling or redness, or blood pressure that stays high. In pregnancy, magnesium for pre-eclampsia is given in hospital, not as a supplement, so ask your midwife or doctor before taking any.

Results on the Magnesium page where it made a measure worse, or that record side effects in trials:

Everything on Magnesium

Melatonin

  • Melatonin and children: US poison-centre reports (surveillance data) recorded 260,435 melatonin ingestions by children and teenagers aged 19 or under from 2012 to 2021, a 530% rise in the yearly number; most children had no symptoms; when present they were mostly digestive, heart or nervous-system symptoms, and 4,555 (1.6%) had more serious outcomes; of the 27,795 seen in a health facility, 4,097 (14.7%) were admitted to hospital and 287 (1.0%) to intensive care, 5 needed a ventilator, and 2 children, aged 3 months and 13 months, died at home. Store melatonin out of children's reach. (PMID 35653284)
  • Product strength is unreliable: in a test of 31 melatonin supplements, content ranged from 83% less to 478% more than the label, more than 71% missed the label claim by over 10%, and 26% also contained serotonin. (PMID 27855744)
  • Keep melatonin, especially gummies, away from children. US poison centres logged 260,435 child melatonin ingestions from 2012 to 2021, and the yearly number rose 530% over that decade; five children needed a ventilator and two died. Give melatonin to a child only on a paediatrician's advice. (PMID 35653284)
  • Avoid combining melatonin with alcohol or other sedatives. Memorial Sloan Kettering says: 'Side effects of using melatonin may include: headaches, drowsiness, changes in sleep patterns, trouble sleeping, bad dreams, confusion or altered mental state, fast heart rate, flushing or getting red in the face, itching, stomach cramps, low body temperature.' 'Avoid melatonin if you’re driving or operating heavy machinery until you’re familiar with how it affects you. It can cause drowsiness. Talk with your healthcare provider if you have hormone-sensitive cancer like breast or prostate cancer. Melatonin can change the amount of estrogen in your body. This may worsen your condition. Talk with your healthcare provider if you’re taking nifedipine (Procardia®). Using melatonin at the same time can increase your blood pressure and heart rate. Talk to your healthcare provider if you’re taking blood thinners such as warfarin (Jantoven® or Coumadin®). Melatonin may increase your risk of bleeding. Talk with your pediatrician before giving your child melatonin. Taking too much melatonin can cause serious side effects in children under age 3, including trouble breathing and death. Keep your melatonin in a safe place (such as in a locked cabinet) and out of children's reach.' Its notes for health professionals add: 'Melatonin inhibits CYP1A2 and may increase the bioavailability of substrate drugs, like fluvoxamine.' NIH's National Center for Complementary and Integrative Health (NCCIH) says: 'As with all dietary supplements, people who are taking medicine should consult their health care providers before using melatonin. In particular, people with epilepsy and those taking blood thinner medications need to be under medical supervision when taking melatonin supplements. There may be a risk of allergic reactions to melatonin supplements. There’s been a lack of research on the safety of melatonin use in pregnant or breastfeeding women. The 2015 guidelines by the American Academy of Sleep Medicine recommend against melatonin use by people with dementia. Melatonin may stay active in older people longer than in younger people and cause daytime drowsiness. The possible long-term side effects of melatonin use are unclear. If you’re pregnant or nursing a child, it’s especially important to see your health care provider before taking any medicine or supplement, including melatonin.' (PMID 31722088)
  • Ask a doctor or pharmacist first if you take immune-suppressing drugs or diabetes medicines. Insomnia lasting more than a few weeks, loud snoring or gasping in sleep, or severe daytime sleepiness needs a medical check; cognitive behavioural therapy is the first-line treatment for long-term insomnia.
  • NIH's National Center for Complementary and Integrative Health (NCCIH) says: Parents considering giving their children melatonin should first speak with a health care provider about melatonin use in children. A 2023 study found that 22 out of 25 over-the-counter melatonin gummy products were inaccurately labeled. One product did not contain detectable levels of melatonin. In the remaining products, the melatonin levels ranged from 74 to 347 percent of the labeled quantity (i.e., up to almost 3.5 times more melatonin than reported on the label). Parents need to ensure safe storage and appropriate use of melatonin supplements. Use of over-the-counter melatonin might place children and teenagers at risk for accidental or intentional overdose. There’s little information on the long-term effects of melatonin use in children. Because melatonin is a hormone, it’s possible that melatonin supplements could affect hormonal development, including puberty, menstrual cycles, and overproduction of the hormone prolactin, but we don’t know for sure. Possible melatonin supplement side effects reported in children have usually been mild and have included: drowsiness, increased bedwetting or urination in the evening, headache, dizziness, and agitation. Do not give melatonin to a child or teenager unless their doctor advises it.

Everything on Melatonin

Questions

How do Magnesium and Melatonin compare?

2 studies on file gave Magnesium and Melatonin as separate treatments in the same trial (listed below by title); each grade below was still set for that supplement on its own. Both have graded results for 6 of the same conditions: type 2 diabetes, insomnia, metabolic syndrome and 3 more. Magnesium's top grade for an improvement there is B (type 2 diabetes); Melatonin's top grade for an improvement there is B (insomnia). A grade rates how strong the evidence is, not how large the effect is, so it does not say which one works better. Prescription options exist too; talk them through with your doctor.

What have both Magnesium and Melatonin been studied for?

In our database both have graded results for type 2 diabetes, insomnia, metabolic syndrome, sleep health, depression and chronic obstructive pulmonary disease (COPD). Each supplement's own page lists every condition it has been studied for.

Which outcomes were measured for both Magnesium and Melatonin?

Type 2 Diabetes: blood glucose. Insomnia: insomnia signs and symptoms. Each grade was set for that supplement on its own, so the grades sit side by side but do not compare the two in one trial.

Are Magnesium and Melatonin safe?

Each has its own cautions, listed in full on this page under "Safety and interactions" and on each supplement's page. Ask your clinician before starting either if you take medicines, are pregnant or have a long-term condition.