Start your routine
Supplements

Does magnesium help you sleep?

By Ultiself Editorial Team Updated 11 min read

Woman reading a book in bed next to a bedside lamp in a calm bedroom

Magnesium may help some people sleep a little better, but the evidence is weak: a meta-analysis of three small trials in 151 older adults found that people taking magnesium fell asleep about 17 minutes faster than with a placebo, and the authors rated the quality of the studies as low [1]. Observational studies link higher magnesium intake with better sleep, but they cannot show cause and effect [2], so steady sleep habits remain the better-studied starting point.

What research actually shows about magnesium and sleep

Magnesium is a mineral involved in hundreds of processes in the body, including nerve and muscle function. Because of this role, it is often promoted online as a natural sleep aid, and products marketed for sleep are easy to find. The research behind these claims is much thinner than the marketing suggests, and the details matter.

Two kinds of studies are relevant here. Randomized trials compare magnesium with a placebo, which is the stronger design for testing whether a supplement causes a change. Observational studies look at how much magnesium people get and how they sleep, which can reveal links but cannot separate magnesium from everything else in a person's lifestyle.

The trials: a small effect in a small number of people

The most cited review, by Jasmine Mah and Tyler Pitre, searched several medical databases and found only three randomized trials of oral magnesium for insomnia in older adults, with 151 participants in total [1]. In the pooled analysis, people taking magnesium fell asleep about 17 minutes faster than those taking a placebo [1].

The authors concluded that the quality of the literature was too low for doctors to make well-informed recommendations [1]. The trials were short, small and limited to older adults, so the results may not apply to younger people or to people with normal magnesium levels. A later systematic review also described the trial evidence as uncertain [2].

QuestionWhat the trials suggestHow confident we can be
Does magnesium shorten the time to fall asleep?About 17 minutes faster than placebo in older adults [1]Low quality evidence
Does it help younger adults?Not well studiedUnknown
Does it help people with normal magnesium levels?Not well studiedUnknown
Is it as effective as behavioural treatment for insomnia?No trials compare them directlyUnknown

The table shows how much is still unknown. A 17-minute difference sounds meaningful, but it comes from very few people and short studies, and the result could change as better trials appear. This is why many sleep researchers describe magnesium as promising but unproven rather than as a reliable sleep aid.

Observational studies: links, not proof

The systematic review by Arab and colleagues looked at both observational and interventional studies in adults [2]. Observational studies linked magnesium status with aspects of sleep such as sleep duration and daytime sleepiness, while the randomized trials showed an uncertain association [2]. The authors called for larger and longer trials [2].

Observational links are hard to interpret. Foods rich in magnesium, such as legumes, nuts, seeds, whole grains and leafy green vegetables [3], are also part of diets that tend to go with other healthy habits. People who eat these foods may also exercise more, drink less alcohol or keep more regular schedules, and any of these differences could explain better sleep.

  • Magnesium-rich diets may go together with other healthy habits.
  • People who sleep poorly may eat differently because of tiredness.
  • Studies measure magnesium in different ways, which makes them hard to compare.
  • An association in a group does not show what will happen for one person.

None of this means magnesium is irrelevant to sleep. It means that the research so far cannot tell whether taking a supplement will change how a particular person sleeps. For people who are curious, food sources and a conversation with a doctor are a more cautious place to start than a supplement chosen from social media.

Myths, safety and when to be careful

Magnesium is often presented as harmless because it is natural and widely available. Natural does not automatically mean safe for everyone, and some popular claims about magnesium go further than the evidence. Sorting the myths from what is known can help you make a more informed decision with a health professional.

The sections below look at common beliefs about magnesium and sleep, the side effects and interactions listed by health authorities and the situations in which talking to a doctor is especially important. This information is general and does not replace an individual assessment.

Common myths about magnesium and sleep

One popular idea is that a bath with Epsom salt, which is magnesium sulfate, raises magnesium levels through the skin. A review of this question by Uwe Gröber and colleagues concluded that there is little scientific evidence that magnesium is meaningfully absorbed through the skin [4]. A warm bath may still feel relaxing, but probably for other reasons.

Interestingly, warmth itself has some evidence behind it. A meta-analysis found that a warm bath or shower one to two hours before bedtime was associated with falling asleep faster and better self-rated sleep quality [5]. Researchers think this works by helping the body cool down afterwards, which is part of the natural process of falling asleep.

MythWhat the evidence suggests
Magnesium is a proven sleep aidTrial evidence is limited and of low quality [1]
Epsom salt baths raise magnesium levelsLittle evidence of meaningful absorption through the skin [4]
Everyone who sleeps badly lacks magnesiumPoor sleep has many causes, and deficiency needs a proper assessment
Natural supplements cannot cause harmHigh intakes from supplements can cause side effects [3]

These myths are common partly because each contains a grain of truth. Magnesium does matter for health and a bath can feel calming, but neither fact shows that a supplement or a salt bath will fix sleep problems. Treating claims with curiosity rather than certainty may protect you from spending money on products that do not work for you.

