The best time to take magnesium depends on why you’re taking it. For sleep, take it at bedtime. For exercise performance, take it 30 minutes before a workout. For general health, splitting your dose across meals gives you better absorption than one large dose. There’s no single “best” time that applies to everyone, but a few principles can help you get the most out of your supplement.
For Sleep: Take It at Bedtime
If you’re taking magnesium to help with sleep, the simplest approach is a single dose right at bedtime. Mayo Clinic experts recommend 250 to 500 milligrams taken as one evening dose. Magnesium supports relaxation by helping regulate the brain’s calming signals, and taking it close to when you want to fall asleep aligns the supplement’s peak activity with the hours you need it most.
This timing also helps if you deal with nighttime leg cramps. In a clinical trial of 175 people, those who took magnesium at bedtime for 60 days experienced fewer nocturnal leg cramp episodes than those taking a placebo.
For Exercise: Before or After Your Workout
If you exercise regularly, the timing shifts depending on your goal. For performance, taking magnesium about 30 minutes before exercise may help your muscles access glucose more efficiently and reduce the buildup of lactate, the waste product that contributes to that burning fatigue feeling. Animal studies have demonstrated these effects clearly, though human research is still limited.
If muscle soreness is your bigger concern, taking magnesium after a workout may help with recovery, though the evidence for post-workout timing specifically is weaker. Either way, pairing your magnesium dose with your exercise routine gives it a clear purpose and makes it easier to remember.
Why Splitting Your Dose Works Better
Your body can only absorb so much magnesium at once. When you take a large amount in a single dose, your kidneys simply flush the excess. Absorption peaks about one to two hours after you take it, holds steady for a while, and by about 10 hours the magnesium is essentially gone from your system. That pattern means a single large supplement gives you a brief spike followed by many hours of nothing.
Spreading your intake across the day in smaller amounts, ideally with meals, keeps your levels more consistent and lets your intestines absorb a greater percentage of what you take in. If you’re aiming for general health rather than a specific benefit like sleep, dividing your dose between two or three meals is a more efficient strategy than taking everything at once. This is also one reason nutrition experts emphasize getting magnesium from food (nuts, leafy greens, whole grains, legumes) rather than relying entirely on supplements. Meals naturally spread your intake throughout the day.
With Food or Without?
This is where it gets slightly counterintuitive. Research on magnesium bioavailability shows that the net amount absorbed actually increases when you take it on an empty stomach. However, taking magnesium without food is also more likely to cause digestive side effects, particularly loose stools or stomach discomfort, especially at higher doses. Magnesium’s laxative effect is well known and dose-dependent.
For most people, taking magnesium with a meal is the practical choice. You absorb slightly less per dose, but you avoid the GI issues that make people quit their supplement altogether. If you tolerate it well on an empty stomach and prefer that approach, it’s fine.
Timing Around Other Supplements
Magnesium competes for absorption with several other minerals. If you also take calcium, zinc, or iron supplements, separate them from your magnesium by at least two to four hours. At standard dietary doses from food this isn’t a concern, but high-dose supplements taken together can interfere with each other’s absorption. A simple solution: take your magnesium at a different meal than your other mineral supplements.
Timing Around Medications
Certain medications interact with magnesium in ways that affect how well the drug works. Fluoroquinolone antibiotics, a common class prescribed for urinary tract and respiratory infections, should be taken at least two to three hours before any magnesium supplement. Magnesium can bind to these drugs in the gut and reduce their effectiveness. Bisphosphonates (used for osteoporosis) have a similar issue. If you take any prescription medication regularly, check whether magnesium needs a time buffer.
How Much You Need
The recommended daily amount varies by age and sex. Adult men need 400 to 420 milligrams per day, while adult women need 310 to 320 milligrams. During pregnancy, the recommendation rises to 350 to 360 milligrams. Most people fall short of these targets through diet alone, which is why magnesium is one of the more commonly supplemented minerals. But because your body absorbs it in limited amounts at a time, getting as much as possible from magnesium-rich foods throughout the day and using a supplement to fill the gap is more effective than relying on one large pill.

