If you spend any time on social media, chances are you will have seen a post about magnesium, and in particular how supplements can help with everything from improving sleep to easing migraines. The hashtag #magnesium has more than a billion views on TikTok and my Instagram feed, no doubt powered by an algorithm that knows I’m an exhausted fortysomething, is full of adverts for magnesium sleep cures. But what is the truth about this “mineral of the moment”?

Which supplements should you really take?

What does magnesium do?

“It’s an essential dietary mineral involved in over 600 bodily biochemical reactions,” says Dr Linia Patel, a dietitian and spokesperson for the British Dietetic Association. It’s involved in the function of our energy levels and nervous system, blood pressure regulation and blood glucose control, she adds, while “not having enough is also associated with an increased risk of diabetes and cardiovascular disease”.

Magnesium is also said to improve mood. In a 2023 review of studies, researchers found that such supplements helped to reduce the symptoms of depression. “It plays an important role in stress management because it works together with serotonin and melatonin, two neurotransmitters that help regulate it,” Patel says.

Two small, short-term trials have found that it may help to relieve constipation too.

Read more expert advice on healthy living, fitness and wellbeing

But can it help us to sleep better?

Much of the research around magnesium is related to sleep, Patel says. In a 2021 review of studies involving adults aged over 50, researchers found that those who took a magnesium supplement fell asleep about 17 minutes more quickly than those who didn’t. The researchers couldn’t determine whether the supplements improved the quality and duration of sleep, however. “Within my clinical practice, I find that for women in the menopause with anxiety, muscle aches, migraines, restless legs and sleep issues, supplementing with magnesium may be helpful for some,” Patel says.

However, she warns that adverts on social media making claims about rubbing magnesium cream on your feet before bed should be taken with a pinch of salt, as research showing magnesium ions can cross the skin barrier is sparse.

As a lifelong insomniac, can magnesium really help me sleep?

How much magnesium do we need?

According to the NHS, men aged between 19 and 64 need 300mg a day, and women need 270mg. A balanced diet should provide what you need without resorting to supplements: good sources include dark green leafy vegetables, nuts, seeds, legumes, wholegrains and fish. Many breakfast cereals are also fortified with magnesium, but Patel warns that a diet high in ultra-processed foods will be low in magnesium, and “both alcohol and stress use up your body’s magnesium stores — stress in particular can increase urinary magnesium losses”.

Would a supplement help me?

This is a complicated question, Patel says, because testing magnesium levels is not a routine practice in the UK. “However, in the last dietary and nutrition survey in the UK it showed that, between 2019 and 2023, about 20 to 25 per cent of adult men and about 50 per cent of adult women had magnesium intake below the recommended levels.”