Popular keywords

Sleep calculator

Discover how much sleep you really need

Magnesium for Sleep – Sources, Benefits and How to use it?

Fact Checked
Up to date
Update: April 27, 2023
7 min read

Written by

Rahul Upadhyay
Content Writer
Illustration Of Magnesium

Overcoming sleep trouble and insomnia is a daunting task for many. Besides various breathing exercises, lifestyle changes, and other methods, taking supplements is a popular way to achieve deep and restful sleep.  

To date, melatonin is the most popular supplement to help you doze off. This is because it imitates your body’s sleep hormone. However, another supplement has been recently discovered for better sleep and is grabbing the limelight. It is magnesium for sleep.  

Curious about how does magnesium helps you sleep? Read on to unravel the mystery.

What is Magnesium?

Magnesium counts among the 24 essential minerals and vitamins required by our body for smooth and healthy functioning.  

Wondering what magnesium is good for? Magnesium plays a vital role in over 600 cellular reactions happening inside our bodies. It is especially useful for bone health and proper muscle, brain, and heart functioning. It also helps maintain a healthy immune system, manage blood pressure, and plays a pivotal role in protein and energy production. It is also believed to improve sleep. 

The magnesium requirement for an adult is 400-420 mg daily for men and 310-320 mg for women. Despite this large requirement, our body does not produce magnesium independently; thus, we rely on diet and supplements to meet the required bar.  

How Does Magnesium Help You Sleep?

Magnesium is emerging as the new supplement for better sleep aid. Various pieces of research are conducted on magnesium and sleep and their correlation. While we do not have enough concrete evidence on whether magnesium is good for sleep, a lack of magnesium enhances sleep troubles.  

The below-listed insights reveal the potential of how magnesium helps you sleep.  

1. Magnesium Helps Your Brain and Body Relax 

You cannot sleep restfully unless your brain and body are completely relaxed. Studies indicate that magnesium helps activate the parasympathetic nervous system, which functions to calm and relax you.  

For it, magnesium regulates the neurotransmitters responsible for sending signals throughout the brain and the nervous system. It also regulates melatonin, the hormone responsible for the sleep-wake cycles of our body.   

Another way magnesium helps you relax is by binding itself to the gamma-aminobutyric acid (GABA) receptors, which are responsible for quieting down nerve activity. You find the same neurotransmitter in popular sleep drugs like Ambien. 

Overall, the effect of magnesium on sleep and anxiety is manifested by calming the mind and body.  

2. Regulates Stress and Anxiety 

A critical part of calming yourself is reducing stress and anxiety. We already know that magnesium impacts the body’s parasympathetic nervous system and increases the body’s GABA levels for more restorative sleep.  

Magnesium also affects the sympathetic nervous system, the ‘fight-or-flight’ response system. As a result, it leaves you in a heightened state of arousal.  

Magnesium supplements help these two systems reach an equilibrium. A German study showed that when magnesium sleep aid was used, it helped in reducing sleep disorders, depression, stress, poor concentration and irritability.  

3. Improve Restless Leg Syndrome  

Restless leg syndrome is a disorder in which you experience an uncontrollable and uncomfortable urge to move or shake your legs. It gives you a “pins and needles” feeling. It triggers a sense of inactivity, and shaking of the leg relieves it.  

The condition tends to worsen at night and leads to insomnia. But regular intake of magnesium before bed reduces the symptoms and helps you sleep better. 

4. Depression and Mood  

Depression and mood disorders are other leading causes of restlessness, insomnia, and other sleep disorders. According to research, one of the benefits of magnesium supplement intake is the reduction of depression and associated symptoms, that in turn helps you sleep better.  

5. Digestion And Gut Health 

Any digestive issue will make you uneasy and uncomfortable, disrupting your sleep. While the studies are still in their primitive stage, a link between gut health and magnesium is increasingly being examined.  

A research in Denmark indicated that magnesium deficiency triggered an imbalance of healthy microbiota in the gut and caused digestive issues and even depressive-like behaviour.  

6. Aches, Pains, & Muscle Cramps  

