Magnesium does appear to help with sleep, particularly for people who aren’t getting enough of it through their diet. It works through several biological pathways that calm the nervous system, and while it’s not a sedative, consistent supplementation over weeks can meaningfully improve both the ability to fall asleep and stay asleep.
How Magnesium Affects Sleep
Magnesium influences sleep through at least two key mechanisms. First, it helps regulate cortisol, one of your body’s primary stress hormones. When cortisol stays elevated at night, your brain essentially remains on alert, making it harder to wind down. Magnesium helps level out cortisol by dampening the signaling pathways that send it surging to your brain.
Second, magnesium shifts the balance between your brain’s “go” and “stop” signals. It blunts the release of glutamate, the neurotransmitter that keeps neurons firing, and supports the release of GABA, the neurotransmitter that quiets them down. This is the same calming system that many prescription sleep aids target, though magnesium’s effect is far gentler. The result is a nervous system that’s less reactive and more ready for rest.
How Much to Take and When
A common recommendation from sleep specialists is 250 to 500 milligrams of magnesium taken as a single dose at bedtime. This isn’t the kind of supplement that works overnight. A reasonable trial is taking it nightly for about three months, then evaluating whether your ability to fall asleep or stay asleep has improved.
One important distinction: the tolerable upper intake level for supplemental magnesium is 350 mg per day for adults, according to the NIH. That limit applies only to magnesium from supplements and medications, not from food. Doses above that threshold aren’t necessarily dangerous, but they increase the likelihood of digestive side effects like loose stools and cramping. If you’re aiming for the higher end of the 250 to 500 mg range, it’s worth discussing that with a healthcare provider.
The daily recommended intake from all sources (food plus supplements) is 400 to 420 mg for adult men and 310 to 320 mg for adult women. Many people fall short of this through diet alone, which is part of why supplementation can make a noticeable difference.
Which Form of Magnesium Works Best
Not all magnesium supplements are the same. The form you choose matters both for absorption and for side effects.
- Magnesium glycinate is generally the top pick for sleep. It’s a chelated form, meaning the magnesium is bonded to an amino acid (glycine), which makes it easier to absorb. It’s also the least likely to cause digestive upset, making it a better fit if you have a sensitive stomach or already have regular bowel movements.
- Magnesium citrate absorbs reasonably well but has a notable laxative effect. If you deal with constipation, that might be a welcome bonus. If not, it can be disruptive, especially at higher doses taken right before bed.
- Magnesium oxide is the cheapest and most widely available form, but it absorbs poorly. Its low bioavailability means less magnesium actually reaches your bloodstream, and it’s more likely to cause loose stools. Most experts recommend avoiding this form if your goal is sleep support.
When comparing labels, pay attention to the amount of elemental magnesium listed, not just the total weight of the compound. A 500 mg capsule of magnesium glycinate might contain only 100 mg of actual magnesium. The elemental amount is what counts toward your daily intake.
Magnesium and Restless Legs
If your sleep problems stem from restless leg syndrome, the uncomfortable urge to move your legs that tends to flare up at night, magnesium may help with that specifically. A pilot study published in the Journal of Clinical Sleep Medicine found that 200 mg of elemental magnesium citrate taken daily with dinner for eight weeks improved restless leg symptoms and objective test scores. That’s a relatively low dose, and the improvements were seen with magnesium alone, not combined with other medications. For people whose sleep disruption is driven primarily by restless legs rather than general insomnia, this is encouraging.
Food Sources Worth Adding
Supplements aside, you can meaningfully boost your magnesium intake through food. Some sources are surprisingly concentrated:
- Pumpkin seeds (pepitas): 159 mg per 30-gram handful
- Chia seeds: 114 mg per 30 grams
- Almonds: 80 mg per 30 grams
- Cashews: 75 mg per 30 grams
- Brown rice (cooked): 72 mg per half cup
- Spinach (boiled): 57 mg per half cup
A small handful of pumpkin seeds as an evening snack delivers roughly half the magnesium in a typical supplement capsule. Combining a few of these foods throughout the day can bring you close to the recommended intake without supplementing at all, or at least reduce how much supplemental magnesium you need.
Who Should Be Cautious
Magnesium is safe for most people at standard doses, but there are a few situations where extra care is warranted.
People with kidney disease need to be particularly careful. Healthy kidneys efficiently clear excess magnesium, but impaired kidneys cannot. Blood magnesium levels above a certain threshold are associated with serious health consequences, including higher mortality in people with chronic kidney disease.
Several common medications can also interact with magnesium. Proton pump inhibitors (the heartburn drugs many people take daily) and certain diuretics can deplete magnesium, which means you may need more of it but should be monitored rather than self-supplementing aggressively. If you’re taking high-dose vitamin D, that can also reduce magnesium levels because your body uses magnesium to metabolize vitamin D. People correcting a significant vitamin D deficiency sometimes develop magnesium depletion without realizing it.
The most common side effect of supplemental magnesium is digestive: loose stools, nausea, or cramping. This is dose-dependent and far more likely with magnesium oxide and citrate than with glycinate. Starting at a lower dose and increasing gradually is a practical way to find your tolerance.

