Some medicines have been associated with muscle cramps in certain people.
If your cramps started shortly after beginning a new medication or changing a dose, mention this to your healthcare professional.
Do **not** stop a prescribed medicine on your own because of cramps. Your clinician can review possible side effects, interactions, and other causes.
## 5. An Underlying Medical Condition Can Sometimes Be Involved
Frequent leg cramps can occasionally occur alongside conditions affecting nerves, circulation, metabolism, or muscles.
Possible associations can include:
* Peripheral artery disease
* Diabetes
* Thyroid disorders
* Kidney disease
* Nerve compression
* Certain neurological or muscular problems
The presence of cramps does **not** mean you have one of these conditions. Leg cramps are common and usually have a much simpler explanation.
What matters is whether the cramps are persistent, worsening, or accompanied by other unusual symptoms.
## What To Do When a Cramp Strikes
When a calf suddenly tightens, gently stretching the affected muscle is often one of the simplest ways to relieve it.
For a calf cramp, try:
1. Straightening the affected leg.
2. Pulling your toes gently toward your shin.
3. Holding the stretch without bouncing.
4. Walking slowly once the muscle begins to relax.
Gentle massage may also help.
Some people find warmth soothing after a cramp, such as a warm shower or heating pad.
Avoid aggressive stretching or forceful massage if the leg is swollen, red, unusually warm, or extremely painful.
## Can Stretching Before Bed Help?
It may.
Gentle calf and hamstring stretching before bedtime is a low-risk strategy commonly recommended for people with recurring nighttime cramps. The source article also identifies regular stretching as one of the practical approaches that may help reduce episodes.
A simple calf stretch can be done by standing facing a wall, placing one foot behind you, keeping the heel on the floor, and leaning forward gently.
Hold for about 20–30 seconds and repeat on the other side.
## Should You Take Magnesium?
Magnesium is frequently promoted online as an instant cure for nighttime leg cramps, but the evidence does not support treating every case this way.
Some people can genuinely have low magnesium levels because of medical conditions, medications, digestive disorders, or inadequate intake. But ordinary nighttime cramps do not prove magnesium deficiency.
Taking magnesium unnecessarily can cause diarrhea and may be inappropriate for some people, particularly those with impaired kidney function.
If deficiency is suspected, it is better to discuss testing and supplementation with a healthcare professional.
## What About Potassium?