Summary The best time to take magnesium is any time you'll stick to every day, because no trial shows that morning or night changes how well it works. For sleep, the main trial of magnesium glycinate used a dose 30 to 60 minutes before bed (Schuster and colleagues, 2025). For constipation, laxative doses of magnesium citrate usually work within 30 minutes to 6 hours, so take them when you'll be near a bathroom. Taking magnesium with a meal makes stomach upset less likely, and splitting a larger dose helps because your gut absorbs a smaller share of a big dose. The timing rules that really matter involve medicines. Take tetracycline or quinolone antibiotics 2 hours before or 4 to 6 hours after magnesium. Keep magnesium 2 hours from osteoporosis drugs such as alendronate and 4 hours from levothyroxine.
A woman in her fifties in a yellow cardigan at a bright white kitchen table taking a magnesium capsule with a glass of water alongside her bowl of oatmeal and berries, a plain white bottle beside the bowl
Taking magnesium with a meal is the simplest way to avoid an upset stomach. For most goals, the time of day matters less than taking it at the same time every day.

You've decided to try magnesium, and now nobody agrees on when to take it. One article says morning for energy, another says bedtime for sleep, a third says always with food and a fourth says on an empty stomach. Then the bottle tells you something different again.

When every source contradicts the last, it's easy to worry that you're wasting the supplement, or to give up on it after a week because you can't tell whether you're doing it right. That's the pattern that sinks most good intentions: a plan too confusing to repeat.

Most of that conflicting advice is guesswork. Very few studies have tested magnesium timing directly, so this guide sticks to what the trials actually did and what the absorption research shows, then gives you a timing plan for each goal, the medicines that need a gap, and how long it takes to notice anything.

Is It Better to Take Magnesium in the Morning or at Night?

For most people, neither is better. We found no published trial that compares morning and evening doses of magnesium for absorption or for any health outcome. Magnesium is also absorbed slowly: in an isotope study by Schuette and colleagues (1994), labelled magnesium from glycinate peaked about 3 hours sooner than labelled magnesium from oxide, so absorption plays out over hours whichever form you take. Your body also holds about 25 grams of magnesium, half or more of it in bone, according to the NIH Office of Dietary Supplements. A daily dose tops up that store slowly, which is why consistency beats the clock.

There are three good reasons to pick one time over the other:

The Best Time to Take Magnesium for Each Goal

GoalWhen to take itWhat the evidence says
Sleep30 to 60 minutes before bedOne 4-week glycinate trial: a small improvement over placebo
ConstipationWhen you'll be near a bathroom for several hoursLaxative citrate usually works in 30 minutes to 6 hours; daily oxide helped chronic constipation over 4 weeks
Night crampsTiming won't helpA Cochrane review found no meaningful benefit for ordinary cramps
Training days and sorenessAny consistent time, not just before a workoutSoreness trials dosed once a day, morning, evening or at breakfast
Topping up a low intakeWith a meal, at the same time dailySmaller doses with food are absorbed more efficiently

When to take magnesium for sleep

Take it 30 to 60 minutes before bed. That's the timing used by Schuster and colleagues (2025), the largest trial of magnesium glycinate for sleep, in which 155 adults who slept poorly took 250 mg of magnesium or a placebo every evening for four weeks. Insomnia scores improved a little more with magnesium than with placebo. An earlier trial in older adults by Abbasi and colleagues (2012) split the dose into two tablets a day for eight weeks instead, so a single bedtime dose isn't the only option that has worked. Pairing it with a fixed wind-down routine also makes it much easier to remember.

When to take magnesium for constipation

This is the one goal where timing really matters, because the laxative forms work within hours. Over-the-counter magnesium citrate laxative solutions generally produce a bowel movement within 30 minutes to 6 hours, according to their labels, so take them in the morning on a day at home or early in the evening, not right before a commute, a workout or bed. For chronic constipation, daily magnesium oxide works well: in a trial by Morishita and colleagues (2021), 1.5 grams of magnesium oxide a day for four weeks relieved symptoms in 68% of patients, against 12% on placebo. That's well above the everyday supplement limit, so set the dose and timing with your doctor.

When to take magnesium for cramps

