Lots of people take B12 every morning and then add magnesium for sleep or leg cramps. The next worry is usually whether the two fight each other or have to be taken at different times. B12 from food needs stomach acid to shake it loose, and a stomach protein called intrinsic factor then carries it to the end of the small intestine. Magnesium takes a route of its own, so the two don’t compete; what can change your routine is the other medicines in your pill organizer.
Quick answer: Yes, you can take magnesium and B12 together. No interaction between them is known, they’re absorbed by different routes, and any time of day works. What matters more is the other pills you take. Long-term metformin can lower B12, and long-term use of omeprazole-type acid reducers can lower both, which is worth raising at your next visit.
In this article
Can you take magnesium and B12 together?
Yes, and there’s nothing to work around. The Linus Pauling Institute, a nutrition research center at Oregon State University, keeps detailed reference pages on both nutrients. Neither one lists the other among its interactions. Nobody has run a trial to prove the pair is harmless. But the reference lists come up empty, and that makes sense given how differently the two get absorbed.
You may have seen online that magnesium blocks B12, so the two should be taken hours apart. Neither reference backs that up. A B12 pill even has a backup way in: a small share of a high-dose tablet gets absorbed on its own, with no help from the stomach. As supplement pairs go, this one is about as low-drama as it gets, so both can go in the same morning slot.
Does it matter if you take magnesium at night and B12 in the morning?
It’s a little anticlimactic, but there’s no recommended best time of day for either one. B12 in the morning and magnesium at night is a habit, and a perfectly good one if it helps you remember both. The timing tips that do hold up are about your stomach: take magnesium with food, and split a bigger dose into two smaller ones. Magnesium is a laxative, after all, and loose stools are usually the first sign you’ve taken more than your gut can handle.
Labels list different forms, and they don’t all treat your stomach the same way. Citrate dissolves easily and may be more likely to loosen your stools than oxide, which dissolves poorly. Glycinate has a reputation as the gentle one, and that may be true, but there’s no head-to-head study showing it.
For adults, the upper limit for magnesium from supplements and medicines is 350 mg a day, unless a doctor has set a different dose. Magnesium from food doesn’t count toward it. If you have kidney disease, get your prescriber’s OK before starting magnesium at all, because reduced kidney function raises the risk of side effects.
Which other medicines can lower magnesium or B12?
If you take an acid reducer such as omeprazole, this part deserves more of your attention than the clock does. Plenty of people take one of these prescription drugs for years without a second thought. Yet the labels on these drugs warn about both nutrients. Low magnesium in the blood has been reported, rarely, in people taking them for at least 3 months, usually after a year or more. Daily use over several years can also, rarely, make B12 from food harder to absorb.
There’s good news on the B12 side: these drugs cut the acid that frees B12 from food, but supplement B12 doesn’t need it, so your pill isn’t wasted. Some water pills can also drain magnesium, including high doses of furosemide and certain blood pressure water pills. Your pharmacist can tell you whether yours is one. If you take a water pill or the heart medicine digoxin along with a long-term acid reducer, the label says your doctor may check your magnesium level.
With metformin, the B12 story is well documented. A large study followed adults at high risk for type 2 diabetes. After 5 years, about 1 in 5 people on metformin had low or borderline-low B12. In the group that got a placebo, it was about 1 in 10, and the longer people stayed on metformin, the higher their odds. Metformin users with low B12 also had more nerve damage, the kind that can show up as numbness or tingling in the feet. Whether metformin also lowers magnesium is still an open question; a recent review couldn’t pin it down.
Don’t stop anything over this; just bring it up the next time you see your doctor. Worth mentioning: how many years you’ve been on metformin, any tingling in your feet, and any omeprazole-type acid reducer or water pill you take. The American Diabetes Association advises checking B12 now and then in long-term metformin users, especially those with anemia or nerve symptoms. And if your doctor checks your magnesium, mention that you’ve started a supplement, since it changes what the number means.
Which pills need to be taken apart from magnesium?
B12 can stay where it is. Magnesium is the one that sometimes has to move. In the gut, it can latch onto certain medicines and keep part of each dose from being absorbed.
Levothyroxine (Synthroid and others) is the one that matters most for a morning routine. Its label says to take it on an empty stomach, 30 to 60 minutes before breakfast. It also calls for at least 4 hours between it and iron supplements, calcium supplements and antacids, and magnesium antacids are named among the ones that interfere. The label doesn’t name magnesium supplements. They carry the same mineral as those antacids, though, so giving them the same 4-hour gap is the cautious choice.
Antibiotics tend to turn up in the middle of a miserable week, which is exactly when a spacing rule is easy to miss. Magnesium cuts how much gets absorbed from ciprofloxacin (Cipro) and similar antibiotics, and from tetracyclines such as doxycycline. If you’re prescribed one of these, the pharmacist can tell you whether yours is on the list and how far apart to take it from your magnesium. The table has the hours for Cipro and for bone-strengthening pills like alendronate (Fosamax).
| Medicine | Why magnesium matters | How to space it |
|---|---|---|
| Levothyroxine | Minerals and antacids can lower how much is absorbed | At least 4 hours apart; the label names magnesium antacids |
| Ciprofloxacin and related antibiotics | Magnesium cuts how much of the antibiotic gets in | Cipro at least 2 hours before or 6 hours after magnesium |
| Tetracyclines like doxycycline | Magnesium cuts how much of the antibiotic gets in | Ask the pharmacist for the gap |
| Alendronate (Fosamax) and similar bone pills | Magnesium can lower how much is absorbed | About 2 hours apart |
| Vitamin B12 | No known interaction | No spacing needed |
If none of these pills is in your organizer, you can take magnesium and B12 together and leave your routine exactly as it is. If levothyroxine is, one easy setup works: the thyroid pill alone first thing, B12 whenever it’s convenient, and magnesium with lunch or dinner.
More Helpful Reads You Might Like:
- Magnesium Glycinate or Citrate? One Has Far Less Evidence
- Tingling in Your Hands and Feet? Where It Starts Matters Most
- The Supplements That Quietly Clash With Your Prescriptions
- Still Exhausted on Thyroid Medication? Here’s What Might Be Going On
Frequently Asked Questions
Can you take magnesium glycinate and B12 together?
Yes. Glycinate is simply one form of magnesium, and no form is known to get in B12’s way. If any magnesium you take upsets your stomach, taking it with a meal helps.
Should B12 be taken in the morning or at night?
Whenever works for you. Nothing ties B12 to a particular hour, and it doesn’t need to be kept apart from magnesium, so the best time is the one you’re least likely to forget, whether that’s with breakfast or at bedtime.
Can I take magnesium and a vitamin B complex together?
For the B12 in it, yes, since no interaction with magnesium is known. The bigger thing to check is whether your B complex or multivitamin also contains magnesium. Add up the magnesium from every product and stay at or under 350 mg a day unless your doctor set a different dose.
What medications should not be taken with magnesium?
The thyroid pill levothyroxine is the big one, and it needs at least 4 hours away from magnesium. The table above gives the gaps for Cipro and bone pills like alendronate, and your pharmacist can tell you how far apart to take doxycycline.
Does omeprazole affect B12 absorption?
It can, though the label calls it rare and it takes several years of daily use. B12 in food needs stomach acid to break free, and omeprazole cuts that acid. The B12 in a supplement doesn’t need it, so the pill still gets absorbed.
Medical Disclaimer: This content is for educational purposes only and does not replace professional medical advice, diagnosis, or treatment. Always consult your physician or a qualified healthcare provider with any questions about a medical condition.
Sources & Further Reading
How we sourced this article: we rely on peer-reviewed studies, clinical guidelines and public-health agencies (CDC, NIH, AHA, WHO), check every link before publishing, and update articles when the evidence changes. Read our editorial approach.
- FDA: Omeprazole delayed-release capsules prescribing information (Warnings 5.8 B12 deficiency, 5.9 Hypomagnesemia)
- FDA: CIPRO (ciprofloxacin) prescribing information, Dosage and Administration 2.4
- FDA: SYNTHROID (levothyroxine) prescribing information
- Aroda VR et al.: Long-term Metformin Use and Vitamin B12 Deficiency in the Diabetes Prevention Program Outcomes Study
- Costello R et al.: Perspective: Call for Re-evaluation of the Tolerable Upper Intake Level for Magnesium Supplementation in Adults
- Hypomagnesemia With Metformin Use in Diabetes Mellitus: A Case and Narrative Review
- Linus Pauling Institute Micronutrient Information Center: Magnesium
- Linus Pauling Institute Micronutrient Information Center: Vitamin B12
- AAFP: Diabetes: ADA Releases Revised Position Statement on Standards of Medical Care
- Cleveland Clinic: Vitamin B12 Deficiency




