Skip to content

Melatonin vs. Magnesium: The Difference Between The Sleep Aids, Explained*

Emma Loewe
Author: Expert reviewer:
Updated on February 7, 2023
Emma Loewe
mbg Sustainability + Health Director
By Emma Loewe
mbg Sustainability + Health Director
Emma Loewe is the Senior Sustainability Editor at mindbodygreen and the author of "Return to Nature: The New Science of How Natural Landscapes Restore Us."
Ashley Jordan Ferira, Ph.D., RDN
Expert review by
Ashley Jordan Ferira, Ph.D., RDN
mbg Vice President of Scientific Affairs
Ashley Jordan Ferira, Ph.D., RDN is Vice President of Scientific Affairs at mindbodygreen. She received her bachelor's degree in Biological Basis of Behavior from the University of Pennsylvania and Ph.D. in Foods and Nutrition from the University of Georgia.

Magnesium and melatonin are two of the most popular sleep supplements around. Melatonin has been a popular sleep aid in the U.S. for decades. Between 2007 and 2012, usage of the supplement more than doubled in America1, and millions of people now keep it at their bedside for sleepless nights.

Magnesium's entrance to the sleep market has been more recent, but initial research shows that this essential mineral could be a helpful tool for getting the mind and body ready for bed.* Here are the main differences between how these two readily available sleep aids work.

What does melatonin do?

In the body, melatonin, derived from the neurotransmitter serotonin, is a hormone that the brain's pineal gland produces at night to send a signal to the rest of the body that it's time to start winding down. Fixtures of modern life like indoor lighting and blue light from electronics can get in the way of this process and confuse the brain into thinking that it's still daylight long into the evening. Traveling across time zones can also mess with melatonin production, as your body's circadian rhythm (or internal clock) can't immediately catch up to the new environment.

The isolated hormone has been studied as a sleep aid since the late-1980s, and research has confirmed2 that it can help people who need circadian rhythm support and reset, for example with jet lag and wonky work schedules (i.e., shift work). Whether regular vs. occasional melatonin supplementation is relevant depends on individual needs. It's important to note that the supplement may help you fall asleep but doesn't necessarily improve sleep quality or duration.

When it comes to dosing melatonin and possible side effects, mbg's vice president of scientific affairs Ashley Jordan Ferira, Ph.D., R.D.N. explains that, "a person's melatonin dose should be determined in partnership with a trusted healthcare practitioner. Some people may experience headaches, grogginess, and sleepiness upon waking after taking melatonin—likely because the dose is too high for regular use (i.e., greater than 1 milligram), which can lead to desensitization of melatonin receptors and be counterproductive."

Ferira goes on to divulge this pro-tip: "it's important to note that most melatonin is synthetic, while a minority of products are plant-sourced and harder to find."


Melatonin is a hormone that the brain's pineal gland produces at night to send a signal to the rest of the body that it's time to start winding down. While the supplement may help you fall asleep, it doesn't necessarily improve sleep quality or duration.

What does magnesium do?

Magnesium is also naturally utilized by the body, but it's a mineral and more of a multitasker. This essential macromineral ("essential" meaning we have to consume it daily) plays a role in over 300 biological reactions. Unlike melatonin, there are many different types (or complexes) of magnesium supplements, and some elicit a slightly different impact on the body (you can read top-level descriptions of each here).

Magnesium glycinate (aka magnesium bisglycinate) is a high-quality chelate form that's bioavailable, gentle, and helpful for promoting sleep.* It's a combination of magnesium and the amino acid glycine, which also independently enhances sleep quality and neurological function3.

Ferira shares that, "when we comb the clinical research on magnesium supplements and sleep4, we see that this mineral can help improve various sleep measures, including research outcomes like 'sleep efficiency, sleep time, sleep onset latency, and early morning awakening.'"* In other words, magnesium can help you get to sleep and achieve longer, deeper sleep.*

One of magnesium's sleep-promoting mechanisms is that it reduces cortisol and increases melatonin levels in the body.* Its relaxing properties likely also have to do with the fact that it activates GABA receptors in the brain, which have a calming and balancing effect on the nervous system.*


Magnesium is an abundant mineral in the body that plays a role in over 300 biological reactions. There are many different types of magnesium supplements, and some elicit a slightly different impact on the body.

Which one is better for your sleep?

The answer largely depends on what you're looking for: If you are someone who travels across time zones a lot, melatonin definitely deserves a spot in your suitcase. In an mbg article on healthy travel, functional medicine health consultant Jon Mitchell, PA-C, M.S., recommends taking it an hour or so prior to your desired bedtime when you reach your new destination.

Be sure to turn off the lights and get off your electronics at that time to give it the best chance of kicking in. If you have a job that requires you to be up at night and asleep during the day, melatonin can also help get your body used to winding down when it's still light outside.

Since there isn't much research into the long-term effects of taking high-dose melatonin every night, you'll want to take it only as necessary. The recommended dose depends on personalized needs, but for acute doses for resetting your circadian rhythm, research points to the 0.5 mg to 5 mg5.

But Ferira explains that, "a more modest dose of melatonin in the 0.3 to 0.5 mg range, which mimics physiological melatonin levels, is prudent if you're taking this supplement for daily circadian rhythm support over the long term."

If you're looking for a more consistent sleep aid that helps you fall asleep and stay asleep, family medicine physician Robert Rountree, M.D., says magnesium supplements are the way to go: "Melatonin does one thing very well, which is to provide a specific signal to the brain that it is time to initiate the sleep process. It isn't so great for maintaining sleep," he tells mbg.* 

"Magnesium helps to calm down the central nervous system, which helps to prepare the brain to turn off and also to keep it functioning at a calmer level throughout the night."* Since magnesium is a mineral and not a hormone, there's less concern over taking it every day, though you should always talk to your doctor before introducing a new supplement into your routine.

This ability to promote a longer-lasting state of relaxation is why mindbodygreen chose magnesium as the workhorse of our sleep supplement, sleep support+. The formulation includes 120 mg of magnesium bisglycinate (a highly absorbable form of the mineral) as well as other sleep promoters like jujube seed extract and PharmaGABA®", to help you fall asleep faster, stay asleep longer, and wake up feeling refreshed.*

The takeaway

Magnesium, a mineral, and melatonin, a hormone, both play a big role in prepping our bodies for sleep. If you are prone to sleep issues, both of them can be taken in supplement form: Melatonin is helpful for prompting the body to fall asleep and for circadian reset, but emerging research is finding that magnesium can help us stay asleep for longer and feel more restored upon waking when combined with other healthy nighttime habits.*

Emma Loewe author page.
Emma Loewe
mbg Sustainability + Health Director

Emma Loewe is the Sustainability and Health Director at mindbodygreen and the author of Return to Nature: The New Science of How Natural Landscapes Restore Us. She is also the co-author of The Spirit Almanac: A Modern Guide To Ancient Self Care, which she wrote alongside Lindsay Kellner.

Emma received her B.A. in Environmental Science & Policy with a specialty in environmental communications from Duke University. In addition to penning over 1,000 mbg articles on topics from the water crisis in California to the rise of urban beekeeping, her work has appeared on Grist, Bloomberg News, Bustle, and Forbes. She's spoken about the intersection of self-care and sustainability on podcasts and live events alongside environmental thought leaders like Marci Zaroff, Gay Browne, and Summer Rayne Oakes.