No timing will make magnesium prevent ordinary muscle cramps, because it doesn't do that at any time of day. The 2020 Cochrane review by Garrison and colleagues found magnesium is unlikely to give older adults meaningful protection from cramps. If you cramp at night or during exercise, our review of magnesium and muscle cramps explains what the trials found and what tends to help instead.

When to take magnesium on training days

Take it whenever fits your routine. A 2024 review by Tarsitano and colleagues suggested taking magnesium about 2 hours before training, but none of the four studies it reviewed tested that timing. In the soreness trial by Reno and colleagues (2022), participants took 350 mg of magnesium glycinate once a day, morning or night, and still reported less soreness after 10 days. In a study of professional cyclists in the same review, the daily dose came with breakfast. Daily intake over weeks, not a pre-workout dose, is what those studies have in common.

One practical rule: avoid taking a large dose of a laxative-prone form right before a run or a hard session, for the obvious reason. And if you also take creatine, our guide on the best time to take creatine shows that its timing matters very little too, so both can go wherever your routine is most reliable.

Training regularly will do far more for your recovery and sleep than any supplement schedule, and the hard part for most people is the regular bit. Our comparison of the best workout apps for beginners looks at which ones make it easiest to keep going. In FitCraft, a 3D AI coach demonstrates every exercise, motivates you by name and adapts your plan as you progress, while streaks and leaderboards give you a reason to show up again tomorrow. As one user, Katie, put it: "I've tried everything. This is the first time I've stuck with something past two weeks."

A young man in a lime-green t-shirt kneeling on an exercise mat in a sunny living room, drinking a glass of water after a home dumbbell workout, illustrating when to take magnesium on training days
Magnesium doesn't need to be timed around your workout. In the soreness studies, people took one daily dose in the morning, the evening or at breakfast.

Find out what's really holding you back

FitCraft, our mobile fitness app, pairs you with an AI coach who builds you a personalized plan around your goals, schedule, and fitness level. Every FitCraft program is designed by , MPH (Brown University) and NSCA-CSCS, with research published in the Journal of Strength and Conditioning Research and Medicine & Science in Sports & Exercise.

Take the Free Assessment Free • 2 minutes • No credit card

Should You Take Magnesium With or Without Food?

With food, for most people. An empty stomach doesn't improve absorption in any study we found, and food makes the common side effects (nausea, cramping and loose stools) less likely. In the classic absorption study by Fine and colleagues (1991), every dose of magnesium was given with a standard meal, and magnesium from almonds was absorbed just as well as a highly soluble magnesium salt. The same study found that enteric-coated magnesium chloride, a coating meant to protect the stomach, was absorbed much less well.

That applies to magnesium glycinate with food too. Glycinate is gentle enough that many people take it on an empty stomach at bedtime without trouble, but if it makes you queasy, move it to dinner. The one exception to "with food" is a laxative dose taken for quick relief, where the label's directions come first.

Should You Split Your Magnesium Dose?

If you take more than a small dose, splitting it is worth doing. Fine and colleagues found that the share of magnesium the gut absorbs falls as the dose rises: about 65% of the smallest intake was absorbed, against about 11% of the largest. The unabsorbed rest stays in the gut and pulls in water, which is what causes the loose stools.

So two smaller doses, for example half with breakfast and half with dinner, deliver more magnesium to your body and less to your bowels than one large dose. Abbasi's sleep trial gave its 500 mg as two 250 mg tablets a day. Whatever you split, keep the daily total from supplements at or under 350 mg unless a doctor sets a different dose. That limit counts the magnesium itself, not the weight of the compound, so check the magnesium line on the label.

What Not to Take With Magnesium

Medicines that need a gap

Magnesium binds to a few medicines in the gut and stops them working properly. These are the gaps the NIH Office of Dietary Supplements and the drug labels give:

MedicineGap from magnesiumEasy routine
Tetracycline antibiotics, such as doxycyclineAntibiotic at least 2 hours before or 4 to 6 hours afterPause magnesium for the course if the gap is hard to keep
Quinolone antibiotics, such as ciprofloxacin and levofloxacinAntibiotic at least 2 hours before or 4 to 6 hours afterSame as above
Bisphosphonates for osteoporosis, such as alendronateAt least 2 hours either sideMagnesium with dinner, the bone drug as its label directs in the morning
Levothyroxine for an underactive thyroid4 hours either sideThyroid pill on waking, magnesium in the evening

