What is the best time to take magnesium?
Take magnesium for sleep 30 to 60 minutes before bed. It calms your nervous system by raising GABA and easing cortisol, so an evening dose works with your body clock's natural wind-down. If you take it to correct a deficiency rather than for sleep, any consistent daily time with food is fine.
Magnesium is one of the few supplements where *when* you take it changes what it does for you. The same 200 to 400mg can settle you into sleep at night or simply top up a deficiency during the day, depending on the timing. Here is how to match the dose to your body clock.
Why timing matters for magnesium
Magnesium is calming. It boosts GABA, your brain's main quieting signal, helps lower nighttime cortisol, and relaxes muscles at the neuromuscular junction. All three of those effects point in one direction: down. That is exactly what you want as your body clock begins its evening wind-down, and the opposite of what you want first thing in the morning when cortisol is supposed to be rising to wake you up.
So the honest answer to "when should I take magnesium" is "it depends on why you are taking it." For sleep and relaxation, evening wins. For general health or correcting a deficiency, consistency matters more than the exact hour.
The best time for sleep: evening, before bed
If your goal is better sleep, take magnesium 30 to 60 minutes before you want to be asleep. That window gives it time to be absorbed and to start nudging your nervous system toward rest as melatonin rises.
- βStart: 200mg of magnesium glycinate, about an hour before bed
- βRange: 200 to 400mg of elemental magnesium in the evening
- βForm: glycinate or threonate are the most calming and best absorbed; oxide is poorly absorbed and better for constipation than sleep
Taking it earlier in the day for sleep purposes mostly wastes the calming effect, since it has worn off by bedtime.
What Andrew Huberman recommends
In his Sleep Toolkit, neuroscientist Andrew Huberman suggests about 145mg of magnesium threonate, 30 to 60 minutes before bed, ideally when you have not eaten for around three hours, paired with apigenin and L-theanine as a wind-down stack. One caveat he is careful to state: roughly 5% of people find magnesium threonate upsets their gut, and if that is you, stop taking it and check with your doctor. His timing lines up with the general rule here, an evening dose before sleep.
When to take it for other reasons
Not everyone takes magnesium to sleep. If you are correcting a known deficiency, easing muscle cramps, or supporting exercise recovery, the timing is more flexible:
- βDeficiency correction: any consistent daily time, ideally with a meal to reduce stomach upset. Splitting the dose (half morning, half evening) improves absorption and is gentler on digestion.
- βMuscle cramps or restless legs: evening still helps, since symptoms cluster at night.
- βPost-workout recovery: within a couple of hours of training is reasonable, but it is not time-critical the way sleep timing is.
Magnesium does not give you energy, so there is no benefit to a "morning magnesium" for alertness. If anything, a large morning dose can leave some people a little foggy.
How timing shifts by chronotype
Your chronotype changes *when* your wind-down naturally happens, so it changes when an evening dose lands best:
- βWolves (night types): your body wants to sleep later than your schedule allows. Take magnesium 60 to 90 minutes before your target bedtime to help bridge that gap.
- βDolphins (light, anxious sleepers): often benefit most, because their hyper-aroused nervous systems respond well to GABA support. An evening dose about an hour before bed is a good starting point.
- βBears (middle types): usually only need magnesium if they are actually low. If so, evening is fine.
- βLions (early types): your cortisol rises early, which can cut morning sleep short. A modest evening dose can help you hold sleep into the early hours.
What to take it with, and what to avoid
- βPairs well with: L-theanine and a low dose of melatonin (0.5 to 1mg). Magnesium helps your body use melatonin more efficiently, so the two work together.
- βAvoid at the same time: high-dose calcium and high-dose zinc, which compete with magnesium for absorption. If you take all three, separate them by a couple of hours.
- βWith food? With a meal is gentler on the stomach, but a small evening dose on an empty stomach is usually fine.
Food first
Before reaching for a pill, know that food timing matters too. Pumpkin seeds, spinach, almonds, black beans, and dark chocolate are all rich in magnesium. An evening meal or snack with these can quietly raise your intake without a supplement.
The bottom line
For sleep, take magnesium 30 to 60 minutes before bed, lean on glycinate or threonate, and let it ride the same downhill slope your body clock is already on. For everything else, pick a time you will actually remember and keep it consistent. Our free chronotype quiz builds the rest of your timing, so you know when to eat, move, and wind down, not just when to take magnesium.
Sources
Take the Free Chronotype Quiz
2 minutes β discover your Lion, Bear, Wolf, or Dolphin type
Start Free Quiz β