Skip to main content
Drug Info

6 medication types that cause nighttime leg cramps

If you’ve ever woken up with muscle spasms, your medication might be to blame. Discover which common prescriptions could be triggering the pain
A man holding his leg | Medications that cause leg cramps at night

Key takeaways

  • Several types of medications have been linked to nocturnal leg cramps, including statins, diuretics, bronchodilators, antidepressants, antipsychotics, some oral contraceptives, and steroids.

  • If you believe your prescription is causing this side effect, consult your healthcare provider.

  • Do not stop taking any of your medications without medical advice. In many cases, small adjustments to your daily routine, dosage, or timing can help reduce symptoms. 

Leg cramps are sudden, painful muscle spasms that often strike the calf muscles, thighs, or even the feet, sometimes waking people up in the middle of the night. Also known as a Charley horse, these involuntary contractions can last for a few seconds to a few minutes in the affected muscle, and while they’re common, they’re also uncomfortable. In some cases, nighttime leg cramps may be triggered by certain medications, including statins, diuretics, and psychiatric medications. 

What causes leg cramps at night?

Leg cramps at night can jolt you awake, last up to a few minutes, and leave lingering soreness. They’re more common than you might think. Around 40% of older adults and 7% of children and teenagers aged 8 to 18 experience them.

There are several possible causes of nighttime leg cramps, including lifestyle factors, certain medications, and specific health conditions. Common risk factors include:

  • Pregnancy
  • Dehydration
  • Electrolyte imbalance
  • Muscle fatigue
  • Thyroid conditions
  • Kidney disease or kidney failure
  • Diabetic nerve damage
  • Mineral deficiencies, including magnesium, potassium (hypokalemia), and calcium
  • Chronic obstructive pulmonary disease (COPD)
  • Peripheral artery disease (vascular disease) 
  • Neurological disorders (like Parkinson’s disease or peripheral neuropathy)
  • Liver cirrhosis
  • Side effects of certain medications

Determining the cause of your muscle spasms is the first step in the treatment of nocturnal leg cramps.

Which medications cause leg cramps at night?

Several types of medications are known to cause or worsen leg cramps, particularly those that affect muscle function, electrolyte levels, or nerve signaling.

Statins

One of the most common causes of leg cramps are statins, a class of medications used to treat high cholesterol. Muscle pain and weakness are among the most common side effects of these drugs, affecting up to 10% of those taking them.

Statins “may affect muscle metabolism or energy production, leading to soreness or spasms,” says Annie DePasquale, MD, a board-certified family medicine physician and the founder of Collaborating Docs. It is not entirely understood why statins cause muscle cramping, but it’s more common in women than men. This could be due to their smaller size, longer life span, or other medical  conditions.

Diuretics

Diuretics cause electrolyte loss, which is associated with leg cramps,” says Jeffrey Chester, DO, medical director at The Ohana Addiction Treatment Center. Electrolytes are minerals with an electric charge that aid muscle contraction and nerve signals. If your prescription causes an electrolyte imbalance, it can disrupt the process of muscle relaxation, leading to uncomfortable tightness.

Bronchodilators 

Bronchodilators are medications used to treat lung conditions such as asthma and COPD. Some of these medications, such as albuterol, stimulate the nervous system. “Any medication that interferes with the nerves can cause leg cramps,” Dr. Chester notes. They can also affect potassium levels in your blood, an electrolyte that, when imbalanced, can cause leg cramps.

Psychiatric drugs 

A number of psychiatric treatments can cause nighttime leg cramping. “The most common medications are antipsychotic medications and depression medicines, such as SSRIs,” says Dr. Chester. These medications alter the levels of serotonin and dopamine in the body, which can lead to or exacerbate restless legs syndrome (RLS), a condition marked by discomfort in the legs, including aching, tingling, or burning sensations.  

Oral contraceptives

