But did you know that there are over 10 different types of magnesium? Those variations come from adding different types of compounds (like salts and amino acids) added to magnesium, says Kristine Schonder, associate professor of pharmacy and therapeutics at the University of Pittsburgh.
The ones you’re most likely to come across in drug stores are magnesium glycinate, citrate, chloride, oxide, hydroxide, and sulfate (epsom salts), says Bradley Phillips, clinical assistant professor at the University of Florida College of Pharmacy.
So, which one should you be taking for your needs? Here’s what experts have to say.
There are a couple types of magnesium that can help with GI issues, Phillips says. Magnesium hydroxide (also known as milk of magnesia) is known to aid with indigestion, while magnesium citrate can help alleviate constipation, he explains. You may want to avoid magnesium oxide, which could lead to increased stomach discomfort and diarrhea, he adds.
Despite the many different forms that magnesium comes in, if you’re just looking for a general magnesium supplement, there isn’t one that’s better than the other, Schonder says. “A lot of them are probably more interchangeable than we might think,” she tells Fortune, so you’d be safe with choosing whichever one is available to you.
That being said, Phillips doesn’t think everyone needs to be reaching for a bottle to get their magnesium.
“If somebody is told they should get more magnesium, out of any supplement I would ever recommend, dietary sources are my number one recommendation,” Phillips tells Fortune.
The best sources of magnesium include: whole grains, legumes, bananas, avocados, nuts (especially almonds), soy products like edamame and tofu, and green leafy vegetables.
“Those are probably healthier ways to supplement magnesium,” Schonder says.
Schonder adds that not everyone who takes magnesium needs it. As always, talk to your doctor before starting any supplement—Schonder recommends getting a blood test to check your magnesium levels before you start supplementing.
She also emphasizes that just because certain forms of magnesium are helpful for specific goals, that doesn’t mean you should supplement with all of them, nor do you need to.
“If you’re replacing magnesium you don’t need one for your migraines, one for your sleep, one for your bones—one form of magnesium covers you for all of that,” she says.
If you take more magnesium than your body needs, you will likely just pee it out, Schonder says, but there are some people who should avoid it.
Anyone with heart problems, kidney disease, or decreased kidney function should avoid supplementing with magnesium, as this can overwhelm the body without the kidneys being able to filter it out, Schonder explains.
For those with kidney and heart problems, too much magnesium can cause a heart block, Schonder says, which means “heart tissue can’t conduct electrical impulses the way it should.”
Older adults may have decreased kidney function, which is why Schonder recommends expressing caution when supplementing. Antacids, for example, also contain magnesium, so you could be overdoing it on magnesium unknowingly if you take a supplement and antacid together.
Additionally, Phillips and Schonder warn that magnesium can interact with antibiotics and make them less effective, so it’s best to avoid taking them at the same time.
When choosing a magnesium supplement, experts urge finding one from a reputable brand to ensure its quality. “Just because magnesium is the largest name on the bottle, doesn’t mean magnesium is the only ingredient,” Phillips says. The magnesium supplements marketed for sleep, for example, could also contain melatonin, he says, which is why you should check the label closely.
“If you’re buying a supplement, make sure it’s FDA approved or USB approved,” Phillips says. If it’s on a shelf in a store, he says, that means it’s likely approved, versus online supplements that may not be.
For more on supplements: