I have sat with hundreds of clients across nearly forty years who sleep badly. Almost none of them were told why. They were told to go to bed at the same time every night. To turn off their screens. To make their bedroom cold and dark. To try meditating.

These aren't bad suggestions. Some of them are genuinely useful. But they address behaviour. And in my clinical experience, the majority of people who can't sleep don't have a behaviour problem. They have a biochemical problem that behaviour can't fix.

This post is about one of the most common biochemical drivers of sleep dysfunction — magnesium — and why it's so often overlooked.

What the advice assumes

Sleep hygiene advice is built on a model of sleep as essentially voluntary — something you do or don't do correctly, based on habits and environment. Clean up the inputs, and the outputs will follow.

But sleep is not primarily a behavioural event. It is a neurological, endocrine, and metabolic event. It requires the coordinated action of neurotransmitters (GABA, serotonin, adenosine), hormones (melatonin, cortisol, progesterone, testosterone), and minerals (magnesium, calcium, potassium). When any part of that biochemical infrastructure is compromised, no amount of screen-time management will reliably fix it.

The standard advice operates as if the brain is a room that just needs the lights turned down at the right time. The actual picture is more like an orchestra — and if the instruments aren't in tune, the conductor's timing doesn't matter.

Magnesium: what it does in sleep

Magnesium is involved in over 300 enzymatic reactions in the body. It is a cofactor for ATP synthesis — without adequate magnesium, your cells cannot produce usable energy efficiently. It is essential for DNA repair, protein synthesis, and the regulation of calcium channels.

For sleep specifically, magnesium does three things that matter enormously:

1. It activates GABA receptors

GABA (gamma-aminobutyric acid) is the brain's primary inhibitory neurotransmitter — the one that quietens neural activity and allows transition to sleep. Magnesium binds to and activates GABA-A receptors, potentiating their calming effect. Without sufficient magnesium, GABA signalling is blunted. The racing mind that won't turn off at night is often, in part, a magnesium story.

2. It blocks NMDA receptors

NMDA receptors are excitatory — they amplify neural signalling. Magnesium physically blocks NMDA receptors in a voltage-dependent way, acting as a natural brake on excessive excitation. When magnesium is depleted, this block is removed. The nervous system becomes hyperexcitable — sensitised to stress, sound, and light in ways that make sleep initiation and maintenance difficult.

3. It regulates cortisol and the HPA axis

Magnesium inhibits the release of ACTH from the pituitary and reduces cortisol output from the adrenal glands. Adequate magnesium helps regulate the cortisol awakening response — the normal morning spike in cortisol that should gradually decline through the day, reaching its lowest point at night. In magnesium-depleted individuals, cortisol regulation becomes dysregulated: the evening decline is blunted, people feel alert when they should be winding down, and they wake at 2–4am with a jolt — often at the adrenal reactivation point in the sleep cycle.

The Magnesium–Sleep Cascade

Why magnesium depletion is so common

Magnesium deficiency is genuinely widespread. Estimates suggest that approximately 50% of the US population and significant proportions of Western European populations consume less than the recommended daily intake — which is itself likely set too low for individuals under physiological stress.

Several factors conspire to make magnesium depletion the modern default:

Soil depletion: Intensive agricultural practices have stripped magnesium from farmland. UK soil magnesium content has declined significantly over the past 60 years. The foods you eat today contain less magnesium than the same foods grown a century ago.

Dietary displacement: The displacement of magnesium-rich whole foods (leafy greens, nuts, seeds, legumes, unrefined grains) by processed foods — which have stripped-out magnesium and added no replacement.

The stress–magnesium loop: Psychological and physiological stress increases magnesium excretion. Adrenaline and cortisol directly promote urinary magnesium loss. If you're under stress, you're losing more magnesium — and if you're not replacing it adequately, the depletion compounds over time. This is a clinically significant positive feedback loop.

Alcohol: Alcohol increases renal magnesium excretion markedly. Even moderate, regular alcohol consumption is a meaningful driver of depletion.

Medications: Proton pump inhibitors (PPIs like omeprazole) substantially reduce magnesium absorption from the gut. Diuretics increase urinary magnesium losses. Antibiotics alter the gut microbiome in ways that affect mineral absorption. Metformin reduces magnesium levels. These are among the most commonly prescribed drug classes in the UK.

Factors That Deplete Magnesium

The serum magnesium problem

Here is something that matters clinically, and that most people — including many clinicians — don't know: serum magnesium is a poor measure of magnesium status.

Only about 1% of the body's magnesium is in the blood. The other 99% is in bone (60%), muscle, and soft tissues. The body defends serum magnesium tightly — it will pull magnesium from bone and tissue to maintain normal blood levels. A "normal" serum magnesium result can coexist with significant intracellular depletion.

