Foot cramps are often caused by dehydration, low electrolytes, tight shoes, or nerve problems.
Common causes
- Dehydration and low magnesium, potassium or calcium.
- Overuse, standing for long periods or tight shoes.
- Nerve compression or peripheral neuropathy.
- Diabetes, thyroid disease or poor circulation.
- Medicines such as diuretics and statins.
What helps now
- Stretch the foot and flex the toes up.
- Massage and apply warmth.
- Walk on the area.
Prevention
Drink water, stretch before bed and wear supportive shoes.
See a doctor
If cramps are frequent, severe, or come with swelling, weakness or numbness.
Causes tied to muscles and body state

- Dehydration and electrolyte imbalance (low potassium, magnesium or calcium).
- Muscle fatigue after exercise or long standing.
- Sitting or lying in awkward positions.
- Tight shoes or high heels.
- Cold temperatures.
Medical causes
- Peripheral artery disease, where reduced blood flow causes cramping on walking.
- Diabetes and nerve damage.
- Thyroid problems.
- Kidney disease.
- Pregnancy.
- Medications such as statins, diuretics and some asthma drugs.
Nocturnal leg and foot cramps
These happen mostly in older adults and pregnant women. They can last seconds to 10 minutes, and the muscle can feel sore afterwards.
Immediate relief

- Stretch the muscle by pulling your toes toward the shin.
- Stand and put weight on the foot.
- Massage the muscle.
- Apply heat for tight muscles or cold for soreness.
Prevention
- Drink enough fluids.
- Stretch calves and feet before bed and after exercise.
- Wear supportive shoes.
- Eat foods with potassium, magnesium and calcium, such as bananas, leafy greens, yogurt and nuts.
- Strengthen foot muscles with exercises such as toe curls.
Evidence on magnesium
Studies on magnesium for cramps give mixed results. Ask a doctor before taking supplements, especially with kidney disease.
See a doctor if
Cramps are frequent, severe or accompanied by swelling, redness, weakness, skin changes or pain during walking that goes away with rest.
Why night cramps happen
Foot and leg cramps at night affect many adults, and about 33 percent of people over 60 have them at least twice a week, according to some studies. Typical causes include muscle fatigue, dehydration, prolonged sitting or standing, tight shoes, pregnancy, and electrolyte shifts. Medicines such as diuretics, statins and some asthma drugs can contribute. Medical conditions linked to cramps include diabetes, nerve compression, kidney disease, thyroid disorders and peripheral artery disease. Alcohol and exercise in heat can add risk.

Relief and evidence
During a cramp, gently stretch and massage the muscle, flex the foot upward toward the shin, walk around and apply heat. Stretching the calves for a few minutes before bed may help prevent night cramps. A 2020 Cochrane review found magnesium supplements are unlikely to provide clinically meaningful cramp prevention in older adults, though results in pregnancy are less clear. Stay hydrated and wear supportive shoes. See a doctor if cramps are frequent, severe, last longer than a few minutes, come with swelling, redness or weakness, or if one leg is painful and swollen, which may be a blood clot.
Based on data from the Cochrane Library and the Mayo Clinic