Side effects and interactions

According to the Office of Dietary Supplements at the US National Institutes of Health, high intakes of magnesium from supplements and medicines can cause diarrhoea, nausea and abdominal cramping, and extremely high intakes can be dangerous [3]. Health authorities set an upper limit for magnesium from supplements and medicines, which should not be exceeded unless a health professional recommends it [3].

Magnesium supplements can also interact with some medicines, including certain antibiotics and medicines for osteoporosis, and some medicines affect how the body handles magnesium [3]. People with kidney problems may be less able to remove excess magnesium. These are reasons why a pharmacist or doctor should check any supplement against your health and medicines.

  • Digestive side effects such as diarrhoea can occur with high intakes [3].
  • Some antibiotics and osteoporosis medicines can interact with magnesium [3].
  • Kidney disease can affect how the body clears magnesium.
  • Many laxatives and antacids already contain magnesium [3].

The last point is easy to overlook. Someone who already takes an antacid or laxative containing magnesium may get more than they realise if they add a supplement. Bringing all your supplements and medicines to an appointment, or listing them for a pharmacist, can help them spot overlaps and interactions.

When poor sleep needs medical attention

Trouble sleeping is common, but persistent insomnia is a recognised condition with effective treatments. The American Academy of Sleep Medicine strongly recommends cognitive behavioural therapy for insomnia, a structured programme that changes sleep habits and thoughts about sleep, for adults with chronic insomnia [6]. This approach has far more research behind it than any supplement.

Some sleep problems also signal other conditions. Loud snoring with pauses in breathing, very strong daytime sleepiness or sleep problems that come with low mood need a medical assessment rather than self-treatment. A doctor can also check whether a magnesium deficiency is likely, which usually requires a clinical assessment rather than guesswork.

SituationSuggested next step
Trouble sleeping most nights for several weeksTalk to a doctor about assessment and insomnia treatment
Loud snoring, gasping or pauses in breathingAsk a doctor about a sleep apnoea assessment
Considering a magnesium supplementCheck with a doctor or pharmacist first
Taking medicines or having kidney problemsDo not start supplements without medical advice