This is why standard blood tests so frequently miss magnesium deficiency. A GP runs a magnesium level, it comes back in range, and the conversation ends. But serum magnesium is the last thing to fall — by the time it's low, depletion is profound.

The more accurate assessment is RBC (red blood cell) magnesium, which measures intracellular magnesium content and gives a genuinely functional picture of tissue status. This is not routinely available on the NHS, but is accessible through specialist labs. I include it as part of comprehensive blood chemistry assessment in clinical practice.

Testing Note

The blood chemistry panels I use measure serum magnesium. While this is a useful baseline, it should be interpreted cautiously — a normal serum result does not rule out functional depletion. When sleep, anxiety, muscle cramps, or fatigue are part of the clinical picture, RBC magnesium provides substantially more information.

What adequate magnesium feels like

One of the most consistent pieces of feedback I hear from clients who address magnesium depletion is this: the quality of sleep changes before the quantity does. The transition from waking to sleeping becomes more fluid. Deep sleep feels deeper. Waking feels less effortful. The 3am awakening that has persisted for years often resolves.

This is not placebo. It is the NMDA block being restored. The GABA system being properly activated. The cortisol curve evening out.

Other effects clients reliably report: reduced muscle cramping and restless legs, less jaw tension, improved mood stability, reduced anxiety, more energy on the same amount of sleep.

Food sources of magnesium

The best dietary sources of magnesium are foods that the modern diet systematically underrepresents:

The practical challenge is getting enough from food alone when depletion is already established. Food is the foundation and the long-term strategy. Supplementation is often necessary as a bridging or corrective measure.

Supplement forms: not all magnesium is equal

Magnesium oxide — found in most cheap supplements and antacids — is poorly absorbed (roughly 4% bioavailability). For sleep and neurological function, the better-evidenced forms are:

For sleep, magnesium is usually taken as glycinate or threonate, 30–60 minutes before bed. Individual responses vary. Doses are set individually after testing, with your other medicines checked.

The broader picture

Magnesium is not the only biochemical driver of sleep dysfunction. The picture also includes cortisol dysregulation (from HPA axis stress patterns measured on the DUTCH test), progesterone and oestrogen balance (for women — progesterone is GABAergic; low progesterone correlates with disrupted sleep), thyroid function (subclinical hypothyroidism consistently affects sleep quality and depth), and blood sugar instability (nocturnal hypoglycaemia drives adrenaline release and 2–4am awakening).

What this means is that addressing sleep from a functional perspective is detective work. You're looking for the underlying biochemical driver — not papering over the symptom with advice that assumes the problem is discipline and habit.

The standard advice about sleep is not wrong. But it is incomplete. It's offered as if all poor sleepers are behaviourally identical. They're not. And the ones who don't respond to behavioural change — who have tried all the hygiene strategies and still can't sleep — deserve a better question than "are you really trying?"

The better question is: what is your body doing, and what does it need?

Clinical Observation

In nearly forty years of practice, I have never met a person with a serious sleep problem whose biochemistry was entirely normal. The symptom is always pointing somewhere. The job is to find out where — and that requires testing, not guessing.

Your next step

Free: the Health Pattern Finder, to see whether sleep is the system to look at first.

Paid: Quick Review, £45: a written answer to one question, such as “is magnesium the right thing for my sleep?”, within 3 working days, with anything you send me in front of me. One follow-up question within 14 days is included, and the fee comes off anything you book within 60 days.

Talk: new to Detective Health? The free 20-minute call. Already a client? Check in here.

I sell the Quick Review and the services above. The article’s grades apply to my advice too.

Your Sleep Has a Root Cause

The Five-Test Programme includes blood chemistry that covers magnesium status, cortisol, thyroid function, and inflammatory markers — the core biochemical drivers of sleep dysfunction. If you've tried the advice and it hasn't worked, this is where to look.

Explore the Programme →

References: Abbasi B et al. (2012) The effect of magnesium supplementation on primary insomnia in elderly: Journal of Research in Medical Sciences 17(12):1161–1169. · Boyle NB et al. (2017) The effects of magnesium supplementation on subjective anxiety and stress: Nutrients 9(5):429. · Wienecke E & Nolden C (2016) Long-term HRV analysis shows stress reduction by magnesium intake: MMW Fortschritte der Medizin. · Nielsen FH et al. (2010) Magnesium supplementation improves indicators of low magnesium status and inflammatory stress in adults older than 51: Magnesium Research 23(4):158–168. · Rondón LJ et al. (2011) Mechanisms of vascular protection by magnesium: Magnesium Research 24(1):S22–28.

As always, references should be independently verified. This content is educational and does not constitute medical advice. Individual supplementation should be discussed with a qualified practitioner who can assess your specific situation.

Series context: This is Part 4 of the "Everyone Is Told X" series — looking at common health advice and what's missing from it. Previous posts covered cholesterol, sun avoidance, and dietary protein.