Overview
During a cramp, the muscle tightens on its own and doesn't relax. It may feel hard or bulging. The calf (back of the lower leg) and the back of the thigh are the most common spots. Many people get leg cramps at night.
Most cramps come from overusing a muscle, not drinking enough, or losing minerals through sweat. They're harmless and go away in a few minutes. Cramps that are very frequent, or come with weakness, swelling, or redness, may have another cause.
When to get medical care
Causes
Common causes include overusing a muscle during exercise, not drinking enough fluids, losing salt and minerals through heavy sweating, staying in one position for a long time, and pregnancy. Other causes include low potassium, magnesium, or calcium, medicines like water pills (diuretics) and statins, an underactive thyroid, kidney failure or dialysis, alcohol use disorder, poor blood flow to the legs, nerve problems like a pinched nerve in the back, and diabetes.
OwieClear has pages on 5 conditions that can cause muscle cramp or charley horse. Each shows how soon to get care.
Common causes
- Muscle crampsOften treated at home
A sudden, painful tightening of a muscle, often in the calf or foot, sometimes at night.
- McArdle disease (glycogen storage disease type V)See a doctor if it doesn't get better
An inherited muscle condition where muscles can't use stored sugar (glycogen).
- Underactive parathyroid (hypoparathyroidism)Often needs care today
The parathyroid glands make too little hormone, lowering calcium in the blood, often after neck surgery.
Less likely causes
- Blood clot in the leg (deep vein thrombosis)Often needs care today
A blood clot in a deep vein, usually in one leg.
- SIADH (too much water hormone)Often needs care today
A condition where the body makes too much antidiuretic hormone and holds on to water, which lowers blood sodium.
What you can do at home
- Stop what you're doing and gently stretch and massage the cramping muscle. For a calf cramp, pull your toes toward your knee.
- Use heat to relax a tight muscle when the cramp begins, and ice once the pain has eased.
- Drink plenty of fluids, and try a sports drink if you've been sweating a lot.
- Eat foods with potassium, like bananas and orange juice.
- Stretch before bed if you get cramps at night, and keep your sheets loose around your feet.
- Exercise within your ability and build up slowly.
Medicines
Ibuprofen (Advil, Motrin) or other NSAIDs can help with soreness after a cramp. There's no proven over-the-counter medicine to prevent cramps; quinine is no longer recommended because of serious side effects. If cramps are severe, a doctor may prescribe other medicines or check your medicines and mineral levels.
At the doctor
Most cramps don't need a doctor. If they're frequent or severe, the doctor will look for a cause.
Questions you may be asked
- When the cramps started and how long they last
- How often they happen and which muscles
- What you were doing, and whether they happen at night
- How much you drink and exercise
- Your medicines
- Whether you could be pregnant
The exam
A physical exam of the muscles, nerves, and circulation in your legs.
Tests
- Blood tests for potassium, calcium, magnesium, kidney function, and thyroid
- A pregnancy test
- Nerve and muscle tests (EMG) in some cases
Prevention
You can prevent many cramps.
- Stretch regularly, especially before exercise and bedtime
- Drink enough water before, during, and after exercise
- Increase activity gradually
- Eat a diet with plenty of potassium, calcium, and magnesium
Check your symptoms
Most symptoms have more than one possible cause. The symptom checker looks at all of your symptoms together, plus your age, and shows how soon to get care.
Sources
Last updated 2026-11-13.