Are vitamin D and vitamin B12 levels related to sleep?

Medical Advisory BoardAll articles are reviewed for accuracy by our Medical Advisory Board
Educational purpose only • Exercise caution as content is pending human review
Article Review Status
Submitted
Under Review
Approved

Last updated: June 23, 2026 • View editorial policy

Have a follow-up question?

Our Medical A.I. is used by practicing medical doctors at top research institutions around the world. Ask any follow up question and get world-class guideline-backed answers instantly.

Vitamin D and B12 Are Related to Sleep Quality and Variability

Yes, both vitamin D and vitamin B12 levels are associated with sleep disorders, though the evidence is stronger and more consistent for vitamin D than for B12. The relationship appears to involve sleep quality, sleep variability, and specific sleep disorders rather than just sleep duration alone.

Vitamin D and Sleep

The evidence demonstrates clear associations between vitamin D status and multiple sleep parameters:

Vitamin D deficiency is linked to poor sleep quality and increased sleep variability 1. Adults with insufficient vitamin D (<30 ng/mL) exhibit significantly greater sleep duration variability and sleep timing variability compared to those with sufficient levels. Specifically, vitamin D deficiency is inversely associated with sleep duration standard deviation (P < 0.001), meaning lower vitamin D correlates with more inconsistent sleep patterns 1.

Beyond variability, vitamin D deficiency associates with:

  • Increased sleepiness and daytime dysfunction 2
  • Sleep disorders in general, with protective effects when levels are adequate 3
  • Trouble falling or staying asleep when 25(OH)D levels are low 4
  • Oversleeping patterns (sleep duration in oversleepers) 4

The relationship appears causal based on Mendelian randomization studies, suggesting vitamin D status directly influences sleep rather than simply correlating with it 4. Vitamin D receptors are present in brain regions regulating sleep-wake cycles, and vitamin D influences neurotransmitter synthesis, which may explain these mechanistic links 5.

Vitamin B12 and Sleep

The evidence for B12 is more nuanced and less robust:

Vitamin B12 shows inverse associations with sleep duration 2, though the clinical significance remains unclear. More importantly, vitamin B12 deficiency anemia is causally linked to narcolepsy based on genetic studies 4.

In pediatric populations with inflammatory conditions, B12 levels below 200 pg/mL correlate with reduced sleep efficiency 3. However, B12 levels did not correlate with overall sleep quality scores in this population, and no significant associations were found between B12 levels and insomnia severity in older adults 6.

The guidelines note that B12 deficiency can manifest with neurologic and psychological symptoms 7, which could indirectly affect sleep, but direct sleep-related effects are less consistently demonstrated than with vitamin D.

Clinical Implications

When to Consider These Deficiencies:

Screen for vitamin D deficiency in patients presenting with:

  • Poor sleep quality or insomnia complaints
  • Excessive daytime sleepiness
  • Irregular sleep-wake patterns
  • Sleep disorders not responding to standard interventions

Screen for B12 deficiency when:

  • Narcolepsy symptoms are present
  • Neurologic or psychiatric symptoms accompany sleep complaints 7
  • Patient is elderly (>65 years), vegan, on metformin, or has malabsorption 7

Important Caveats:

  • The 2024 Endocrine Society guidelines suggest against routine 25(OH)D screening in the general population 8, recommending empiric supplementation instead for certain groups (ages 1-18, >75 years, pregnant women, high-risk prediabetes)
  • Vitamin D's effects on sleep appear more related to sleep quality and variability rather than total sleep duration 1
  • Correction of deficiencies may improve sleep, though not all studies show consistent benefits 5
  • B12 deficiency with low-normal levels can still cause symptoms; consider checking methylmalonic acid if clinical suspicion is high 7

Treatment Approach:

For vitamin D deficiency affecting sleep, standard repletion protocols apply (though specific sleep-related dosing hasn't been established). For B12 deficiency, oral crystalline cobalamin 1,000 μg daily is generally effective except in malabsorptive conditions or pernicious anemia requiring parenteral administration 7, 9.

The relationship between these vitamins and sleep represents an emerging area where nutritional status intersects with sleep medicine, warranting consideration in patients with unexplained sleep disturbances alongside other risk factors for deficiency.

References

Research

Do not sleep on vitamin D: vitamin D is associated with sleep variability in apparently healthy adults.

American journal of physiology. Regulatory, integrative and comparative physiology, 2025

Research

Vitamin D and Sleep Disorders.

Advances in experimental medicine and biology, 2026

Research

Relationship Between Nutritional Status and Insomnia Severity in Older Adults.

Journal of the American Medical Directors Association, 2019

Guideline

vitamin d for the prevention of disease: an endocrine society clinical practice guideline.

The Journal of clinical endocrinology and metabolism, 2024

Professional Medical Disclaimer

This information is intended for healthcare professionals. Any medical decision-making should rely on clinical judgment and independently verified information. The content provided herein does not replace professional discretion and should be considered supplementary to established clinical guidelines. Healthcare providers should verify all information against primary literature and current practice standards before application in patient care. Dr.Oracle assumes no liability for clinical decisions based on this content.