Nighttime leg cramps are sudden, painful muscle contractions—most often in the calf, but sometimes in the foot or thigh—that occur during sleep or while resting. They can last from a few seconds to several minutes.
Why do nighttime leg cramps happen?
In many cases, the exact cause isn’t known, but several factors can increase the risk:
- Muscle fatigue from exercise or prolonged standing
- Dehydration
- Long periods of sitting or lying in one position
- Pregnancy, especially later in pregnancy
- Older age, as cramps become more common over time
- Certain medical conditions, such as diabetes mellitus, peripheral artery disease, or kidney disease
- Some medications, such as certain diuretics (“water pills”), may contribute in some people
Although low levels of minerals like magnesium or potassium are often blamed, they are not the cause in most people with nighttime leg cramps.
How to stop a cramp when it happens
- Gently stretch the affected muscle. For a calf cramp, straighten your leg and pull your toes toward your shin.
- Massage the muscle.
- Walk around if you can.
- Apply heat with a warm towel or heating pad to help the muscle relax. Some people find an ice pack helpful afterward if the muscle remains sore.
How to help prevent cramps
- Stretch your calf and hamstring muscles before bed.
- Stay well hydrated throughout the day.
- Increase exercise gradually to avoid overworking muscles.
- Wear supportive footwear if you spend long periods standing.
- If your cramps started after beginning a new medication, ask your healthcare provider whether it could be contributing. Don’t stop a prescribed medicine without medical advice.
When to see a doctor
Make an appointment if your cramps:
- Happen frequently or severely disrupt your sleep.
- Are accompanied by muscle weakness, numbness, or swelling.
- Occur along with changes in skin color or temperature.
- Don’t improve with stretching and other self-care measures.
Bottom line
Most nighttime leg cramps are not a sign of a serious illness and can often be managed with stretching, hydration, and addressing contributing factors. However, frequent or severe cramps deserve a medical evaluation to look for an underlying cause and discuss the best treatment.
