Night Leg Cramps: What Causes Them and How to Stop Them
By Rive News
Research desk | Rive News
Key takeaways
- Night leg cramps are sudden, painful muscle spasms, usually in the calf. They can last from a few seconds to 15 minutes, according to the Mayo Clinic.
- Most cramps have no clear cause, but dehydration, prolonged sitting, low electrolytes, certain medicines, and pregnancy are linked triggers.
- Stand and press weight into the foot, stretch the muscle, and massage it to stop a cramp. Bedtime calf stretches and steady hydration may help prevent them.
Nocturnal leg cramps are sudden muscle tightenings that you cannot control, and they strike while you sleep. They most often seize the calf, though the foot and thigh can cramp too.
The pain can be sharp enough to wake you, and the muscle may stay sore after the cramp releases. According to the Mayo Clinic, an episode can last from a few seconds to 15 minutes or more. The muscle often feels hard or knotted to the touch while the spasm lasts.
This article takes a closer look at night leg cramps, including what they are, their causes, how to stop a cramp when it happens, prevention, and outlook.

A calf stretch of the kind used to relieve and prevent night leg cramps. Photograph: Sgt. 1st Class Brian Scott/Wikimedia Commons
Image Credits: Wikimedia Commons
What are nocturnal leg cramps?
A nocturnal leg cramp, sometimes called a charley horse, is a brief involuntary tightening of one or more leg muscles during sleep. The calf is the most common site. The contraction arrives without warning and usually passes on its own, though soreness can linger into the next day.
Night leg cramps are not the same as restless legs syndrome. The Mayo Clinic explains that restless legs syndrome mostly causes an urge to move the legs when falling asleep, is usually not painful, and its symptoms last longer than a cramp does. Knowing the difference matters because the two problems are managed differently.
Causes
Most of the time, there is no known cause for night leg cramps. According to the Mayo Clinic, they are likely the result of tired muscles and nerve issues. That uncertainty is frustrating, but it also means an occasional cramp is rarely a sign of serious disease on its own.
Several factors are linked with cramps, even if they do not always explain them. The Mayo Clinic lists dehydration, prolonged sitting, muscle fatigue, and a lack of physical activity among the common causes. It also notes that low amounts of potassium, calcium, and magnesium in the diet may play a role.
Certain medicines are associated with night leg cramps as well. These include diuretics, beta blockers, birth control pills, and medicines used to treat blood pressure and high cholesterol.
The Mayo Clinic cautions that it is not known whether there is a direct link with urine-output medicines. Never stop a prescribed drug because of cramps. A doctor or pharmacist can review a medication list instead.
Risk also rises with age, and people who are pregnant are more likely to get night leg cramps. Health conditions sometimes linked with cramps include diabetes, thyroid disorders, chronic kidney disease, and peripheral artery disease. If cramps are the only symptom, though, those conditions are less likely suspects.
How to stop a cramp when it happens
When a cramp wakes you, act on the muscle right away. The Mayo Clinic recommends these steps, in order:
- Stand up and put your weight on the affected leg, then slightly bend the knee. This is the fastest way to force a calf cramp to release.
- If standing is too painful, straighten the leg and pull your toes back toward your head. This stretches the calf without bearing weight.
- Gently rub or massage the cramped muscle until it relaxes.
- Apply cold or heat. An ice pack or cold compress may cut the pain, while a warm towel, heating pad, or hot shower can ease the lingering soreness.
Each step works by getting the muscle to lengthen and relax. Stretching pulls the fibers out of their locked contraction, and massage plus temperature changes encourage the muscle to let go. Most cramps settle within a minute or two once treated.

Staying hydrated through the day may help muscles contract and relax normally. Photograph: Debske/Wikimedia Commons
Image Credits: Wikimedia Commons
Prevention
There is no guaranteed cure, but small bedtime habits can lower the odds of being woken by a cramp. The Mayo Clinic Health Letter suggests the following:
- Stay hydrated. Drinking plenty of fluids through the day helps muscles contract and relax more easily. Replenishing fluids matters most after exercise.
- Stretch before bed. A few minutes of calf stretching each night is the most widely recommended prevention step.
- Do light exercise. Riding a stationary bike for a few minutes before bed may help prevent cramps during sleep.
- Choose supportive shoes. Wearing shoes with proper support during the day reduces strain on the calf muscles.
- Untuck the covers. Loosening sheets and blankets at the foot of the bed may reduce cramps caused by sleeping with the toes pointed.
Some people try magnesium or other supplements for cramps. Evidence for supplements is limited, and NHS guidance notes that magnesium has limited evidence for this purpose. It is worth discussing any supplement with a clinician first, since doses can interact with medicines.

Regular calf stretching is the most widely recommended prevention step for night leg cramps. Photograph: Shixart1985/Wikimedia Commons
Image Credits: Wikimedia Commons
Frequently asked questions
Are night leg cramps the same as restless legs syndrome?
No. A night leg cramp is a painful, sudden tightening of a muscle that usually passes within minutes. Restless legs syndrome causes an uncomfortable urge to move the legs when falling asleep, is usually not painful, and the sensations last longer, according to the Mayo Clinic.
What deficiency causes leg cramps at night?
Low levels of certain minerals, called electrolytes, may be linked with leg cramps. WebMD lists sodium, potassium, calcium, and magnesium among them. Eating potassium-rich foods such as bananas may help if potassium is low, though a blood test and a clinician's advice are the reliable way to know.
Does drinking water help stop night leg cramps?
Drinking water may help prevent them, because dehydration is listed as a common cause of cramps by the Mayo Clinic. Staying hydrated through the day is a low-cost habit with no downside. Water alone will not fix every cramp, since many have no clear cause.
When should I worry about a leg cramp at night?
Most cramps are harmless. But the NHS advises getting medical advice if a cramp lasts longer than 10 minutes and does not improve.
Also seek care if cramps are severe, frequent, disturb your sleep most nights, or come with swelling, warmth, redness, or weakness in one leg. Those added signs can point to other problems, such as a blood clot, that need prompt attention.
Outlook
For most people, night leg cramps are an occasional nuisance rather than a medical problem. They pass quickly, respond to stretching and massage, and become less frequent with steady hydration, bedtime stretches, and light evening movement.
It's a good idea to see a doctor if your cramps are severe, happen most nights, keep disrupting your sleep, or do not improve with stretching and hydration. Also talk to a clinician if cramps come with muscle weakness, swelling, redness, or warmth in one leg, or if you suspect a medicine is causing them. Bring a list of your medicines to that visit.
This article is general information, not medical advice. For persistent or worrying symptoms, consult a qualified clinician.
Rive News's research desk covers practical health topics with cited medical sources. This article is general information, not medical advice.
Latest in Health
- eSIM: What It Is, How It Works, and How Travelers Use It
- High-Yield Savings Accounts: What They Are and How They Work
- How to Reduce Humidity in a Room Without a Dehumidifier
- Why the Sky Turns Orange at Sunrise and Sunset
Subscribe for practical health explainers like this one, delivered weekly.
---
© 2026 Rive News. Corrections: contact the research desk. Rive News publishes clearly sourced explainers and updates them when facts change.