If you are unsure where you fit, starting with a conversation with your doctor is a reasonable choice. Our guide on [whether you need supplements](https://ultiself.com/blog/do-you-need-supplements) explains more about how to think about supplements in general and why a varied diet is usually the foundation.

How to build a sleep routine step by step

Whatever you decide about magnesium, sleep habits are where most of the research points. The behavioural approaches recommended for insomnia, such as keeping a regular schedule and building a calm evening routine, are also useful for people who simply want to sleep a little better [6]. They have no side effects and can be adjusted to your life.

The table below breaks a sleep routine into small steps, each linked with a habit you can track. Starting with one or two steps for a couple of weeks is usually more sustainable than changing everything at once. Each step can be added when the previous one feels familiar.

StepWhy it may helpHabit to practice
Keep a regular scheduleConsistent sleep times support the body clock[Sleep hygiene routine](https://ultiself.com/habits/sleep-hygiene-routine)
Track how you sleepA record can show patterns and help a doctor[Track your sleep](https://ultiself.com/habits/track-your-sleep)
Time caffeine earlierCaffeine late in the day may reduce sleep[Caffeine-free day](https://ultiself.com/habits/caffeine-free-day)
Create a wind-down hourA calm routine may make it easier to fall asleep[Wind down routine](https://ultiself.com/habits/wind-down-routine)
Put screens awayLess stimulation before bed may help you relax[Limit stimulation before bed](https://ultiself.com/habits/limit-stimulation-before-bed)
Relax the bodyRelaxation techniques are part of insomnia treatment[Progressive muscle relaxation](https://ultiself.com/habits/progressive-muscle-relaxation)

These steps build on each other, so even a few of them may make evenings calmer. Ultiself is a habit tracking app that lets you add each of these habits to your evening routine, mark them as done and see over time how they line up with your sleep. Tracking can make it easier to notice which habits seem to matter most for you.

Set your schedule and track your sleep

A regular wake-up time is one of the simplest ways to support the body clock. Getting up at a similar time every day, including weekends, may make it easier to feel sleepy at a similar time each evening. Adults are generally advised to aim for seven or more hours of sleep on a regular basis.

Keeping a simple sleep diary for one or two weeks can show how you actually sleep. Note when you go to bed, roughly when you fall asleep, how often you wake and how rested you feel. A diary is also useful if you see a doctor, because it gives them a clearer picture than memory alone.

What to noteWhy it is useful
Bedtime and wake-up timeShows how regular your schedule is
Rough time to fall asleepShows whether falling asleep is the main problem
Night awakeningsHelps distinguish different sleep problems
Caffeine, alcohol and late mealsReveals possible evening triggers

After a week or two, look for patterns rather than single bad nights. The [Track your sleep](https://ultiself.com/habits/track-your-sleep) habit may make it easier to keep this record going. Many people find that the diary itself makes them more aware of habits that affect their evenings.

Build a calm wind-down hour

The last hour before bed can act as a buffer between the day and sleep. Dimming the lights, putting screens away and choosing quiet activities, such as reading a paper book or listening to calm music, may help the body and mind slow down. A warm shower or bath one to two hours before bed is another option with some research behind it [5].

Relaxation techniques can be added to this hour. Progressive muscle relaxation, which involves tensing and releasing muscle groups one by one, and slow breathing exercises are commonly used in insomnia treatment. A caffeine-free herbal tea can also become a pleasant cue that the evening is winding down.

  • Dim the lights about an hour before bed.
  • Put your phone on charge outside the bedroom.
  • Take a warm shower or bath one to two hours before bed.
  • Try a few minutes of muscle relaxation or slow breathing.
  • Keep the bedroom cool, dark and quiet.

The [Wind down routine](https://ultiself.com/habits/wind-down-routine), [Breathing exercises](https://ultiself.com/habits/breathing-exercises) and [Drink chamomile tea](https://ultiself.com/habits/drink-chamomile-tea) habits fit well into this hour. Our guide on [how to fall asleep faster](https://ultiself.com/blog/how-to-fall-asleep-faster) explains more evening habits that may help. Choosing two or three of these steps and repeating them in the same order each night may turn them into a familiar signal that sleep is coming.

Give new habits time

Sleep habits take time to settle. In one study, new daily habits took a median of 66 days to feel automatic, with large differences between people [7]. If-then plans, which link a situation to an action, had a medium to large effect on reaching goals in a meta-analysis of 94 tests [8], and they can make an evening routine easier to follow.

Changes in sleep are often gradual and may not show up after one or two nights. Tracking for several weeks gives a fairer picture. If sleep problems continue despite steady habits, that is useful information to share with a doctor, who can discuss assessment and treatment options.

SituationIf-then plan
After dinnerIf I finish dinner, I switch to caffeine-free drinks
One hour before bedIf it is 10 pm, I put my phone on charge in the hallway
In bed and wide awakeIf I cannot sleep after a while, I get up and read in dim light
WeekendIf it is Saturday, I still get up within an hour of my usual time

Our guide on [how long it takes to build a habit](https://ultiself.com/blog/how-long-does-it-take-to-build-a-habit) explains how new routines become automatic. Patience matters here, because the benefits of steady sleep habits usually build over weeks rather than overnight. Small, consistent changes kept for a month or more usually tell you more than any single night.

Common questions

Does magnesium help you sleep?

The evidence is limited. A meta-analysis of three small trials in older adults found that magnesium shortened the time to fall asleep by about 17 minutes compared with placebo, but the authors rated the evidence as low quality. More and larger trials are needed.

Is magnesium safe to take for sleep?

High intakes from supplements can cause digestive side effects, and magnesium can interact with some medicines. People with kidney problems or who take medicines should talk to a doctor or pharmacist before taking any supplement.

Does an Epsom salt bath give you magnesium?

A review found little scientific evidence that magnesium is meaningfully absorbed through the skin. A warm bath may still feel relaxing, and warm baths before bed have been linked with falling asleep faster.

Which foods contain magnesium?

Good food sources include legumes, nuts, seeds, whole grains and green leafy vegetables such as spinach. Some breakfast cereals are also fortified with magnesium.

What helps insomnia if not magnesium?

Cognitive behavioural therapy for insomnia is strongly recommended for adults with chronic insomnia by the American Academy of Sleep Medicine. Regular sleep times and a calm evening routine are also commonly suggested.

Sources

  1. Mah J, Pitre T. Oral magnesium supplementation for insomnia in older adults: a systematic review and meta-analysis. BMC Complementary Medicine and Therapies, 2021.
  2. Arab A, Rafie N, Amani R, Shirani F. The role of magnesium in sleep health: a systematic review of available literature. Biological Trace Element Research, 2023.
  3. National Institutes of Health, Office of Dietary Supplements. Magnesium: fact sheet for consumers.
  4. Gröber U, Werner T, Vormann J, Kisters K. Myth or reality: transdermal magnesium? Nutrients, 2017.
  5. Haghayegh S, Khoshnevis S, Smolensky MH, Diller KR, Castriotta RJ. Before-bedtime passive body heating by warm shower or bath to improve sleep: a systematic review and meta-analysis. Sleep Medicine Reviews, 2019.
  6. Edinger JD, Arnedt JT, Bertisch SM, et al. Behavioral and psychological treatments for chronic insomnia disorder in adults: an American Academy of Sleep Medicine clinical practice guideline. Journal of Clinical Sleep Medicine, 2021.
  7. Lally P, van Jaarsveld CHM, Potts HWW, Wardle J. How are habits formed: modelling habit formation in the real world. European Journal of Social Psychology, 2010.
  8. Gollwitzer PM, Sheeran P. Implementation intentions and goal achievement: a meta-analysis of effects and processes. Advances in Experimental Social Psychology, 2006.

Keep reading

More guides from supplements.

Woman planning her daily routine in the Ultiself app at home

Personalize your progress

Get started with Ultiself app

Take the quiz