Key Takeaways
  • Research suggests magnesium may help improve sleep for some people, particularly those with low magnesium levels, though more research is needed to fully understand its effects on sleep.
  • Magnesium can be found in foods like nuts, leafy greens, whole grains, dairy, and soy.
  • Magnesium glycinate is commonly recommended for sleep, while emerging research suggests magnesium threonate may also have benefits.
  • Experts recommend taking no more than 350 milligrams of magnesium for sleep. Taking too much can cause side effects, including diarrhea and stomach upset.

Magnesium is an essential mineral involved in hundreds of processes throughout the body, including those that influence sleep. But nearly 50% of adults and children in the U.S. may not receive enough magnesium. Since magnesium has been found to play a role in sleep, taking supplements may be a useful natural sleep aid in helping you get a good night’s rest. 

Below, we’ll explore what magnesium is, how it might benefit sleep, and what to look for in a magnesium supplement.

What Is Magnesium?

Magnesium is an essential mineral in the bodythat plays a role in nerve and muscle function, bone development, blood sugar control, and heart rhythm consistency . Research suggests that magnesium can help with keeping a healthy sleep schedule and getting quality sleep .

To make sure you’re getting enough, you can eat magnesium-rich foods like whole grains and leafy greens. If you have dietary restrictions, you can also consult a medical professional about taking dietary supplements. The Recommended Dietary Allowance (RDA) for daily magnesium intake falls between 310 and 420 milligrams for adults, depending on age, sex, and pregnancy status. 

Chart of foods containing higher magnesium content
Chart of foods containing higher magnesium content

Does Magnesium Help You Sleep?

A 2021 study found that higher levels of magnesium in the body are associated with better sleep , longer periods of sleep , and less exhaustion during the day. Studies of older adults also found that magnesium supplementation helped with falling asleep faster and even helped with getting them more rest in the morning

Experts haven’t yet found the exact ways in which magnesium impacts sleep problems. Some evidence suggests that magnesium impacts the way certain chemicals act in the brain, like NMDA, GABA , melatonin , serotonin , renin , and cortisol , all of which may impact how relaxed or tired a person feels.

Magnesium and Insomnia

A few studies suggest that magnesium supplementation may help with symptoms of insomnia , a disorder that involves trouble falling asleep or staying asleep. However, research is needed to determine how magnesium supplements may impact people of other ages who experience insomnia.

Magnesium and Restless Legs Syndrome

Many people take magnesium supplements for leg cramps and restless legs syndrome, a sleep disorder that causes uncomfortable sensations in the legs that can make it difficult to sleep. Research suggests magnesium may specifically help with nighttime leg cramps during pregnancy, as they may be caused by low magnesium levels.

Lower magnesium levels may also be linked to more severe cases of restless legs syndrome, but more research is needed. Currently, some studies have shown the promise of magnesium when paired with vitamin B6 supplementation to help treat restless legs syndrome.

“Magnesium may help with sleep problems, especially if they are related to scenarios which are caused by a deficiency of magnesium, such as leg cramps.”
Abhinav Singh, MD, MPH, FAASM
Abhinav Singh, MD, MPH, FAASM
Sleep Medicine Physician

Which Magnesium Is Best for Sleep?

Different forms of magnesium vary in how well they are absorbed by the body, the side effects they may cause, and the health benefits they may offer. While not all types of magnesium have been studied for their effects on sleep, some are more commonly used to support relaxation and healthy sleep.

Magnesium Glycinate

This type of magnesium is the most commonly recommended supplement for sleep. It’s generally gentle on the stomach and recent studies suggest that it may help insomnia symptoms.

Magnesium Threonate

Early research suggests magnesium threonate may deliver magnesium to the brain more effectively than other forms, and some studies have found improvements in memory and cognition, as well as sleep quality, especially deep and REM sleep stages. However, research is still limited. 

Magnesium Citrate

