
You have already tried the obvious things. An earlier bedtime. No screens. No coffee after lunch. And now a bottle of magnesium on the nightstand, because everyone from your sister to your social media feed says it is what finally works.
The truth is that magnesium may help you fall asleep somewhat faster if you are older and already have insomnia; one recent trial found a small improvement in adults who simply described their own sleep as poor. Magnesium is not a treatment for insomnia, and if your nights have been bad for months, magnesium alone is not where sleep medicine starts [1][2].
Does Magnesium Help You Sleep? What the Research Shows
There are two important questions to ask when it comes to taking magnesium for sleep:
Do those who get more magnesium in their diet sleep better?
Does swallowing a capsule at bedtime change anything?
The research treats the answers to these questions differently.
Let's start with magnesium intake in day to day life. A long-running study of nearly 4,000 adults found that the people with the highest total magnesium intake (counting supplements as well as food), were the least likely to report sleeping under seven hours a night. The link to sleep quality itself was borderline. Because both the intake and the sleep were self-reported, the authors said the question needs proper trials that measure actual sleep quality rather than just asking how the participants slept [3]. A systematic review of the wider literature reached the same verdict: the link between magnesium intake and sleep has been observed, but the evidence stays uncertain in proper trials [4].
There is a catch: Magnesium ingestion is not an isolated variable when analyzed in nature. People who eat plenty of magnesium are also eating more vegetables, legumes, nuts and whole grains, and they differ from everyone else in a dozen other ways that may also affect how they sleep.
If we talk about magnesium supplements, there is far less evidence than the numbers in the supplement aisle suggest. The most-referenced review of magnesium for insomnia found three randomized trials with 151 people between them, all of them older adults with insomnia. Time to fall asleep was shorter in the magnesium groups, by around seventeen minutes. Total sleep time did not improve significantly, and the reviewers graded the evidence as low to very low, calling it too weak for physicians to make well-informed recommendations [1]. The most-cited of those three trials had 46 participants aged 60 to 75 [5].
The latest trial is built better and still modest. It randomized 155 adults who described their own sleep as “poor” and excluded anyone with a diagnosed sleep disorder. At four weeks, insomnia severity had fallen further in the magnesium group compared to the placebo group, but the gap was small, the effect size was small, and the result only just cleared statistical significance. Four weeks is also where the reported benefit sits, and the trial ran on self-report rather than measured sleep [2].
That trial did turn up one exploratory finding worth flagging, because it fits everything else here: the improvement was largest in the people whose dietary magnesium intake was lowest to begin with [2]. That raises the possibility that the people who benefit are the ones with the least magnesium to start with, rather than people who took a supplement. However, reported intake is not the same as a measured deficiency. An exploratory result is a lead to follow rather than a finding to act on.
In conclusion, in older adults with insomnia, magnesium may shorten how long it takes to fall asleep. In adults who sleep badly, one larger and better-controlled trial found a small improvement. Nobody has shown that magnesium resolves insomnia, and no trial has tested it head to head against the approach that does.
How Magnesium Is Thought to Affect Sleep
Magnesium does a great deal in the body, which is what makes the sleep story so easy to tell. It works as a cofactor in more than 300 enzyme systems, and it is involved in nerve signaling, muscle function, blood pressure regulation and blood glucose control [6]. From there the explanation almost writes itself: a mineral that settles nerves and relaxes muscles ought to quiet the body down at night.
One claim deserves singling out– that magnesium helps your body make its own melatonin. Nobody has shown that in people. The laboratory work usually gestured at is 1980s research on isolated pineal tissue, and it pointed the other way, with magnesium inhibiting the enzyme that catalyzes the final step of melatonin synthesis [7]. That is isolated within tissue in a laboratory setting rather than a human study, so it does not show that magnesium lowers your melatonin either. We compared the two supplements directly in why magnesium replaced melatonin on the nightstand.
Types of Magnesium
When you purchase magnesium in the store, you aren't getting pure magnesium with nothing else in it. Magnesium is always bound to another element, like chloride or lactate for example. The Supplement Facts panel declares only the elemental magnesium rather than the weight of the whole compound, so the big number on the front of the jar is not always the number that matters [6].
The National Institutes of Health (NIH) fact sheet that compares absorption covers exactly four forms: it reports that the aspartate, citrate, lactate and chloride forms tend to be better absorbed than oxide and sulfate [6]. Glycinate, malate, taurate and L-threonate are not in that comparison at all, which is worth knowing, because those are the ones ranked most confidently online.
Form | Bound to | Absorption evidence | Used in a sleep trial? | Reported GI effects | What the marketing claims |
|---|---|---|---|---|---|
Glycinate / bisglycinate | Glycine | Not in the NIH comparison | Yes, one trial, glycine co-delivered [2] | Not on the NIH list | The calming one, best for sleep |
Citrate | Citric acid | Better absorbed than oxide [6] | No | Sold over the counter as a laxative | Well absorbed, gentle |
Oxide | Oxygen | Less well absorbed [6] | Yes, in the older insomnia trials [1][5] | Among those most reported [6] | High magnesium per tablet, cheap |
Chloride, lactate, aspartate | Varies | Better absorbed than oxide [6] | No | Chloride among those reported [6] | Highly bioavailable |
Malate | Malic acid | Not in the NIH comparison | No | Not on the NIH list | For energy and muscle pain |
Taurate | Taurine | Not in the NIH comparison | No | Not on the NIH list | For the heart, calming |
L-threonate | Threonic acid | Not in the NIH comparison | No | Not on the NIH list | Crosses into the brain, for memory and sleep |
Sulfate | Sulfuric acid | Less well absorbed [6] | No | Osmotic, used as a laxative | Epsom salt baths |
This list is not a ranking, and none of it is advice about which one to buy. How well a form absorbs tells you how much of the mineral gets into you, which is a different question from whether you needed more of it to begin with.
Natural Ways of Getting Magnesium
There are many foods that are naturally rich in magnesium. Magnesium is concentrated in pumpkin and chia seeds, almonds and cashews, spinach and other leafy greens, black beans and edamame, whole grains, and dark chocolate. The recommended intake for adults runs between roughly 310 and 420 milligrams a day depending on age and sex, counting everything you eat and drink [6].
Around 48% of people in the United States take in less magnesium from food and drink than the estimated average requirement for their age and sex [6]. But it's important to note that eating less than a target is not the same as being deficient, and outright deficiency is uncommon in otherwise healthy people because the kidneys conserve magnesium when we don't eat enough in our diet [6]. We took that argument apart separately in are we all magnesium deficient?
Food has one advantage that rarely gets mentioned: no upper limit has been set for the magnesium naturally present in food. In healthy people magnesium does not pose a risk, because the kidneys pass the excess into urine [6].
Magnesium Supplementation
Swallowing magnesium is not the same as absorbing magnesium. Around 30% to 40% of the magnesium in food and drink is absorbed, and the rest passes through [6].
In a study that added increasing doses of a soluble magnesium salt to a standard meal, the fraction absorbed fell from about 65% at the smallest dose to about 11% at the largest dosage [8]. The total amount of magnesium absorbed still rose, just not proportionally. The authors interpret these results to say that our intestine resists losing magnesium when intake is low and resists absorbing too much when it is high [8].
How well a form dissolves shapes the same process, which is why the aspartate, citrate, lactate and chloride forms absorb better than oxide and sulfate [6]. In that same study, magnesium from almonds was as bioavailable as the soluble salt, while an enteric-coated tablet absorbed considerably less well [8]. What is not absorbed stays in the intestine and draws water in, which is the laxative effect magnesium is also sold for [6].
What is absorbed then gets regulated on the way out, with healthy kidneys passing the excess into urine. That is why magnesium from food does not pose a risk in healthy people, and why deficiency from diet alone is uncommon [6]. The groups more likely to run low are people with gastrointestinal disease, type 2 diabetes or alcohol dependence, and older adults [6].
Regulation sits outside all of that. The U.S. Food and Drug Administration (FDA) does not approve dietary supplements for safety and effectiveness before they go on sale, which is true of every supplement rather than magnesium in particular [9]. That is why labels say a product supports sleep rather than treats insomnia, since anything intended to treat a disease is legally a drug [9]. Whenever a label makes a claim of that kind, federal regulation requires it to carry a fixed disclaimer saying the FDA has not evaluated the statement [10].
How Much Magnesium Is Safe to Take?
There are two numbers, and they are easy to confuse. The recommended intake for adults is roughly 310 to 420 milligrams a day, and that includes magnesium from everything, food included. The tolerable upper intake level for supplemental magnesium is 350 milligrams a day for adults, and that one includes only what comes from supplements and medications, not the magnesium naturally present in food and drink [6].
That is why the ceiling for supplement intake appears to be lower than the daily required total magnesium. You are not being told to eat less than you need. The two numbers constitute different factors, and NIH is explicit about why: too much magnesium from food does not pose a risk to healthy people, because the kidneys pass the excess into urine, while it is high doses from supplements and medications that can produce the diarrhea, nausea and cramping the limit was set against [6].
The most-cited older insomnia trial gave 500 milligrams of elemental magnesium daily for eight weeks, well over the supplemental limit, under supervision [5].
Those are reference figures rather than a recommendation for you. What is right for one person depends on their diet, their kidney function and their medications, which is a conversation for a pharmacist or a prescriber.
Side Effects of Magnesium Supplements
The common side effects of high doses of magnesium are diarrhea, nausea and abdominal cramping. The forms most often reported to cause diarrhea are carbonate, chloride, gluconate and oxide [6]. Citrate belongs in the same conversation, since magnesium citrate is sold over the counter as a laxative in its own right. The reason is mechanical rather than mysterious: the salt that does not get absorbed pulls water into the gut [6].
The more important caution is about who should not supplement without medical advice. Magnesium is cleared by the kidneys. Hence when kidney function is impaired, it builds up instead of being flushed out, and the risk of taking too much rises accordingly [6]. Anyone with kidney disease should consult their clinician before deciding to take magnesium supplements.
Digestive trouble is also the most useful signal one can get. Loose stools mean the dose or the form is not being tolerated [6], rather than a gauge of how much you took in. Whether to lower the dose, switch or stop is a discussion between you and your healthcare provider.
Magnesium also interacts with medication in both directions. Magnesium can interfere with bisphosphonates and with tetracycline and quinolone antibiotics, and separately, some prescription diuretics and proton pump inhibitors can affect magnesium status over time [6]. If you take anything regularly, have a pharmacist or healthcare provider check the combination rather than guessing.
Recommended Magnesium Supplements for Sleep
No form of magnesium has been shown to be the right one for sleep, because almost none of them have been tested for it.
Only one form of magnesium has a modern sleep trial behind it. That trial used magnesium bisglycinate and found a small improvement, but it delivered roughly a gram and a half of glycine alongside the magnesium, and glycine has its own literature in sleep, so the result cannot be pinned on the magnesium alone [2]. The older trials pooled in the insomnia review mostly used oxide, which is the form the absorption data treats least favorably [1][5][6]. Absorption is not the same as benefit, either: getting more of a mineral into your bloodstream only matters if you are short of it.
This is why it is important to stay suspicious of marketing that targets specific types of magnesium for improving sleep or even cognition. If an Internet website tells you exactly which form to buy for sleep, it is not necessarily based on the published evidence.
When to Talk to a Doctor About Your Sleep
Trouble falling or staying asleep on three or more nights of the week, going on for three or more months, and affecting how you function during the day, is the point at which sleep issues stop being a temporary bad period and start being something worth treating properly [11].
Additionally, some signs deserve a conversation with a healthcare provider even sooner. Loud snoring, gasping or choking at night, or someone telling you that you stop breathing, point at something a supplement will not touch. So does sleeping a full night and waking unrefreshed anyway, or sleep that got worse alongside low mood, anxiety, pain or a new medication. And if you have kidney disease, ask before you supplement rather than after.
If you do book the appointment, try to come in with as much data as you have. For example, two weeks of rough notes on when you got into bed, when you think you fell asleep and when you got up will tell a clinician more and allow them to help you even better.
Frequently Asked Questions
Is it safe to take magnesium every night?
For most healthy adults, nightly magnesium within the 350 milligram supplemental upper limit is not considered risky, and the usual problem is digestive rather than dangerous [6]. The exceptions matter more than the rule: impaired kidney function changes the picture, and so do several common medications [6]. Check with a pharmacist or healthcare provider if you take anything regularly.
How long does magnesium take to work for sleep?
The trials that found anything ran for weeks, not nights. The bisglycinate trial reported its result at four weeks, and the older insomnia trials ran from about three weeks to eight weeks [1][2].
Is magnesium glycinate better than citrate for sleep?
There is no trial comparing them for sleep. Citrate is one of the four forms the NIH absorption comparison covers, and glycinate is not in it, while glycinate is the only form with a modern sleep trial attached [2][6]. Those are different kinds of evidence, and neither settles it.
Can I take magnesium with a prescription sleep medication?
That depends on the specific medication and on your kidney function, and it is a question for your prescriber or pharmacist rather than an article. Magnesium has documented interactions with some drug classes, and some prescriptions affect magnesium levels themselves [6]. Do not add, stop or change anything you were prescribed without asking first.
Does magnesium help with anxiety that keeps you awake?
Unfortunately there isn't enough data to support this claim. If worry or a racing mind is what keeps you awake, or you have insomnia that has lasted months, clinical guidelines first recommend trying cognitive behavioral therapy for insomnia (CBT-I) [11].
A Science-Backed Protocol for Sleep, and Where Magnesium Fits
There is a first-line treatment for chronic insomnia, and it is not something you can buy on a shelf. Clinical guidelines from the American Academy of Sleep Medicine recommend CBT-I (Cognitive Behavioral Therapy for Insomnia) as the starting point for adults whose insomnia has lasted months [11]. It works by changing what you do with your nights and how you think about them, which is durable in a way no capsule has matched. You can read how long CBT-I takes to improve sleep if you want the timeline.
Rest is a program built on the behavioral principles of CBT-I, plus circadian biology and neuroscience, developed together with world-class sleep experts from institutions like UCSF and Stanford. It coaches those changes in short daily conversations, by text or by voice, and adapts as your nights change. If you have been working through the supplement aisle for months, that is the thing worth trying next.
Disclaimer. This article is published for general information only. It is not medical advice or a diagnosis, and nothing here is a recommendation to take, avoid, or change any supplement or medication. Rest is not a substitute for professional medical care. Do not start, stop, or adjust a treatment, including a prescribed sleep medication, without talking to your clinician.
Article originally written by Rest. Edited for medical accuracy by Dr. Priyanka Wali.
Citations
Mah, J., & Pitre, T. (2021). Oral magnesium supplementation for insomnia in older adults: A systematic review & meta-analysis. BMC Complementary Medicine and Therapies, 21, 125. https://doi.org/10.1186/s12906-021-03297-z
Schuster, J., Cycelskij, I., Lopresti, A., & Hahn, A. (2025). Magnesium bisglycinate supplementation in healthy adults reporting poor sleep: A randomized, placebo-controlled trial. Nature and Science of Sleep, 17, 2027–2040. https://doi.org/10.2147/NSS.S524348
Zhang, Y., Chen, C., Lu, L., et al. (2022). Association of magnesium intake with sleep duration and sleep quality: Findings from the CARDIA study. Sleep, 45(4), zsab276. https://doi.org/10.1093/sleep/zsab276
Arab, A., Rafie, N., Amani, R., & Shirani, F. (2023). The role of magnesium in sleep health: A systematic review of available literature. Biological Trace Element Research, 201, 121–128. https://doi.org/10.1007/s12011-022-03162-1
Abbasi, B., Kimiagar, M., Sadeghniiat, K., et al. (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.
National Institutes of Health, Office of Dietary Supplements. Magnesium: Fact Sheet for Health Professionals. https://ods.od.nih.gov/factsheets/Magnesium-HealthProfessional/ (accessed August 2026)
Morton, D. J. (1987). Effect of various cations on the activity of pineal gland N-acetyltransferase and hydroxyindole-O-methyltransferase in vitro. Journal of Pineal Research, 4(2), 161–167. https://doi.org/10.1111/j.1600-079x.1987.tb00852.x See also Morton, D. J. (1987). Mechanism of inhibition of bovine pineal gland hydroxyindole-O-methyltransferase by divalent cations. Journal of Pineal Research, 4(3), 295–303. https://doi.org/10.1111/j.1600-079x.1987.tb00867.x
Fine, K. D., Santa Ana, C. A., Porter, J. L., & Fordtran, J. S. (1991). Intestinal absorption of magnesium from food and supplements. Journal of Clinical Investigation, 88(2), 396–402. https://doi.org/10.1172/JCI115317
U.S. Food and Drug Administration. FDA 101: Dietary Supplements. https://www.fda.gov/consumers/consumer-updates/fda-101-dietary-supplements (accessed August 2026)
Code of Federal Regulations, Title 21, §101.93(c) — Certain types of statements for dietary supplements. https://www.ecfr.gov/current/title-21/section-101.93 (accessed August 2026)
Edinger, J. D., Arnedt, J. T., Bertisch, S. M., et al. (2021). Behavioral and psychological treatments for chronic insomnia disorder in adults: An American Academy of Sleep Medicine clinical practice guideline. Journal of Clinical Sleep Medicine, 17(2), 255–262. https://doi.org/10.5664/jcsm.8986
