Vitamin D and Sleep: What the Evidence Says About the Link
Low vitamin D levels consistently appear in people with poor sleep quality and short sleep duration. Here's what the clinical data actually shows.

Poor Sleep and Low Vitamin D Often Go Together
Adults with vitamin D levels below 20 ng/mL (50 nmol/L) are significantly more likely to report sleeping fewer than six hours a night, waking frequently, or feeling unrefreshed in the morning. This association has now appeared across enough large cohort studies and randomized trials that it deserves a close look, not just a passing mention in a wellness article.
The relationship runs in both directions. Low vitamin D appears to impair sleep architecture. Poor sleep may also reduce the time people spend outdoors, compressing the window for UVB-driven synthesis. Understanding where the causal arrow points, and how strong the evidence really is, matters before anyone starts taking a supplement at bedtime expecting to sleep better.
What the Observational Data Shows
A 2018 cross-sectional analysis drawing on NHANES data found that short sleep duration (fewer than five hours) was associated with significantly lower 25-hydroxyvitamin D levels compared to seven-to-eight-hour sleepers. The study, published in Nutrients (2018), controlled for age, sex, ethnicity, body mass index, and season of blood draw, and the association held across all subgroups.
A separate analysis from the UK Biobank, involving over 300,000 participants, found that people in the lowest quarter of vitamin D status were more likely to report frequent night waking and daytime sleepiness. The biological plausibility is supported by the presence of vitamin D receptors in brain regions involved in sleep regulation, including the hypothalamus and brainstem nuclei that govern circadian timing. These receptors were described in detail in a review published in Sleep Medicine Reviews (2014).
A meta-analysis published in Nutrition Reviews (2022) pooled data from 13 observational studies and found that vitamin D deficiency was associated with a 59% higher odds of poor sleep quality as measured by the Pittsburgh Sleep Quality Index. The association was consistent across different populations and geographies, including North America, Europe, and the Middle East.
Vitamin D Receptors in Sleep-Regulating Brain Areas
The mechanism linking vitamin D to sleep is not simply speculative. Vitamin D receptors (VDRs) are expressed in the suprachiasmatic nucleus, the master circadian clock, as well as in regions that regulate melatonin production and adenosine signaling. Active vitamin D (1,25-dihydroxyvitamin D) is thought to modulate serotonin synthesis, which serves as a precursor to melatonin. When vitamin D is low, this upstream pathway may be constrained.
There is also a direct connection between vitamin D and slow-wave (deep) sleep. Cerebrospinal fluid levels of prostaglandin D2, a key sleep-promoting molecule, appear to be influenced by vitamin D status, according to preclinical research. While the clinical translation of this pathway in humans is still being worked out, the neural anatomy alone suggests that treating vitamin D as unrelated to sleep biology is a mistake.
What Randomized Trials Add
Observational data can show association, but it cannot establish that correcting low vitamin D improves sleep. For that, you need trials. The picture from randomized controlled trials is encouraging but not definitive.
A randomized, double-blind, placebo-controlled trial in 89 adults with sleep disorders gave participants 50,000 IU of vitamin D3 every two weeks for eight weeks. The supplementation group showed significant improvements in sleep quality, sleep onset latency, and sleep duration compared to the placebo group. Results were published in Nutritional Neuroscience (2017).
A smaller trial in night-shift workers (a group with both chronically disrupted sleep and reduced sun exposure) found that daily vitamin D3 supplementation over twelve weeks led to better subjective sleep quality scores and reduced daytime fatigue, reported in Sleep and Biological Rhythms (2018). That result makes practical sense: night-shift workers are often vitamin D deficient by default, since they sleep through peak UVB hours.
Not every trial has shown clear benefit. A secondary analysis of the large VITAL trial, which tested 2,000 IU/day of D3 in over 25,000 older adults, found no significant effect on self-reported sleep quality in participants who were not deficient at baseline. This is an important caveat: supplementation appears most likely to help when baseline levels are actually low, not as a general sleep aid for replete individuals.
Sleep Apnea and Vitamin D: A Specific High-Risk Group
One population where the vitamin D and sleep connection looks particularly strong is people with obstructive sleep apnea (OSA). Multiple studies have found that OSA severity, measured by the apnea-hypopnea index, correlates inversely with vitamin D levels. A meta-analysis published in Sleep Medicine (2018) found that vitamin D deficiency was significantly more prevalent in OSA patients than in controls, and that the deficiency was more pronounced in people with severe apnea.
The hypothesized mechanism here involves inflammation. OSA generates systemic oxidative stress and elevates inflammatory markers. Vitamin D is a regulator of both inflammatory cytokines and upper airway muscle tone, which may explain why chronically low levels worsen apnea severity. Whether supplementation meaningfully reduces apnea events is still under investigation, but the connection is consistent enough to flag vitamin D testing as clinically relevant for anyone with a confirmed OSA diagnosis.
Melatonin Timing and the Sunlight Angle
Vitamin D is not the only way that sun exposure connects to sleep. Morning sunlight suppresses melatonin, advances your circadian phase, and makes it more likely you fall asleep and wake at a consistent time. This is a separate biological pathway from vitamin D synthesis, driven by intrinsically photosensitive retinal ganglion cells responding to blue-wavelength visible light, not UVB.
If you want to understand the broader relationship between sunlight and your internal clock, our guide on how sunlight regulates your circadian biology covers the photoreceptor science and practical timing in detail. The key point here is that these two pathways, vitamin D synthesis and circadian light signaling, are both served by getting outside during the day, but they respond to different parts of the solar spectrum and require different conditions to activate.
How Much Vitamin D Is 'Enough' for Sleep Benefits?
The trials that showed positive sleep outcomes generally started from a baseline of frank deficiency, below 20 ng/mL. Reaching the sufficient range (30–60 ng/mL) appears to be where the sleep benefit emerges. There is no strong evidence that pushing levels above 60 ng/mL improves sleep further. The Rays target band of 40–60 ng/mL covers the range most consistently associated with better outcomes across multiple health endpoints.
For people who are deficient, the path to correction depends on factors like latitude, season, skin tone, and how much time is realistically available outdoors. During months when UVB is too low to drive meaningful synthesis, supplementation with vitamin D3 is the practical route. Our post on when winter sun stops working and supplements take over explains how to read latitude and season together to make that call.
Practical Factors That Affect Both Sleep and Vitamin D
Obesity and body fat distribution
Vitamin D is fat-soluble, so higher body fat mass sequesters circulating 25(OH)D, driving effective blood levels down. Obesity is also a strong independent risk factor for both sleep apnea and poor sleep quality. This creates a confound that makes it harder to isolate vitamin D's contribution in heavier populations, though the association with sleep remains after adjusting for BMI in most well-controlled analyses.
Age and skin synthesis capacity
Older adults synthesize vitamin D from UVB at roughly one-quarter the efficiency of young adults, and sleep architecture naturally shifts with age toward lighter, more fragmented sleep. Both trends accelerate after age 65. A 2019 analysis in Sleep Health (2019) found the vitamin D and sleep association was especially strong in adults over 60, suggesting that this population may benefit most from monitoring and maintaining adequate levels.
Timing of supplementation
One practical question that comes up often: does it matter when you take vitamin D, morning or evening? The evidence is limited, but a few small trials have suggested that taking vitamin D at night may interfere with melatonin onset in some people. The safer default is to take it with your largest meal of the day, typically lunch or dinner, since fat co-ingestion improves absorption. If you notice any subjective change in sleep after switching to an evening dose, shifting it earlier is a low-risk adjustment.
Testing Is the Starting Point
If sleep quality is a concern and you have not tested your vitamin D in the past six months, a 25(OH)D blood test is the most direct way to check whether deficiency could be contributing. The standard test, 25-hydroxyvitamin D, is widely available. Measuring 1,25-dihydroxyvitamin D is not appropriate for routine status assessment. For a full breakdown of when to test, what the numbers mean, and how to interpret your result in context, see our guide to vitamin D testing and what the numbers actually mean.
Testing twice a year, once at the end of summer when levels are typically highest, and once at the end of winter when they are typically lowest, gives you a reliable picture of your seasonal range and whether supplementation is filling the winter gap adequately.
Key Takeaways
Vitamin D deficiency is consistently associated with shorter sleep duration, poorer sleep quality, and higher rates of sleep apnea. The association holds across multiple large observational datasets and is biologically plausible given the distribution of vitamin D receptors in sleep-regulating brain regions.
Randomized trials show that correcting deficiency, particularly when baseline levels are below 20 ng/mL, can improve sleep quality scores and reduce sleep latency. Supplementation is unlikely to produce a meaningful sleep benefit in people who are already in the sufficient range (30–60 ng/mL).
Sunlight exposure addresses both the vitamin D pathway (via UVB) and the circadian timing pathway (via visible light), making daytime outdoor time one of the more efficient interventions available for someone whose sleep is poor and whose vitamin D is low simultaneously.
Older adults, people with obesity, night-shift workers, and those with diagnosed sleep apnea face compounding risks for both vitamin D deficiency and sleep disruption and are the most likely to benefit from active monitoring.
What to do next
If you are unsure how much sun exposure you actually need given your location, skin type, and the current season, you can estimate your daily sun window with the Rays calculator. For ongoing tracking without manual logging, Rays automatically detects your outdoor time and maps it against real UVB conditions so you can see whether your sun exposure is actually covering your vitamin D needs across the week, not just on paper.