Various research also finds an increased link between magnesium deficiency and twitches, spasms, muscle cramps, and general weakness.  

Taking magnesium at night helps improve leg cramps, among other things, to help people sleep better.  

Other Benefits of Magnesium

Apart from sleep benefits, magnesium supplements also render several other benefits like:

  • Magnesium plays a vital role in the bone-building process. Hence, when you use the best magnesium supplement for sleep, you also reduce bone loss or osteoporosis symptoms.  
  • Early research indicates magnesium supplements might reduce blood pressure marginally and minimise the chances of strokes or heart diseases. However, more authentication is still required.  
  • Magnesium plays a vital role in the breakdown of sugars in the body. Therefore, it is believed that a magnesium-rich diet can help you manage and avert type 2 diabetes. However, we still need concrete research on it.  
  • Another benefit of taking magnesium for sleep is that it reduces symptoms of headaches and migraines. However, the dosage required for migraine treatment is much higher than the standard magnesium dosage for sleep. Hence, you should only take it for migraines under a doctor’s supervision. 

While nothing has been concretely established, early studies indicate the positive effects of magnesium, especially on our sleep.

Sources of Magnesium

You can get your daily recommended dose of magnesium through multiple avenues. 

Foods Rich in Magnesium 

If you eat a healthy and balanced diet daily, you will easily get the required daily dosage of magnesium effortlessly. It is the best form of magnesium for sleep.  

But you should avoid processed foods as they not only strip away nutrients but also lower the magnesium content significantly.  

The best source of dietary magnesium is whole and unprocessed foods. Likewise, tap water and mineral or bottled water are also excellent sources of dietary magnesium. But its percentage can vary from brand to brand.  

According to the US Department of Agriculture, foods richest in magnesium are almonds, boiled spinach, cashews, peanuts, and shredded wheat cereal.  

Other food sources offering you the best type of magnesium for sleep are: 

  • Seeds and nuts like almonds, cashews, sesame seeds, sunflower seeds, etc. 
  • Dark, leafy greens 
  • Broccoli, squash 
  • Legumes 
  • Soy milk 
  • Peanut butter 
  • Dairy products like milk, yoghurt, etc. 
  • Eggs 
  • Banana 
  • Avocado 
  • Beef, chicken breast 
  • Salmon, halibut

Magnesium Supplements 

Due to several reasons, you might not be getting your recommended daily dosage of this essential mineral from your diet. In that case, you can turn to magnesium supplements. They are readily available in drug stores and even online.  

When shopping for magnesium supplements, choose carefully, as some supplements would have a blend of different types of magnesium while some would have just one form of this essential mineral.

Magnesium glycinate for sleep works wonders as it offers one of the most absorbable forms of magnesium and promotes restorative sleep and healthier REM cycles. It is considered one of the best magnesium for sleep. It is easily available over the counter and should be taken only in the required dosage.  

Other popular magnesium supplements are magnesium citrate for sleep, magnesium orotate, magnesium chelate, etc.  

Supplements make you wonder: ‘How much magnesium for sleep?’ ‘When to take magnesium for sleep?’ etc. 

Ideally, they should be taken 30 minutes before bedtime and never more than the recommended dosage as it won’t show any enhanced sleep effect and might cause stomach upset.  

Magnesium Oil  

It is a topical remedy prepared with water and magnesium chloride.  

It is often used for calming purposes in baths and applied topically to relieve muscle pains and cramps.  

How to use magnesium oil for sleep? Rub a little oil on your soles and back at least 30 minutes before bedtime. It can sometimes itch your skin. If it does, you can rinse it after 20-30 minutes, in which the transdermal absorption has already happened. You can leave it on and sleep also if it does not sting. 

Apart from using magnesium oil on feet for sleep, you can also use the magnesium spray for sleep, which is the oil’s latest version. It makes application easier.  

How Much Magnesium to Take? 

The Recommended Dietary Allowance (RDA) for persons aged 19 to 51 years is 400-420 mg daily for men and 310-320 mg for women. Pregnancy necessitates 350-360 mg per day, while lactation necessitates 310-320 mg.