The levothyroxine gap comes from its prescribing information, which tells patients to keep iron and calcium supplements and antacids, including magnesium antacids, 4 hours away from their dose. Pharmacists usually apply the same gap to magnesium supplements. Two other drug groups affect magnesium rather than the other way round: proton pump inhibitors taken for more than about a year and loop or thiazide diuretics can lower your magnesium, so ask your doctor whether a blood test makes sense. If you take any other regular prescription, ask your pharmacist whether it needs a gap too.

Supplements: zinc, calcium, iron and vitamin D

The supplement warnings are mostly weaker than they sound:

Overhead view of a white table with two magnesium capsules in a lime-green dish beside toast and a glass of water on one side, and a separate dish of other pills with its own glass of water far away on the other side
Magnesium needs a gap of 2 to 6 hours from a few medicines, including some antibiotics, osteoporosis drugs and levothyroxine. Ordinary doses of zinc, calcium and vitamin D can be taken with it.

How Long Does Magnesium Take to Work?

It depends on what you're hoping it will do:

Early signs of low magnesium include loss of appetite, nausea, fatigue and weakness, and more serious deficiency can cause numbness, tingling, cramps and an abnormal heart rhythm. Deficiency that causes symptoms is uncommon in healthy people, because the kidneys hold on to magnesium when intake is low. If you have those symptoms, see a doctor rather than self-treating.

Which Form of Magnesium Should You Take?

The form matters more for your stomach than for timing. Glycinate and citrate are both well absorbed; glycinate is the gentlest, citrate can loosen stools at higher doses, and oxide is poorly absorbed and mainly useful as a laxative. Our guide to magnesium glycinate benefits compares the forms, grades the evidence for each benefit and covers the side effects in detail.

The Bottom Line

Take magnesium at the time you'll remember every day, with a meal if it upsets your stomach, and split anything more than a small dose. Use the evening before bed if sleep is your goal, plan laxative doses around being near a bathroom, and don't bother timing it around workouts or cramps. Keep at least 2 hours between magnesium and osteoporosis drugs, 2 to 6 hours between it and tetracycline or quinolone antibiotics, and 4 hours between it and levothyroxine. Then give it about four weeks before you judge whether it's doing anything for you.

Frequently Asked Questions

When should I take magnesium glycinate?

If you take magnesium glycinate for sleep, take it 30 to 60 minutes before bed, which is what the main 2025 sleep trial did. For any other reason, take it at a time you'll remember every day, with a meal if it upsets your stomach, and keep it a few hours away from antibiotics, osteoporosis drugs and thyroid medicine.

Is 500 mg of magnesium too much?

Yes, 500 mg a day of magnesium from supplements is too much to take on your own, because the upper limit for adults is 350 mg a day. Some trials have used 500 mg under medical supervision, and magnesium from food doesn't count toward the limit. Above 350 mg, diarrhea and stomach cramps become more likely.

Can you take vitamin D and magnesium together?

Yes. Magnesium and vitamin D can be taken together, and the enzymes that process vitamin D depend on magnesium. In a 2018 randomized trial of 180 adults, magnesium supplements raised vitamin D levels in people who started near 30 ng/mL and lowered them in people who started higher, which suggests magnesium helps regulate vitamin D rather than simply boosting it.

What vitamins should you not take with magnesium?

No common vitamin needs to be kept away from magnesium. Among minerals, only very high zinc doses of 142 mg a day, far above the 40 mg upper limit, have been shown to cut magnesium absorption, and normal calcium doses didn't change it in a controlled study. The gaps that matter are with medicines: certain antibiotics, osteoporosis drugs and levothyroxine.

Can children take magnesium?

Children can take magnesium, but at much lower doses than adults and ideally only on a pediatrician's advice. The upper limit for magnesium from supplements is 65 mg a day for ages 1 to 3, 110 mg for ages 4 to 8 and 350 mg from age 9. Most children get enough from food, and adult products can easily exceed a young child's limit.

Why do doctors not recommend magnesium?

Many doctors do recommend magnesium for specific reasons, such as a low blood level, long-term use of acid-reducing drugs or constipation. They're cautious about routine use because most people who eat well don't need it, the benefits for sleep and anxiety are modest, it interacts with several common medicines, and it can build up to dangerous levels in people with kidney disease.