Magnesium citrate is more easily absorbed by the body than some other varieties of the mineral. As a result, it’s commonly recommended as a supplement. That said, it may cause digestive side effects and is sometimes used to treat constipation.

Other Types of Magnesium

  • Magnesium oxide: Magnesium oxide is harder for the body to absorb, so it’s less effective for those hoping to aid their sleep by boosting low magnesium levels.
  • Magnesium malate:  Easily absorbed by the body, but there’s no conclusive research about its effect on sleep.
  • Magnesium chloride: Absorbs quickly to treat low magnesium levels, but there’s no conclusive research about its effect on sleep. 
  • Magnesium taurate: Research on animals suggests that this type of magnesium may have cardiovascular benefits, but there haven’t been conclusive studies connecting it to sleep.

How Much Magnesium Should You Take for Sleep?

The recommended daily intake of magnesium that could aid sleep varies, depending on a person’s age, sex, and existing health conditions. While high levels of dietary magnesium from food aren’t dangerous, large doses from supplements can cause side effects. 

Recommended Daily Magnesium Intake

For dietary magnesium that occurs naturally in food, the Food and Nutrition Board (FNB) at the National Academies of Sciences, Engineering, and Medicine recommends that men ages 18 to 30 consume 410 milligrams of dietary magnesium per day, and that women in the same age group consume 310 milligrams per day. After the age of 30, those levels rise to 420 milligrams per day for men and 320 milligrams per day for women.

Magnesium Supplement Dosages Used in Studies

Generally, people should try not to take more than 350 milligrams of magnesium supplements per day in order to avoid side effects, according to the FNB.

However, supplements are sold in higher levels, and studies about the effects of magnesium on sleep have used dosages ranging from 250 milligrams or less to over 700 milligrams. The ideal amount for you will depend on your age, existing health conditions, your daily amount of dietary magnesium, and whether you experience any side effects. Your doctor will be able to help you determine the best dosage for your needs. 

When to Take Magnesium for Sleep

Some experts recommend taking your supplement just before bedtime, especially if your primary goal is to improve sleep. Plan to give it a few weeks for effectiveness and make sure to take it at the same time every day.

You can also incorporate other strategies to help fall asleep, such as a consistent bedtime routine, reducing caffeine and alcohol consumption, and shutting off screens at least 30 minutes before winding down. From there, look out for any side effects and track any noticeable improvements in sleep patterns to determine if magnesium is helping you.

Side Effects of Magnesium

Consuming more than 350 milligrams of magnesium supplements in one day may cause side effects like diarrhea, nausea, and abdominal cramps . Certain forms of magnesium, like magnesium carbonate, magnesium chloride, magnesium gluconate, and magnesium oxide may be more likely to cause side effects .

What’s the Best Magnesium Supplement for Sleep?

If you want to take magnesium supplements for better sleep, consider choosing a form that’s highly absorbable and less prone to side effects like gastrointestinal discomfort. Magnesium glycinate is a good option to try because it fits that criteria, but there’s emerging research that magnesium threonate may also be highly effective for sleep. 

Since the Food and Drug Administration (FDA) doesn’t regulate dietary supplements, you should always talk to a medical professional before starting any new medications or supplements. 

Here are some other factors to keep in mind when choosing the best magnesium supplement: 

  • Formulation: Magnesium comes in multiple forms, and some may be easier for the body to absorb than others , especially if you have certain dietary restrictions or health conditions. Specifically, types of magnesium may be better absorbed because they have higher bioavailability. When a supplement is better absorbed, it’s less likely to cause side effects.
  • Dose: Experts recommend sticking to 350 milligrams of magnesium supplements per day or less in order to avoid side effects. However, many brands sell magnesium supplements in dosages that are higher than this. Dosing can also depend on your pregnancy status, sex assigned at birth, and other medications or supplements you’re currently taking.
  • Third-party testing: Look for companies that have their supplements undergo third-party testing. This testing can ensure that the supplements are not contaminated and their contents match what is listed on the label.

