Which Vitamin Deficiency Affects Sleep? What to Test First

A woman in a white T-shirt and jeans stands in a bright hallway with her hands in her pockets and a plaster on her inner arm, beside a navy front door and a yellow raincoat on a hook.

Iron is the deficiency with the clearest link to sleep, through restless legs; low vitamin D goes with poorer sleep in observational studies, and vitamin D supplements improved a sleep quality score in three pooled trials; magnesium has one small, low-certainty result in older adults with insomnia. No vitamin or mineral deficiency has been shown to cause insomnia, so the first step is a blood test, and any supplement follows the result. The NHS list of insomnia causes names stress, noise, caffeine, alcohol, shift work, restless legs syndrome, an overactive thyroid and the menopause; no nutrient is on it.1 This page sits within the Wellgard sleep guide.

Can a vitamin or mineral deficiency cause poor sleep?

A few can, by different routes. Iron deficiency is a recognised cause of restless legs, which keeps people awake directly. Vitamin D and magnesium are linked to sleep by association studies and small trials, and the association studies cannot say which came first. Vitamin B12 and folate deficiency cause tiredness by day, which is not poor sleep at night, and neither has been tested for insomnia. "Deficiency" means a blood result below a threshold, not a symptom list: tiredness, low mood and night waking belong to every deficiency here and to insomnia itself. The NICE Clinical Knowledge Summary on insomnia (June 2026) asks the GP to take a history, screen for depression and anxiety, and investigate "where a comorbid condition (such as hyperthyroidism, respiratory or cardiovascular disease) or another sleep disorder is suspected"; vitamin levels are checked when symptoms point to them.2

Is iron the deficiency that matters most for sleep?

Yes, because of restless legs. The NHS describes restless legs syndrome as "a strong urge to move your legs, usually when resting at night", "thought to be linked to the levels of iron and the brain chemical dopamine in your body" and linked to pregnancy, iron deficiency anaemia, kidney disease and some medicines; "you may need iron supplements if you have low levels of iron in your blood", and the advice is to see a GP if it is stopping you sleeping.3 The NHS lists restless legs syndrome among the less common symptoms of iron deficiency anaemia, after tiredness, shortness of breath, noticeable heartbeats, paler skin and headaches; heavy periods and pregnancy are "very common causes", and the test is a full blood count.4

NICE's restless legs summary (revised July 2026) sets the bar above anaemia: serum ferritin is the first investigation it lists, and "For people with a serum ferritin of 75 ng/mL or less or a transferrin saturation less than 45%, supplementation of iron is recommended" (75 ng/mL is 75 micrograms per litre).5 A ferritin that is "normal" for anaemia can still be low for restless legs, so ask for the number. A Cochrane review of 10 trials in 428 adults found iron improved restless legs severity against placebo, by 3.78 points on a 40-point scale across the seven trials that used it (95% CI 1.31 to 6.25), moderate certainty; subjective sleep quality in three of the trials was not significantly different.6 Iron tablets follow a test: heavy periods and iron and iron supplement side effects.

Does low vitamin D affect sleep?

People low in vitamin D sleep worse on average, and three pooled supplement trials improved a sleep quality score. Across nine observational studies of 9,397 people, vitamin D deficiency went with 1.50 times the odds of a sleep disorder (95% CI 1.31 to 1.72); six were cross-sectional, so they cannot say which came first.7 A 2022 review pooled three randomised trials: the Pittsburgh Sleep Quality Index was 2.33 points lower with vitamin D than placebo (95% CI 1.57 to 3.09), moderate certainty, while results for sleep disorders, sleepiness and restless legs "were not unanimous".8 The NHS says everyone should consider 10 micrograms (400 IU) a day in autumn and winter, at-risk groups all year, and "Do not take more than 100 micrograms (4,000 IU) of vitamin D a day as it could be harmful".9 Vitamin D's authorised wording in Great Britain covers bones, teeth, muscle function, the immune system and calcium absorption, not sleep. Signs of vitamin D deficiency has the symptoms and the blood thresholds.

Does low magnesium affect sleep?

The trials are small and in older adults with insomnia. A 2021 meta-analysis of three randomised trials in 151 older adults found sleep onset 17.36 minutes faster than placebo (95% CI 7.44 to 27.27); total sleep time was 16.06 minutes longer but not significant, and the evidence was graded low to very low quality.10 Whether you are low is a blood test, not a feeling. The NHS says "having 400mg or less a day of magnesium from supplements is unlikely to cause any harm" and that more than 400 mg for a short time can cause diarrhoea.11 Magnesium's authorised wording is that it contributes to a reduction of tiredness and fatigue, to normal psychological function, to normal functioning of the nervous system and to normal muscle function; no nutrient has sleep wording. The signs of low magnesium lists the signs; does magnesium help you sleep covers forms and timing.

Can vitamin B12 or folate deficiency make you sleep badly?

No trial has tested either for insomnia, and neither is on the NHS causes list. The link people feel is daytime: the NHS symptoms of vitamin B12 or folate deficiency are "extreme tiredness, a lack of energy, pins and needles, a sore and red tongue, mouth ulcers, muscle weakness, problems with your vision, psychological problems, which can range from mild depression or anxiety to confusion and dementia", some of which occur without anaemia.12 Tiredness no night's sleep fixes is the reason to ask for the test, since "some problems caused by the condition can be irreversible"; the tests check haemoglobin, red cell size, and the B12 and folate levels.13 Both nutrients carry the authorised wording "contributes to the reduction of tiredness and fatigue" and "to normal psychological function". Signs of vitamin B12 deficiency has the full picture and what "low normal" means.

What about vitamin B6, zinc and B vitamins taken at night?