Regardless, it is always advisable to consult your doctor and take magnesium supplements.  

What Happens When You Don’t Have Sufficient Magnesium?

Magnesium deficiency can be genuinely detrimental to your body. It can make you vulnerable to several health risks, interfere with essential body functions and disrupt your sleep. A few of the effects of insufficient magnesium can be: 

  • It can increase your risk of both heart and cardiovascular disease.  
  • Low magnesium levels can be a contributing factor to hypertension.  
  • It can increase your risk of stroke by at least 8%. 
  • Magnesium deficiency can increase your risk of developing type 2 diabetes since the mineral plays a critical role in balancing glucose levels.  
  • Its deficiency can adversely impact bone health and even trigger osteoporosis.  
  • You might become more vulnerable to migraine headaches.  

Side Effects of Magnesium

Magnesium for sleep side-effects are generally negligible, provided you do not exceed the recommended daily dosage limit. However, if your daily dose of magnesium exceeds 600 mg per day, you might experience some side effects like: 

  • Stomach cramping. 
  • The laxative effect, especially if you consume large doses of magnesium oxide. 
  • Magnesium supplements can give temporary side effects like nausea, bloating, vomiting, etc., which disappear soon.  
  • Large doses can trigger severe conditions like irregular heartbeat, low blood pressure, change in breathing, mental confusion, coma, and even death. 
  • Magnesium can interact with other medications and supplements to manifest serious side effects.

Given that, it is strongly advised to take magnesium supplements under medical supervision.

Magnesium Vs Melatonin

Presently, you have two supplement options of magnesium and melatonin for sleep. Your choice would depend on your health condition and your goals.

DefinitionMagnesium is a crucial nutrient mineral that plays a vital role in the body’s different processesMelatonin is a hormone regulating our sleep patterns
UtilityMagnesium aids in sleeping by relaxing and calming the bodyMelatonin causes hormonal changes to induce sleep
ProcessMagnesium supplements aid sleep efficiency and timeMelatonin supplements aid circadian rhythm support
ImpactMagnesium has a milder impact on your sleep habits compared to melatonin.Melatonin has a more severe impact on your sleep habits than Magnesium
Which is better?Magnesium is better for sleep qualityMelatonin is better for quick sleep


Getting quality sleep is crucial to your health. A magnesium supplement can be your best night-time arsenal if you are struggling with sleep. Moreover, it gives you several other benefits that extend beyond the bedroom. Hence, you need not be on the fence about using magnesium as a sleep aid and freely reap its benefits to the hilt.


Is magnesium or melatonin better for sleep?

Magnesium promotes relaxation of the body and reduces tension which enables you to sleep for longer periods of time. Melatonin, on the other hand, encourages faster sleep. Hence, you can resort to melatonin for quick sleep and magnesium for sleep quality. Ultimately, the choice will be yours.

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

Magnesium generally takes 30 minutes to an hour to work for sleep.

What is the best time to take magnesium for sleep?

You should take magnesium 1 or 2 hours before sleeping to relax.

What is the best form of magnesium for sleep?

The best form of magnesium to help you sleep is Magnesium glycinate. It relieves muscle pain and gives you a restful night’s sleep.

Is it OK to take magnesium every night?

Yes, you can take magnesium every night, but ensure you’re not consuming more than the recommended amount.


people like this article


Written by

Rahul Upadhyay
Content Writer
10 years of experience as a content writer Previously worked as a copywriter for a health journal Ability to write in a variety of formats, including articles, white papers, and clinical trial summaries

Read More About Sleep Aids
Acupressure Points For Sleep
Update: May 25, 2023

  • 6 min read

Ashwagandha For Sleep
Update: May 25, 2023

  • 5 min read

Light Therapy For Insomnia
Update: May 11, 2023

  • 5 min read

How To Use Lavender Oil For Sleep
Update: May 11, 2023

  • 5 min read

Sleeping Pills Side Effects
Update: May 8, 2023

  • 5 min read

Update: May 3, 2023

  • 8 min read