Is Magnesium Right for You?

Any time you want to try a new supplement, it’s always a good idea to start by having a conversation with your primary care doctor. They may order bloodwork to see if you have a magnesium deficiency, and can answer any questions about concerns or potential side effects or interactions. In particular, people who take prescription medications or have kidney disease or other health conditions should speak to a physician before taking magnesium supplements

In general, though, magnesium supplements are considered safe as long as you stay within the recommended dosage. The types of people who may benefit the most from magnesium supplements include those with low magnesium levels and older adults.

For sleep problems, magnesium may be helpful for people with mild sleep problems, or those with stress-related sleep issues. If you’re having trouble sleeping or staying asleep, it could be a low-risk method to try. However, if you experience any side effects that persist beyond mild gastrointestinal issues, you should discontinue use and contact your doctor.

Frequently Asked Questions

How much magnesium glycinate should you take for sleep?

The ideal amount of magnesium glycinate for sleep depends on your age, existing health conditions, and whether you experience any side effects. While these supplements are sold in doses as high as 500 milligrams, the Food and Nutrition Board at the National Academies of Sciences, Engineering, and Medicine recommends a dose of no more than 350 milligrams for all types of magnesium supplements.

Can you take too much magnesium?

While an excess of dietary magnesium won’t cause problems, taking too much magnesium from supplements may cause side effects like diarrhea, nausea, and abdominal cramps. Most people should not take more than 350 milligrams of magnesium in a day, according to the Food and Nutrition Board (FNB) at the National Academies of Sciences, Engineering, and Medicine.

How long does it take for magnesium to work for sleep?

When you take magnesium, your body will begin absorbing it within a few hours. However, there’s no specific timeline as to when you might see improved sleep from magnesium supplementation, since study timelines vary.

If you take magnesium consistently at the same time before bed every night, you may start to notice the effects in as little as two weeks or up to several weeks to see sleep-related results.

Which magnesium is best for sleep and anxiety?

Magnesium glycinate is commonly recommended for sleep and anxiety, as it’s easily absorbed by the bloodstream with minimal gastrointestinal side effects. Early studies also suggest that magnesium threonate may deliver magnesium to the brain more effectively than other forms and be effective for anxiety and sleep, but research is still limited.

Is it safe to take magnesium every day?

Magnesium supplements are safe for most people to take daily, but taking more than 350 milligrams may cause side effects. Magnesium supplements can interact with some prescription drugs, so talk with a doctor before beginning magnesium.

What’s the difference between magnesium and melatonin?

Magnesium and melatonin are very different, even though they may both play a role in sleep quality. Magnesium is an essential mineral people can consume through food, while melatonin is a hormone produced by the brain. Magnesium levels may also impact sleep because of how it interacts with other chemicals in the brain, including melatonin. Both are available in supplement form. 

What foods are high in magnesium?

Foods high in magnesium include seeds, leafy greens, nuts, beans, and rice. Roasted pumpkin seeds and chia seeds are the foods with the highest magnesium content. Nuts with the highest amount of magnesium include almonds, cashews, and peanuts. Some fish, like salmon and halibut, also contain magnesium.

Still have questions? Ask our community!

Join our Sleep Care Community — a trusted hub of sleep health professionals, product specialists, and people just like you. Whether you need expert sleep advice for your insomnia or you’re searching for the perfect mattress, we’ve got you covered. Get personalized guidance from the experts who know sleep best.

Learn more about our Editorial Team