Vitamin B6 is a dream question. In 100 Australian adults, 240 mg before bed for five nights increased dream recall, with no significant effect on any sleep variable; the trial's B-complex arm reported significantly lower self-rated sleep quality and more tiredness on waking than placebo.14 That 240 mg is 24 times the NHS supplement guidance, "Do not take more than 10mg of vitamin B6 a day in supplements unless advised to by a doctor", set because 200 mg or more a day can cause peripheral neuropathy.15 The B-complex result is the only direct evidence on timing; it points to the morning.

Zinc has eight randomised trials of 10 to 73.3 mg a day for 4 to 48 weeks: most found better sleep quality in adults, none an effect on sleep disorders, and the reviewers found "no consensus".16 The NHS ceiling is "Do not take more than 25mg of zinc supplements a day unless advised to by a doctor".11 Pantothenic acid has no sleep trial; 200 mg or less a day in supplements "is unlikely to cause any harm".15 Neither has sleep wording: pantothenic acid's authorised claims cover mental performance and tiredness, zinc's cognitive and immune function.

Which blood tests should I ask for?

Match the test to the symptom, and ask for the number.

Nutrient What is tested Symptoms that justify asking
Iron Full blood count; ferritin, read against the 75 micrograms/L restless legs threshold4, 5 Restless legs, heavy periods, pregnancy, tiredness, breathlessness
Vitamin D Vitamin D blood level (thresholds on the deficiency page) Bone pain, muscle weakness, little sun on the skin
Vitamin B12 and folate Haemoglobin, red cell size, B12 and folate levels12, 13 Pins and needles, sore red tongue, memory problems, vegan diet, age 65 plus
Thyroid Thyroid function; on the NHS and NICE insomnia lists1, 2 Feeling hot, weight loss, racing heart
Magnesium Serum magnesium Cramps, twitching, irregular heartbeat

Months of poor sleep is a reason to go: when to see a GP about sleep has the NHS thresholds and red flags; which sleep supplements have evidence behind them grades the ingredients.

Frequently asked questions

What vitamin deficiency causes you to wake up at 3am?

None is established: the magnesium trials measured time to fall asleep, the vitamin D trials an overall quality score, the iron trials restless legs severity. Why do I wake up at 3am covers the documented causes; restless legs make ferritin the test to ask for.5

Which vitamin deficiency causes night sweats?

None on the NHS list, which gives the most common causes as menopause symptoms (perimenopause sleep problems), anxiety, some medicines, low blood sugar, alcohol or drug use, and hyperhidrosis. See a GP if you regularly wake with soaking wet sheets.17

What vitamin are you lacking if you have restless legs?

Iron, according to the NHS and NICE, with a serum ferritin of 75 micrograms/L or less the level at which NICE recommends iron.3, 5 Vitamin D's effect on restless legs was "not unanimous" across the trials, and neither the NHS page nor the NICE summary mentions magnesium.3, 5, 8

Which vitamin is best for deep sleep?

None has authorised sleep wording in Great Britain, and none of these trials measured deep sleep. The iron trials were in people with restless legs and the magnesium trials in older adults with insomnia; a blood test tells you whether a deficiency applies.8, 10, 16

Sources

  1. NHS. Insomnia. nhs.uk/conditions/insomnia.
  2. NICE Clinical Knowledge Summaries. Insomnia: assessment, revised June 2026. cks.nice.org.uk/topics/insomnia/diagnosis/assessment.
  3. NHS. Restless legs syndrome. nhs.uk/conditions/restless-legs-syndrome.
  4. NHS. Iron deficiency anaemia. nhs.uk/conditions/iron-deficiency-anaemia.
  5. NICE Clinical Knowledge Summaries. Restless legs syndrome: summary, revised July 2026. cks.nice.org.uk/topics/restless-legs-syndrome.
  6. Trotti LM, Becker LA. Iron for the treatment of restless legs syndrome. Cochrane Database of Systematic Reviews, 2019. PubMed 30609006.
  7. Gao Q, Kou T, Zhuang B, et al. The association between vitamin D deficiency and sleep disorders: a systematic review and meta-analysis. Nutrients, 2018. PubMed 30275418.
  8. Abboud M. Vitamin D supplementation and sleep: a systematic review and meta-analysis of intervention studies. Nutrients, 2022. PubMed 35268051.
  9. NHS. Vitamin D. nhs.uk/conditions/vitamins-and-minerals/vitamin-d.
  10. Mah J, Pitre T. Oral magnesium supplementation for insomnia in older adults: a systematic review and meta-analysis. BMC Complementary Medicine and Therapies, 2021. PubMed 33865376.
  11. NHS. Vitamins and minerals: others. nhs.uk/conditions/vitamins-and-minerals/others.
  12. NHS. Vitamin B12 or folate deficiency anaemia. nhs.uk/conditions/vitamin-b12-or-folate-deficiency-anaemia.
  13. NHS. Vitamin B12 or folate deficiency anaemia: diagnosis. nhs.uk/conditions/vitamin-b12-or-folate-deficiency-anaemia/diagnosis.
  14. Adventure-Heart DJ, Madden NA, Delfabbro P. Effects of vitamin B6 (pyridoxine) and a B complex preparation on dreaming and sleep. Perceptual and Motor Skills, 2018. PubMed 29665762.
  15. NHS. B vitamins and folic acid. nhs.uk/conditions/vitamins-and-minerals/vitamin-b.
  16. Jazinaki MS, Gheflati A, Moghadam MRSF, et al. Effects of zinc supplementation on sleep quality in humans: a systematic review of randomized controlled trials. Health Science Reports, 2024. PubMed 39377022.
  17. NHS. Night sweats. nhs.uk/conditions/night-sweats.