Certain birth control pills containing estrogen may cause hormonal changes that affect fluid retention and electrolyte balance, especially when you’re starting on a new contraceptive. Similar to diuretics, when the fluid balance is disrupted, it can impair how your muscles relax, causing unwanted contractions while you sleep.

Steroids

Corticosteroids, commonly used to treat conditions ranging from arthritis to asthma, can deplete potassium levels, an essential mineral for muscle function. Similar to bronchodilators, this can mean waking up clutching your calf in the middle of the night.

When to suspect your medication is causing cramps

“If cramps begin shortly after starting a new medication or worsen with dose changes, that’s a clue the drug may be involved,” Dr. DePasquale says. “Patients should also look for patterns such as cramps occurring at similar times each day or improving when a dose is skipped (though skipping doses is not recommended without medical advice).”

If you notice new muscle cramping after starting a new prescription, “it’s worth talking with your doctor or a pharmacist about it to determine if leg cramps are a side effect of the medication,” Dr. Chester agrees. 

You should never stop taking a prescribed medication without first consulting with your healthcare provider. However, the following strategies can help:

1. Document when cramps occur.

Leif Hands, DC, owner of Precise Chiropractic & Rehabilitation, recommends keeping a log of when you experience muscle cramps to determine the potential cause. “I frequently advise patients to monitor their cramps in terms of how soon after taking the medication they appear and how often they occur to determine a definite link.”

Take careful notes on the timing of your nocturnal leg cramps to help determine if your medication is causing the discomfort. If the timing of the most frequent incidence of your cramping lines up with when you take your medication, that will quickly become evident within a few days of keeping track of the onset and frequency of the cramping. If you end up meeting with your healthcare provider, these notes will prove very helpful, allowing them to guide you on the road to feeling better.

2. Review all medications and supplements

A healthcare professional can help you determine which of your medications, if any, could be to blame for nighttime leg cramps. Dr. DePasquale suggests asking if a dosage adjustment or alternative medication might be the solution to stopping nighttime leg cramps. 

3. Consider adjustments to your routine.

Sometimes, adding an electrolyte supplement or stretching routine is all that’s needed,” Dr. DePasquale says. That is why it’s important not to stop or change the dosing on your medications without first speaking to your healthcare provider. The fix may be a simple dietary or exercise adjustment that doesn’t involve stopping or changing your medications. 

Managing nighttime leg cramps

Whether your nocturnal leg cramps are caused by medication or not, it’s essential to manage this painful and disruptive symptom so you can get comfortable and restful sleep. These small changes can help prevent spasms after you go to bed:

  • Prioritize hydration. This includes drinking enough water and avoiding dehydrating drinks, such as alcohol and caffeine. In severe cases, an electrolyte drink such as Pedialyte may help.
  • Eat a balanced diet. Particularly, “maintain balanced levels of potassium, magnesium, and calcium through a nutritious diet,” Dr. DePasquale advises. A registered dietitian can provide personalized dietary recommendations.
  • Stretch before bed. “Even simple habits like ankle mobility work … have been enough at my practice to get many patients sleeping cramp-free again,” Dr. Hands says. 
  • Use a heating pad. The gentle warmth can help to relax stressed muscles.
  • Change your shoes. Supportive and stable footwear is important for the overall health of your leg muscles and bones.
  • Get evaluated by a provider. If cramps persist, an underlying condition could be causing the problem. “If the cramps are very severe, talk to your doctor or prescriber at once,” Dr. Chester advises. “This is also a good step if you have numbness or weakness along with the cramps.”

The bottom line

Medications that affect your nervous system and electrolyte or hormonal balance can cause physical discomfort. Statins, diuretics, antidepressants, antipsychotics, some oral contraceptives, and steroids are all known to cause nighttime leg cramps. If you experience recurrent leg cramps, consult your healthcare provider about your medical history. Adjustments to your routine can help alleviate the cramps and improve your quality of life. Never stop taking any medication without seeking medical advice from your prescribing provider.

Browse drugs A-Z: