Magnesium is a mineral your body needs for muscle, nerve, and energy work
Magnesium is not a B vitamin—it is a mineral that works alongside vitamins to keep your body running. Your cells use it to produce energy, relax muscles after they contract, and send signals through your nervous system. About half of your magnesium sits in your bones; the rest moves through your blood and works inside cells.
You get magnesium from food: leafy greens, nuts, seeds, whole grains, and legumes are the richest sources. Most people in the United States get some magnesium from their diet, but many fall short of the daily amount their body needs. The recommended daily intake is 310 to 320 mg for adult women and 400 to 420 mg for adult men, depending on age.
A shortage of magnesium can show up as muscle cramps, fatigue, or trouble sleeping, though these symptoms have many other causes too. If you think your intake is low, tracking what you eat for a few days or talking to a doctor can help you figure out whether you need more.
Key Takeaways
- Magnesium helps your muscles relax, your nerves send signals, and your cells make energy—functions that happen constantly throughout the day.
- Leafy greens, nuts, seeds, whole grains, and legumes are the best food sources, and most people can meet their needs through diet alone.
- Muscle cramps, fatigue, and sleep trouble may point to low magnesium, but these symptoms have many causes and a doctor can help sort them out.
- Magnesium supplements come in different forms that your body absorbs at different rates, and some forms are gentler on your digestion than others.
- Taking more magnesium than your body needs does not provide extra benefit and can cause loose stools or other digestive side effects.
How magnesium works in muscle and nerve function
When you contract a muscle, magnesium helps your cells release calcium, which triggers the contraction. When you relax, magnesium helps move calcium back out so the muscle can loosen. Without enough magnesium, this cycle does not work smoothly—muscles may stay tense or cramp.
In your nervous system, magnesium acts as a natural brake. It blocks certain signals that would otherwise fire too easily, keeping your nerves calm. This is why low magnesium sometimes shows up as restlessness, anxiety, or trouble sleeping. It also plays a role in how your body handles stress hormones.
Athletes and people who exercise regularly sometimes lose magnesium through sweat, which is one reason muscle cramps and recovery trouble can follow hard workouts. Replacing magnesium through food or a supplement may help, though hydration and electrolytes matter too.
Food sources versus supplements: what works best
Getting magnesium from food is the first choice because your body absorbs it alongside other nutrients that help it work. A handful of almonds (about 100 calories) has roughly 80 mg. A cup of cooked spinach has about 160 mg. A quarter-cup of pumpkin seeds has about 180 mg. A cup of cooked black beans has about 120 mg. Building these into meals and snacks throughout the day is often enough to meet your needs.
Supplements make sense if you cannot eat enough magnesium-rich foods, if you have a condition that blocks absorption (like Crohn's disease or celiac disease), or if a doctor suspects a deficiency. Magnesium supplements come in several forms, and your body absorbs them differently:
- Magnesium glycinate is bound to the amino acid glycine and is gentle on your digestion. It is a good choice if you have a sensitive stomach.
- Magnesium malate is paired with malic acid and may help with muscle soreness, though evidence is limited.
- Magnesium citrate is well absorbed and has a mild laxative effect, which can help if constipation is a problem but may cause loose stools if you take too much.
- Magnesium oxide is cheap and widely available but is poorly absorbed and often causes loose stools.
- Magnesium threonate is designed to cross the blood-brain barrier and may support brain function, though research is still early.
If you choose a supplement, start with a lower dose (200 to 300 mg per day) and increase slowly. Taking it with food helps absorption and reduces stomach upset.
Signs you might need more magnesium
Muscle cramps, especially in the legs at night, are one of the most common signs people notice. Fatigue that does not improve with sleep, trouble falling asleep or staying asleep, and a feeling of restlessness can also point to low magnesium. Some people report tension headaches or jaw clenching.
The catch is that all of these symptoms have other causes—dehydration, stress, poor sleep habits, caffeine use, or other nutrient gaps can produce the same picture. A doctor can check your magnesium level with a blood test, though the test is not always reliable because most magnesium is stored in cells and bone, not in the blood.
If you suspect low magnesium, the simplest first step is to eat more magnesium-rich foods for two to three weeks and notice whether your symptoms improve. If they do not, or if you have ongoing health concerns, talking to a doctor or registered dietitian can help you figure out what is actually going on.
How much magnesium is safe to take
The recommended daily intake for adults is 310 to 420 mg, depending on age and sex. Most people do not need to go above this amount. Taking more does not provide extra energy, better sleep, or stronger muscles—your body straightforward excretes what it does not need.
The upper limit for magnesium from supplements is 350 mg per day for adults, set by the National Institutes of Health. Going above this regularly can cause loose stools, nausea, or stomach cramps. People with kidney disease should not take magnesium supplements without a doctor's approval, because their kidneys may not clear it properly.
If you are taking medications—especially antibiotics, bisphosphonates for bone health, or diuretics—magnesium supplements can interfere with how your body absorbs them. Take supplements at least two hours apart from medications, and mention any supplements you are considering to your doctor or pharmacist.
Magnesium and sleep: what the research shows
Magnesium is often marketed for sleep because it does help your nervous system relax. Some research suggests that people with low magnesium sleep worse than those with adequate levels, and that taking a supplement may improve sleep quality in people who are deficient.
The evidence is stronger for magnesium glycinate and magnesium threonate than for other forms. Most studies used doses between 200 and 400 mg taken in the evening. Results are modest—people typically report falling asleep a bit faster or sleeping a bit more deeply, not a dramatic change.
If sleep trouble is your main concern, magnesium may help, but it works best alongside other habits: a consistent bedtime, a cool dark room, and limiting screens an hour before bed. If you have chronic insomnia, a doctor can rule out sleep apnea, restless leg syndrome, or other conditions that need different treatment.
Magnesium for muscle recovery and athletic performance
Athletes lose magnesium through sweat, and some research suggests that replacing it may reduce muscle soreness and speed recovery. Magnesium also plays a role in how your muscles use oxygen and produce energy during exercise.
Studies show mixed results. Some find that magnesium supplements reduce muscle soreness after hard workouts, especially in people who were deficient to begin with. Others find no difference. The effect, if it exists, is usually small—better sleep, hydration, and nutrition matter more for recovery.
If you exercise regularly and eat a diet low in magnesium-rich foods, adding more through food or a modest supplement (200 to 300 mg per day) is reasonable. Do not expect it to replace the basics: adequate protein, carbohydrates, water, and rest.
Frequently Asked Questions
Can I take magnesium every day?
Yes, if you stay within the recommended daily intake of 310 to 420 mg for adults. Most people can take this amount daily without problems. If you are taking a supplement, start lower and increase gradually to see how your body responds.
What is the best time of day to take magnesium?
Evening is common because magnesium may help you relax, but you can take it any time. Taking it with food improves absorption and reduces stomach upset. If you are taking other medications, space magnesium supplements at least two hours apart.
Does magnesium interact with other supplements or medications?
Yes. Magnesium can interfere with antibiotics, bisphosphonates, and some other drugs if taken at the same time. Always mention supplements to your doctor or pharmacist, especially if you take regular medications or have a chronic health condition.
Can too much magnesium be harmful?
Excess magnesium from food is not a concern because your body excretes what it does not need. From supplements, taking more than 350 mg daily can cause loose stools, nausea, or stomach cramps. People with kidney disease should avoid magnesium supplements without medical approval.
Is magnesium glycinate better than other forms?
Magnesium glycinate is gentler on digestion and well absorbed, making it a good choice if you have a sensitive stomach. Other forms like citrate and malate work well too—the best one depends on your digestion, your budget, and what you are trying to address.