References
21 Sources

  1. National Institutes of Health. Magnesium. National Institutes of Health. Published 2022. https://ods.od.nih.gov/factsheets/Magnesium-HealthProfessional/ ‌

    https://ods.od.nih.gov/factsheets/Magnesium-HealthProfessional/
  2. Breus M, Hooper S, Lynch T, Hausenblas H. Effectiveness of Magnesium Supplementation on Sleep Quality and Mood for Adults with Poor Sleep Quality: A Randomized Double-Blind Placebo-Controlled Crossover Pilot Trial. Medical Research Archives. 2024;12(7). doi:https://doi.org/10.18103/mra.v12i7.5410 ‌

    https://esmed.org/MRA/mra/article/view/5410
  3. Zhang, Y., Chen, C., Lu, L., Knutson, K. L., Carnethon, M. R., Fly, A. D., Luo, J., Haas, D. M., Shikany, J. M., & Kahe, K. (2022). Association of magnesium intake with sleep duration and sleep quality: findings from the CARDIA study. Sleep, 45(4), zsab276.

    https://academic.oup.com/sleep/article/45/4/zsab276/6432454
  4. Abbasi, B., Kimiagar, M., Sadeghniiat, K., Shirazi, M. M., Hedayati, M., & Rashidkhani, B. (2012). The effect of magnesium supplementation on primary insomnia in elderly: A double-blind placebo-controlled clinical trial. Journal of Research in Medical Sciences, 17(12), 1161–1169.

    https://pubmed.ncbi.nlm.nih.gov/23853635/
  5. Papadopol V, Nechifor M. Magnesium in neuroses and neuroticism. PubMed. Published 2011. https://www.ncbi.nlm.nih.gov/books/NBK507254/ ‌

    https://www.ncbi.nlm.nih.gov/books/NBK507254/
  6. Alizadeh M, Karandish M, Asghari Jafarabadi M, et al. Metabolic and hormonal effects of melatonin and/or magnesium supplementation in women with polycystic ovary syndrome: a randomized, double-blind, placebo-controlled trial. Nutr Metab (Lond). 2021;18(1):57. Published 2021 Jun 6. doi:10.1186/s12986-021-00586-9

    https://pubmed.ncbi.nlm.nih.gov/34092248/
  7. He C, Wang B, Chen X, Xu J, Yang Y, Yuan M. The Mechanisms of Magnesium in Sleep Disorders. Nat Sci Sleep. 2025;17:2639-2656. Published 2025 Oct 15. doi:10.2147/NSS.S552646

    https://pubmed.ncbi.nlm.nih.gov/41116797/
  8. Zain AlShanableh, Ray EC. Magnesium in hypertension: mechanisms and clinical implications. Frontiers in physiology. 2024;15. doi:https://doi.org/10.3389/fphys.2024.1363975

    https://www.frontiersin.org/journals/physiology/articles/10.3389/fphys.2024.1363975/full
  9. Boyle, N. B., Lawton, C., & Dye, L. (2017). The effects of magnesium supplementation on subjective anxiety and stress – A systematic review. Nutrients, 9(5), 429.

    https://pubmed.ncbi.nlm.nih.gov/28445426/
  10. Marshall, N. S., Serinel, Y., Killick, R., Child, J. M., Raisin, I., Berry, C. M., Lallukka, T., Wassing, R., Lee, R. W., Ratnavadivel, R., Vedam, H., Grunstein, R., Wong, K. K., Hoyos, C. M., Cayanan, E. A., Comas, M., Chapman, J. L., & Yee, B. J. (2019). Magnesium supplementation for the treatment of restless legs syndrome and periodic limb movement disorder: A systematic review. Sleep Medicine Reviews, 48, 101218.

    https://pubmed.ncbi.nlm.nih.gov/31678660/
  11. Winkelman, J. W. (2022, May 6). Nocturnal leg cramps. In I. N. Targoff & J. M. Shefner (Eds.). UpToDate.

    https://www.uptodate.com/contents/nocturnal-leg-cramps
  12. Jadidi, A., Rezaei Ashtiani, A., Khanmohamadi Hezaveh, A., & Aghaepour, S. M. (2022). Therapeutic effects of magnesium and vitamin B6 in alleviating the symptoms of restless legs syndrome: a randomized controlled clinical trial. BMC complementary medicine and therapies, 23(1), 1.

    https://pubmed.ncbi.nlm.nih.gov/36587225
  13. Schuster J, Cycelskij I, Lopresti A, Hahn A. Magnesium Bisglycinate Supplementation in Healthy Adults Reporting Poor Sleep: A Randomized, Placebo-Controlled Trial. Nat Sci Sleep. 2025;17:2027-2040. Published 2025 Aug 30. doi:10.2147/NSS.S524348

    https://pubmed.ncbi.nlm.nih.gov/40918053/
  14. Hausenblas HA, Lynch T, Hooper S, Shrestha A, Rosendale D, Gu J. Magnesium-L-threonate improves sleep quality and daytime functioning in adults with self-reported sleep problems: A randomized controlled trial. Sleep Med X. 2024;8:100121. Published 2024 Aug 17. doi:10.1016/j.sleepx.2024.100121

    https://pubmed.ncbi.nlm.nih.gov/39252819/
  15. Werner T, Kolisek M, Vormann J, et al. Assessment of bioavailability of Mg from Mg citrate and Mg oxide by measuring urinary excretion in Mg-saturated subjects. Magnes Res. 2019;32(3):63-71. doi:10.1684/mrh.2019.0457

    https://pubmed.ncbi.nlm.nih.gov/32162607/
  16. Zacharias N, Lubner MG, Kim DH, Pickhardt PJ. Comparison of MiraLAX and magnesium citrate for bowel preparation at CT colonography. Abdom Radiol (NY). 2023;48(11):3322-3331. doi:10.1007/s00261-023-04025-6

    https://pubmed.ncbi.nlm.nih.gov/37644134/
  17. Uysal N, Kizildag S, Yuce Z, et al. Timeline (Bioavailability) of Magnesium Compounds in Hours: Which Magnesium Compound Works Best?. Biol Trace Elem Res. 2019;187(1):128-136. doi:10.1007/s12011-018-1351-9

    https://pubmed.ncbi.nlm.nih.gov/29679349/
  18. Shrivastava P, Choudhary R, Nirmalkar U, et al. Magnesium taurate attenuates progression of hypertension and cardiotoxicity against cadmium chloride-induced hypertensive albino rats. J Tradit Complement Med. 2018;9(2):119-123. Published 2018 Jun 2. doi:10.1016/j.jtcme.2017.06.010

    https://pmc.ncbi.nlm.nih.gov/articles/PMC6435948/
  19. Mah, J., & Pitre, T. (2021). Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-Analysis. BMC complementary medicine and therapies, 21(1), 125.

    https://pubmed.ncbi.nlm.nih.gov/33865376/
  20. Rawji A, Peltier MR, Mourtzanakis K, et al. Examining the Effects of Supplemental Magnesium on Self-Reported Anxiety and Sleep Quality: A Systematic Review. Cureus. 2024;16(4):e59317. Published 2024 Apr 29. doi:10.7759/cureus.59317

    https://pmc.ncbi.nlm.nih.gov/articles/PMC11136869/

Learn More About Sleep Aids

A spoonful of Valerian root

Valerian Root for Sleep

By Jay Vera Summer September 10, 2025

A young woman opens a container of legal cannabis from a dispensary

Cannabis for Sleep

By Cassandra Burns September 3, 2025

Orexins

Orexins

By Rob Newsom July 15, 2025

Side Effects of Sleep Medication b

Side Effects of Sleep Medication

By Daniel Noyed July 15, 2025

Over-the-Counter Sleep Aids

Over-the-Counter Sleep Aids

By Daniel Noyed July 15, 2025

A man holds a sleep tablet and a glass of water

How to Use Sleep Medications Safely

By Danielle Pacheco July 15, 2025

An assortment of Sleep Aids

Compare Sleep Aids

By Eric Suni July 15, 2025