What Vitamins Help With Sleep and Anxiety?

Several vitamins and minerals play direct roles in producing the brain chemicals that regulate sleep and anxiety. Magnesium, vitamin D, vitamin B6, and iron have the strongest evidence behind them, each working through a different mechanism. Getting the right levels of these nutrients won’t replace treatment for a clinical anxiety disorder, but correcting a deficiency can meaningfully improve both sleep quality and daytime calm.

Magnesium: The Most Studied Option

Magnesium is the single most researched nutrient for both sleep and anxiety, and it works through a mechanism surprisingly similar to prescription anti-anxiety medications. It activates the same calming brain receptors (called GABA-A receptors) that benzodiazepines target. In animal studies, blocking those receptors completely eliminated magnesium’s anxiety-reducing effect, confirming that this is its primary route of action rather than a vague “relaxation” benefit.

On the sleep side, a clinical trial using 500 mg of elemental magnesium daily for eight weeks found that participants fell asleep faster and slept longer. A separate study combining magnesium with B vitamins showed significant improvement in insomnia scores after three months, moving participants from moderate insomnia into the mild range. Evidence also suggests magnesium can begin reducing subjective anxiety in as little as two weeks in people who are anxiety-prone.

The forms that absorb best and cause the least digestive upset are magnesium glycinate and magnesium citrate. Glycinate is often preferred for sleep because glycine itself has mild calming properties. If you take diuretics or proton pump inhibitors (common acid reflux medications), these can drain magnesium from your body faster, making supplementation more important but also worth discussing with a pharmacist to get the timing right.

Vitamin D and the Serotonin-to-Melatonin Pipeline

Vitamin D does something specific that most people don’t realize: it activates the enzyme that converts tryptophan into the precursor for serotonin. Without enough vitamin D, your body produces less serotonin during the day, which means less raw material to convert into melatonin at night. So a deficiency can hit you twice, leaving you more anxious during waking hours and less able to fall asleep after dark.

About 24% of Americans have insufficient vitamin D levels (below 20 ng/mL in blood tests), and nearly 6% are outright deficient at below 12 ng/mL. A cross-sectional study of U.S. adults found a clear association between low serum vitamin D and higher anxiety scores. If you spend most of your time indoors, live at a northern latitude, or have darker skin, your risk of deficiency is higher. A simple blood test can tell you where you stand, and it’s one of the most straightforward deficiencies to correct with supplementation or sun exposure.

Vitamin B6 and GABA Production

Vitamin B6 is a required co-enzyme for converting glutamate, an excitatory brain chemical that revs up neural activity, into GABA, the inhibitory chemical that calms it down. It also helps produce serotonin, dopamine, and noradrenaline. A high-dose B6 supplementation study found that participants had measurably increased GABA-related brain activity, consistent with reduced neural excitation. In practical terms, that translates to feeling less “wired.”

B6 also has an interesting connection to sleep quality through dreaming. A randomized, placebo-controlled trial found that taking 240 mg of B6 before bed for five consecutive nights significantly increased how much dream content participants could recall the next morning. While dream recall isn’t the same as deeper sleep, the finding suggests B6 influences brain activity during REM stages. Most people get adequate B6 from food (poultry, fish, potatoes, bananas, chickpeas), but those on restricted diets or certain medications may fall short.

Iron’s Role in Restless Sleep

Iron doesn’t get as much attention in the sleep conversation, but it plays a critical behind-the-scenes role. It’s essential for synthesizing dopamine, serotonin, and other neurotransmitters involved in the sleep-wake cycle. When iron stores in the brain drop, even without full-blown anemia showing up on a standard blood test, sleep problems follow.

Non-anemic iron deficiency is strongly linked to restless leg syndrome, periodic limb movements during sleep, and a general pattern of restless, fragmented sleep. In a study of patients with neurodevelopmental and mental health conditions, 41% had anxiety disorders, and iron deficiency plus a family history of iron deficiency significantly increased the odds of insomnia and restless sleep behaviors. For people with autism spectrum disorder specifically, a family history of iron deficiency nearly quintupled the odds of insomnia.

If you experience leg restlessness at night, frequent waking, or unrefreshing sleep alongside anxiety, checking your ferritin level (a measure of stored iron) is worth doing. Standard blood counts can look normal even when iron stores are low enough to disrupt sleep.

Antioxidant Vitamins C and E

Oxidative stress, essentially an imbalance between damaging molecules and your body’s ability to neutralize them, appears to be elevated in people with generalized anxiety disorder. A clinical study of adults with anxiety and depression found that six weeks of antioxidant supplementation with vitamins A, C, and E alongside standard treatment produced a statistically significant reduction in anxiety scores compared to medication alone. The effect was described as “adjuvant,” meaning the antioxidants boosted the benefit of existing treatment rather than working as a standalone fix.

This doesn’t mean megadosing vitamin C will cure anxiety. But it does suggest that chronic oxidative stress may be one contributing factor in anxiety, and that ensuring adequate antioxidant intake supports the effectiveness of other interventions.

How Long Before You Notice a Difference

One of the most common frustrations with supplementation is expecting overnight results. The timeline depends on the nutrient and the severity of your deficiency. Magnesium tends to work fastest. Some people notice reduced anxiety within two weeks, while sleep improvements typically take six to eight weeks to become consistent. A combination of magnesium, B vitamins, and melatonin took about three months to move insomnia scores from moderate to mild in one clinical trial.

Vitamin D operates on a slower curve because your body needs time to rebuild stores and ramp up serotonin production. Most studies showing mood and sleep benefits used supplementation periods of two to three months. Iron repletion is similarly gradual; ferritin levels can take three to six months to normalize depending on how depleted you are.

The practical takeaway: give any new supplement at least eight weeks before deciding it isn’t working, and prioritize consistency over dose size.

What to Check First

Rather than buying a stack of supplements based on general advice, the most efficient approach is to test for the deficiencies most likely to affect your sleep and anxiety. A basic panel measuring serum vitamin D, ferritin, and magnesium (ideally RBC magnesium rather than the standard serum test, which is less sensitive) can reveal whether a specific gap is driving your symptoms. B6 and B12 can also be tested but are less commonly deficient in people eating a varied diet.

If testing isn’t accessible, magnesium is the lowest-risk starting point. Most adults don’t get enough from food alone, side effects at reasonable doses are minimal (loose stools are the main one), and it addresses both sleep and anxiety through the same GABA pathway. Adding vitamin D during fall and winter months is a reasonable second step for anyone living above the 37th parallel, roughly the latitude of San Francisco or Richmond, Virginia, where winter sun exposure is insufficient for adequate production.