Metformin and Leg Cramps, Causes and When to Worry

Medical Disclaimer

This article is for informational purposes only and does not constitute medical advice. Always consult your physician or a qualified healthcare provider regarding any medical condition or treatment.

Key Takeaways

  • Leg cramps are not listed as a common metformin side effect on the US label, but several metformin-related issues can contribute to them.
  • Diarrhea from metformin can cause dehydration and mineral loss, and long-term use can lower vitamin B12, which affects nerves.
  • Muscle pain or cramping with fast breathing, unusual sleepiness, weakness or stomach pain can signal lactic acidosis and needs emergency care.
  • Ordinary night cramps often have other causes, including dehydration, overuse, low minerals, kidney or thyroid problems and diabetic neuropathy.
  • Do not stop metformin on your own. Tell your doctor about frequent cramps and ask whether a vitamin B12 or electrolyte check makes sense.

Leg cramps are not listed as a common side effect of metformin in the US prescribing information. Still, metformin can contribute indirectly: its most common side effect, diarrhea, can leave you dehydrated and low on minerals, and long-term use can lower vitamin B12. Rarely, muscle pain or cramping is a warning sign of lactic acidosis, which is an emergency.

Get emergency care (call 911 or go to the ER) if muscle pain or cramping comes with any of these: fast, deep or shallow breathing, shortness of breath, unusual sleepiness or weakness, stomach pain, nausea or vomiting, dizziness, a slow or irregular heartbeat, or feeling cold in your hands and feet. On metformin, these can be signs of lactic acidosis.

What the Metformin Label Actually Says

In US prescribing information, diarrhea and nausea are among the most frequent side effects. The MedlinePlus metformin page also lists stomach discomfort, gas, indigestion, constipation, weakness, headache, a change in taste and muscle pain. Leg cramps as a distinct side effect do not appear, and published research on metformin causing cramps directly is very limited.

That does not mean your cramps are unrelated. It means the link, when there is one, usually runs through something else. Here are the main ways metformin can be involved:

Possible link How it could cause cramps What helps
Diarrhea and dehydration Loose stools drain water, sodium and potassium, and low fluid and minerals are a known cramp trigger Fluids, taking metformin with meals, asking about the extended-release form
Low vitamin B12 Long-term deficiency can damage nerves, causing numbness, tingling and leg discomfort A B12 blood test and treatment if levels are low
Lactic acidosis (rare) Lactic acid builds up and causes muscle pain along with breathing changes and sleepiness Emergency care right away
Low blood sugar with other drugs Metformin alone rarely causes lows, but adding insulin or a sulfonylurea can, and low blood sugar can cause shakiness and muscle weakness that is easy to confuse with cramps Check your glucose and review your medicines with your doctor

Diarrhea, Dehydration and Lost Minerals

Stomach upset is the side effect people notice most, especially in the first weeks or after a dose increase. According to MedlinePlus, common causes of muscle cramps include dehydration and low levels of minerals such as sodium, potassium or calcium. Ongoing diarrhea can cause both.

If your cramps started around the same time as loose stools, mention that link to your doctor. Taking metformin with meals, starting at a low dose and increasing slowly, and switching to an extended-release tablet are common ways to reduce stomach effects. Your prescriber decides which of these fits. Our guides to metformin diarrhea and electrolyte drinks and diabetes cover this in more detail.

Vitamin B12 and Your Nerves

Metformin can lower vitamin B12 over time. The label notes that B12 fell below normal in some people during clinical trials and recommends measuring it every two to three years. MedlinePlus lists long-term metformin use as a cause of B12 deficiency and explains that prolonged deficiency can cause numbness and tingling in the hands and feet from nerve damage.

B12 deficiency is not a classic cause of simple muscle cramps, but nerve symptoms in the legs can feel like cramping, burning or aching, especially at night. Because these symptoms overlap with diabetic neuropathy, a blood test is the only way to know. Learn what the vitamin B12 test involves and when to ask for one.

Lactic Acidosis: Rare but Serious

Metformin carries a boxed warning for lactic acidosis, a buildup of lactic acid in the blood. It is rare, but it can be fatal. The label describes early symptoms as vague: feeling unwell, muscle pain, breathing trouble, unusual sleepiness and stomach pain.

Risk is higher with:

  • Kidney problems (metformin should not be used when eGFR is below 30)
  • Age 65 or older
  • Heavy alcohol use or binge drinking
  • Liver problems
  • Surgery, or imaging tests that use iodinated contrast dye
  • Conditions that lower oxygen levels, such as a heart attack or sudden worsening of heart failure

