This article will discuss what causes foot cramps at night and how these cramps can be prevented.

Foot cramps at night occur when a muscle in the foot suddenly tightens and shortens, causing a painful sensation in the foot. Foot cramps at night are common, especially among older adults. Sometimes, foot cramps are painful enough to interfere with sleep.
Cramps can last from a few seconds up to 10 minutes. People may describe foot cramps as a spasm, tightening, twinge, or strain. Some people have residual soreness from foot cramps even after the cramp has occurred.
You may experience other symptoms along with foot cramps at night. These symptoms include:
- muscle weakness
- fatigue
- numbness or tingling
- a “pins and needles” sensation
- muscle twitching
- relief with walking or stretching
Foot cramps can be caused by a variety of factors. Some common causes include:
- tight muscles due to inactivity or lack of stretching
- dehydration
- medications, such as diuretics, steroids, or antidepressants
- pregnancy
- electrolyte imbalances, such as low levels of potassium or magnesium
- neurologic or metabolic disorders
- strenuous exercise
- long periods of standing
- alcohol usage
You should see your doctor if your foot cramps at night do not go away with exercise or lifestyle changes. In some cases, foot cramps can be a sign of an underlying disorder, such as circulation problems or nerve damage.
If you notice other concerning symptoms along with foot cramps, such as swelling of the feet or cramps that are getting worse or that last longer than 10 minutes, call your doctor.
Doctors diagnose the causes of foot cramps at night by taking a detailed medical history. Your doctor will ask you about:
- what the cramps feel like
- what medical conditions you have
- what medications or supplements you take
- what do you do for exercise and work
Knowing this information can help the doctor determine exactly what is causing the foot cramps, such as if it is exercise-induced or is associated with peripheral neuropathies.
If there is any underlying medical condition, your doctor will want to treat it to help eliminate your foot cramps.
Many times, foot cramps at night can be treated at home. The best thing you can do to treat foot cramps is to establish a daily stretching routine. This can help decrease the frequency of foot cramps. Stretching or massaging during a cramp can also help relieve pain.
Applying heat or cold to the area of the cramp can help relieve painful symptoms. You can also try taking a warm bath with Epsom salts, which helps ease muscle aches and contractions. Epsom salts contain magnesium, and increasing magnesium levels help relieve cramping.
Medications are not usually prescribed for foot cramps at night. It’s generally recommended to avoid NSAIDs, such as Motrin or Aspirin, to treat foot cramps.
However, some small studies indicate that certain medications, such as diltiazem, gabapentin, verapamil, and vitamin B12 complex, may be an option for some people with nightly foot cramps.
During pregnancy, check with your doctor about taking a magnesium supplement and a multivitamin to help with foot cramps.
The best thing you can do to prevent foot cramps at night is to stay well-hydrated and stretch daily. Other tips include:
- stretching before bed to loosen muscles and help reduce the frequency of nighttime foot cramps
- staying away from stimulants, such as caffeine, and not smoking
- massaging your feet before bedtime can also help keep the muscles loose
- including foods high in potassium, magnesium, and calcium in your diet to help with electrolyte balance
Foot cramps at night are common and are usually not a cause for concern. In some cases, foot cramps at night can be caused by certain medications or underlying medical conditions. Foot cramps can be painful and disrupt sleep.
The best thing to do during a foot cramp is to stretch and massage the area. Staying hydrated and stretching on a daily basis can help prevent foot cramps at night. Foot cramps at night are not typically treated with medication.
Read more details on foot cramps.