Can Vitamin D Help You Sleep Better?

author avatar Dr. Eric Berg 08/31/2023

Low vitamin D levels are linked to poor-quality sleep and can worsen sleep problems, including sleep apnea.

It’s estimated that almost 40 percent of all U.S. adults are vitamin D deficient—unsurprisingly, many people struggle to fall asleep and suffer a range of sleep disturbances.

Discover how taking a vitamin D supplement can boost melatonin production and improve sleep.     

Woman taking vitamin D in bed

Why vitamin D deficiency affects sleep quality

Vitamin D, also known as the sunshine vitamin, is produced when sunlight hits the skin. However, several factors can significantly impact your body’s ability to produce vitamin D in response to sun exposure.

Here are some reasons that can impact vitamin D production and put you at risk of vitamin D deficiency:

  • Skin tone 

  • Geographical location and lack of adequate sun exposure 

  • Bodyweight (increased body fat lowers vitamin D levels)

  • Age

  • Gallbladder problems

  • Common drugs, including antibiotics and corticosteroids medications    

Vitamin D is an essential nutrient that regulates countless physiological processes, including bone health, calcium balance, and brain function. It’s also closely linked to mental health and plays a key role in normal immune system function.

Increasingly more evidence suggests that vitamin D plays a crucial role in sleep regulation and that vitamin D deficiency appears to significantly affect sleep quality and increase the risk of common sleep problems, including sleep apnea and insomnia.

Watch the video below to learn how vitamin D can help you to get restful and refreshing sleep. 

Four benefits of vitamin D for sleep 

Several studies investigating whether vitamin D status is linked to sleep efficiency reported that vitamin D supplements significantly improve sleep quality and duration.

Here are four reasons why vitamin D supplementation promotes restful sleep.

1. Supports melatonin production 

Vitamin D appears to promote the production of melatonin, a pineal sleep hormone that regulates the sleep-wake cycle and prepares your body for sleep.

Inadequate melatonin levels are linked with poorer sleep quality, inability to fall asleep, and disrupted sleep cycles.

2. Lowers inflammation  

Vitamin D has potent anti-inflammatory properties and is crucial for normal immune system function. 

Research suggests that sinusitis and pharyngitis—inflammation of the sinuses and throat—significantly impact sleep quality and may contribute to the development of sleep apnea. 

Because vitamin D lowers inflammation, it can reduce the severity of inflammatory conditions and improve inflammation-related sleep issues.

And, what’s more, vitamin D regulates immune function and can lower the risk of seasonal allergies that can trigger sinusitis and pharyngitis linked to disrupted sleep.

3. Balances stress hormones 

Vitamin D has been found to support healthy levels of the stress hormone cortisol. Cortisol is an adrenal hormone that regulates metabolic function, immune responses, and blood sugar balance. 

During prolonged periods of stress, cortisol rises, leading to muscle tension, high blood sugar, type 2 diabetes, and sleep issues.

Elevated cortisol directly impacts the parts of the brain that regulate sleep, interferes with melatonin production and sleep cycle regulation, and can worsen muscle tension-related teeth grinding. 

Research suggests that individuals with vitamin D deficiency are at risk of elevated cortisol levels and that vitamin D supplementation showed significant improvements in cortisol balance and sleep quality.

4. Supports deep-wave sleep 

Vitamin D supports the production of acetylcholine, a critical neurotransmitter that promotes brain function and healthy cognition.

Acetylcholine is also needed to reach slow-wave sleep, the deepest sleep phase of the sleep cycle. This type of sleep supports cellular regeneration, memory consolidation, energy restoration, and muscle reparation.

Low levels of vitamin D are linked to lower levels of acetylcholine and an increased risk of insomnia. Lack of adequate deep-wave sleep duration increases the risk of heart disease, cognitive decline, and Alzheimer's disease.   

Vitamin D capsules on heart-shaped plate

How to get restorative sleep with vitamin D

Healthy vitamin D levels support restful sleep. Unfortunately, many people don’t benefit from adequate sunlight exposure, and almost 40 percent of U.S. adults are vitamin D deficient. 