A single cramp after a long walk is not lactic acidosis. The concern is muscle pain or cramping that comes with feeling very unwell, breathing changes or drowsiness. See our articles on metformin and alcohol and contrast dye and metformin for related precautions.

Other Common Causes of Leg Cramps

Many people on metformin also have diabetes or prediabetes, and leg cramps are common in that group for other reasons. According to MedlinePlus, causes of muscle cramps include:

  • Overuse or strain, often during or after exercise
  • Dehydration, including from high blood sugar that makes you urinate more
  • Low sodium, potassium or calcium
  • Alcohol use disorder
  • An underactive thyroid (hypothyroidism)
  • Kidney failure
  • Certain medicines
  • Pregnancy

Nerve damage from diabetes can also cause cramps, burning or aching in the legs and feet. Leg pain that comes on with walking and eases with rest is worth mentioning separately, because poor blood flow from peripheral artery disease is more common with diabetes. Read more in our guide to diabetes and leg cramps.

What You Can Do About Night Leg Cramps

For an ordinary cramp, MedlinePlus suggests:

  • Stop the activity and gently stretch and massage the muscle
  • Use heat when the spasm starts and ice once the pain eases
  • Drink fluids, and replace minerals if you have been sweating or had diarrhea
  • Stretch regularly and stay active within your ability

If you have kidney disease or take medicines that raise potassium, ask your care team before adding potassium-rich foods, salt substitutes or mineral supplements. The same applies to magnesium supplements. Our article on magnesium and blood sugar explains what the evidence does and does not show.

When to Talk to Your Doctor

Make an appointment if your cramps:

  • Are severe, frequent or keep coming back
  • Do not ease with stretching
  • Come with numbness, tingling or burning in your feet
  • Started after a new medicine or dose change
  • Come with ongoing diarrhea, swelling, leg color changes or pain with walking

Your doctor may check your kidney function, electrolytes, thyroid and vitamin B12, and review all your medicines. Do not stop or change your metformin dose without talking to your prescriber first. You can find more on medication options on our treatment hub.

The Bottom Line

Metformin is not known to cause leg cramps directly, and cramps are not listed as a common side effect. It can still play a part through diarrhea and dehydration or, over the long term, low vitamin B12. Most cramps have simple causes, but muscle pain with breathing changes, drowsiness or stomach pain needs emergency care because it can signal lactic acidosis. For ordinary cramps, stretch, stay hydrated and ask your doctor whether a B12 or electrolyte check is due.

Frequently Asked Questions

Is leg cramping a side effect of metformin?

Leg cramps are not listed as a common side effect in US metformin prescribing information. The label does list diarrhea, nausea and muscle pain, and it warns that long-term use can lower vitamin B12. Diarrhea can lead to dehydration and mineral loss, which are known causes of cramps, so metformin may play an indirect role for some people.

Can low vitamin B12 from metformin cause leg cramps?

Long-term metformin use can lower vitamin B12, and prolonged deficiency can damage nerves and cause numbness and tingling in the hands and feet. Nerve problems can make leg symptoms worse. The metformin label suggests checking B12 every two to three years. Ask your doctor whether a B12 test is due, especially if you also have tingling or fatigue.

When are muscle cramps on metformin an emergency?

Muscle pain or cramping becomes urgent when it comes with fast or shallow breathing, unusual sleepiness or weakness, stomach pain, vomiting, feeling cold, dizziness or a slow or uneven heartbeat. Together these can signal lactic acidosis, a rare but life-threatening side effect. Stop and get emergency care right away rather than waiting for a regular appointment.

Should I stop metformin if I get leg cramps?

No, not on your own. Most cramps have simple causes that can be managed, and stopping metformin can let your blood sugar rise. Tell your doctor how often the cramps happen and whether you have diarrhea, tingling or other symptoms. Your doctor can check your kidney function, minerals and B12 and adjust your treatment if needed.

Sources

  1. https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=1452fbb1-e591-4a51-9f83-8a8a6a780b52
  2. https://medlineplus.gov/druginfo/meds/a696005.html
  3. https://medlineplus.gov/ency/article/003193.htm
  4. https://medlineplus.gov/ency/article/000574.htm
  5. Dyatlova N, et al. Metformin-Associated Lactic Acidosis (MALA). StatPearls. https://pubmed.ncbi.nlm.nih.gov/35593810/