What is the relationship between insomnia and vitamin deficiency, and how should patients with restricted diets or certain medical conditions be evaluated and treated?

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: January 22, 2026View editorial policy

Personalize

Help us tailor your experience

Which best describes you? Your choice helps us use language that's most understandable for you.

Insomnia and Vitamin Deficiency: Evaluation and Management

Direct Answer

While vitamin deficiencies (particularly vitamin D, B12, and folate) are associated with insomnia and poor treatment outcomes, they are not addressed in standard insomnia evaluation guidelines and should be assessed only in patients with restricted diets, malabsorption conditions, or refractory insomnia despite appropriate treatment. 1

When to Suspect and Evaluate Vitamin Deficiency

High-Risk Populations Requiring Screening

Patients with restricted diets warrant vitamin deficiency screening when presenting with insomnia, specifically:

  • Vegan or vegetarian diets without B12 supplementation or fortified foods 1
  • Religious dietary restrictions excluding meat, eggs, or dairy 1
  • Food allergies limiting intake of eggs, milk, or fish 1
  • Eating disorders with severely restricted intake 1
  • Low socioeconomic status limiting access to nutrient-rich foods 1
  • Elderly or frail patients with difficulty preparing or obtaining food 1

Medical Conditions Requiring Evaluation

Screen for vitamin deficiencies in patients with:

  • Malabsorption disorders: Celiac disease, atrophic gastritis, inflammatory bowel disease 1
  • Autoimmune conditions: Type 1 diabetes, thyroid disease, Sjögren syndrome 1
  • Post-bariatric surgery patients 1
  • Chronic medication use: Metformin, H2-blockers, proton pump inhibitors, colchicine, phenobarbital, pregabalin 1

Refractory Insomnia as an Indicator

Consider vitamin deficiency testing when insomnia fails to respond to standard treatment after 2 months of appropriate pharmacotherapy, as vitamin D deficiency independently predicts treatment non-response (odds ratio 11.6) 2

Specific Vitamin Deficiencies and Sleep Disorders

Vitamin D Deficiency

Vitamin D deficiency (<20 ng/mL) is significantly associated with:

  • Chronic insomnia: Patients have lower 25(OH)D levels (23.0 vs 27.2 ng/mL in controls, p<0.001) 2
  • Poor treatment outcomes: 11.6-fold increased risk of pharmacotherapy non-response at 2 months 2
  • Non-24-hour sleep-wake disorder: Case reports demonstrate resolution with vitamin D3 supplementation 3

Testing approach: Measure serum 25-hydroxyvitamin D in high-risk patients or those with treatment-refractory insomnia 2

Vitamin B12 Deficiency

B12 deficiency presents with excessive daytime sleepiness (EDS) rather than typical insomnia:

  • EDS is uncommon in chronic insomnia and should prompt evaluation for alternative sleep disorders including B12 deficiency 4, 5
  • Fatigue without true sleepiness is the expected consequence of insomnia 1, 4
  • True sleepiness (involuntary tendency to fall asleep) suggests B12 deficiency, sleep apnea, narcolepsy, or periodic limb movements 4, 5

Testing approach: Measure active B12 (holotranscobalamin) or total B12 when patients report excessive sleepiness rather than fatigue 1

Folate and Other B Vitamins

Insomniacs consume significantly less folic acid, B12, thiamine, and other nutrients compared to normal sleepers (p<0.002 for folate and B12) 6

Vitamin C intake (132-191 mg/day) reduces risk of sleep disorders (HR 0.78) and sleep apnea (HR 0.75), particularly in men and those ≤60 years 7

Clinical Evaluation Algorithm

Step 1: Standard Insomnia Assessment

Complete the comprehensive insomnia evaluation first 1:

  • Sleep history: bedtime, sleep latency, wake after sleep onset, total sleep time, sleep efficiency 1
  • Pre-sleep conditions and behaviors perpetuating insomnia 1
  • Daytime consequences: fatigue (not sleepiness), mood disturbances, cognitive difficulties 1
  • Medical, psychiatric, medication/substance history 1
  • 2-week sleep diary documenting patterns 1

Step 2: Identify Red Flags for Vitamin Deficiency

Screen for vitamin deficiency when:

  • Dietary risk factors are present (vegan, restricted diet, food insecurity) 1
  • Malabsorption conditions exist (celiac, gastritis, post-surgical) 1
  • High-risk medications are used (metformin, PPIs, H2-blockers) 1
  • Excessive daytime sleepiness predominates over fatigue 4, 5
  • Insomnia remains refractory after 2 months of appropriate treatment 2

Step 3: Laboratory Testing

Order targeted testing based on clinical suspicion:

  • Vitamin D: Serum 25-hydroxyvitamin D in all high-risk patients 2
  • Vitamin B12: Active B12 (holotranscobalamin) or total B12 if EDS present 1, 5
  • Folate: Serum folate in patients with restricted diets 6
  • Complete blood count: To detect macrocytosis or anemia 1

Step 4: Treatment Integration

Initiate standard insomnia treatment regardless of vitamin status 1, 8:

  • Cognitive Behavioral Therapy for Insomnia (CBT-I) as first-line treatment before any pharmacotherapy 1, 8
  • Pharmacotherapy only after or alongside CBT-I: short-acting BzRAs (zolpidem, eszopiclone, zaleplon) or ramelteon 8

Supplement vitamin deficiencies concurrently:

  • Vitamin D deficiency: Repletion improves treatment response 2, 3
  • Vitamin B12 deficiency: Supplementation resolves hypersomnia 5
  • Multiple deficiencies: Address all identified deficiencies simultaneously 3, 6

Critical Pitfalls to Avoid

Do not delay standard insomnia treatment while awaiting vitamin testing or repletion, as CBT-I and appropriate pharmacotherapy remain the foundation of management 1, 8

Do not attribute insomnia solely to vitamin deficiency without addressing behavioral, psychiatric, and medical comorbidities that perpetuate sleep disturbance 1

Do not screen all insomnia patients for vitamin deficiencies, as this is not supported by guidelines and is not cost-effective without specific risk factors 1

Distinguish fatigue from sleepiness: Fatigue is expected in insomnia, but true excessive daytime sleepiness suggests alternative diagnoses including B12 deficiency, sleep apnea, or narcolepsy requiring different evaluation 1, 4, 5

Recognize that vitamin deficiency testing is not routine in insomnia evaluation per AASM guidelines, but should be considered in specific high-risk populations or treatment-refractory cases 1, 2

References

Guideline

Guideline Directed Topic Overview

Dr.Oracle Medical Advisory Board & Editors, 2025

Guideline

Red Flags for Insomnia

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2025

Research

Vitamin B12 Deficiency: A Rare Cause of Excessive Daytime Sleepiness.

Journal of clinical sleep medicine : JCSM : official publication of the American Academy of Sleep Medicine, 2019

Guideline

Pharmacotherapy of Insomnia

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2026

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.

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.