While there are some vitamin D-containing foods, including fatty fish, egg yolks, and fortified dairy products, these food sources typically contain only small amounts, and it’s unlikely that you will obtain enough vitamin D from dietary intake alone. 

Vitamin D supplementation is an excellent way to support healthy vitamin D blood levels. General recommendations suggest a daily intake of 600 IU of vitamin D. However, you may need significantly more vitamin D if you are deficient or have little to no sunlight exposure. 

Because of vitamin D’s beneficial effects on sleep regulation, taking vitamin D3 in combination with magnesium at night appears most effective in supporting healthy sleep. 

Magnesium enhances vitamin D absorption and augments vitamin D’s benefits for sleep by promoting relaxed muscles and a calm nervous system.

Woman sleeping

Can too much vitamin D affect your sleep?

While vitamin D generally supports healthy sleep, there is evidence that too much vitamin D can cause sleep disturbances in some sensitive individuals, especially if vitamin D is taken later in the day.

Although it’s not yet fully understood how, postmenopausal women and the elderly may be at an increased risk of sleep problems due to taking vitamin D at night or taking too much vitamin D.  

How much vitamin D you need depends on many factors, including your vitamin D blood levels, sunlight exposure, medication use, skin tone, and body weight. Regular blood tests help determine your vitamin D status and guide optimal supplementation dosage. 

Avoid taking vitamin D supplements made with vitamin D2. Not only is D2 a synthetic and less potent form of vitamin D, but some research also suggests that taking vitamin D2 can worsen insomnia and other sleep disturbances. 

Vitamin D supplementation on a spoonKey takeaways

Vitamin D impacts several aspects of sleep regulation, and vitamin D deficiency worsens sleep issues, including sleep apnea and insomnia.

Increasing vitamin D levels with dietary supplements is an effective and convenient way to support a healthy sleeping pattern. Taking vitamin D3 combined with magnesium at night appears most beneficial to promote deep and restful sleep.

Some individuals appear sensitive to taking vitamin D at night and experience worsening insomnia or other sleep-related issues. Adjusting the dosage and timing of vitamin D supplementation may be necessary to avoid unwanted sleep disruptions due to vitamin D.



1. Is there a connection between vitamin D and sleep quality?

Yes, there is evidence that vitamin D status and sleep quality are linked. Low vitamin D levels or vitamin D deficiency can cause sleep issues and may contribute to sleep apnea and insomnia. 

Vitamin D supports healthy sleep cycle regulation and lowers levels of cortisol linked to sleep disturbances and restless nights. 


2. Is vitamin D good before bed?

Yes, taking vitamin D3 in combination with magnesium at night has been shown to improve sleep quality and duration. Some individuals appear sensitive to taking vitamin D at night and experience disrupted sleep. Adjusting the timing of vitamin D supplementation will likely fix this issue.

3. Can vitamin D cause sleepless nights?

Yes, some people can experience sleep problems when taking vitamin D at night. Although it’s not fully understood how, in some individuals, vitamin D supplementation disrupts melatonin production and causes abnormal sleep cycle regulation. 

In addition, there is evidence that vitamin D2 is more likely to cause sleep issues than supplements containing vitamin D3. Vitamin D2 is a synthetic and less potent form of vitamin D that may interfere with healthy sleeping patterns.  

4. Why does vitamin D make me sleepy?

Research found that the pineal gland in the brain has vitamin D receptors and that vitamin D directly stimulates the production of melatonin, a sleep-regulating hormone that induces sleepiness and prepares the body for sleep. 

Vitamin D increases melatonin levels, explaining why taking vitamin D at night can make you sleepy. 


5. When should I take vitamin D, in the morning or at night?

Taking vitamin D at night has been found to promote healthy sleep. However, some individuals appear sensitive to vitamin D’s effects on melatonin production and experience worsening sleep issues. In this case, it’s best to take vitamin D in the morning to support healthy vitamin D levels without the risk of disturbed sleep.

Healthy Keto Guide for Beginner

FREE Keto Diet Plan