Leg cramps are painful, involuntary muscle contractions that can last seconds or minutes. They affect your sleep, exercise routine and general quality of life. Some conditions and drugs can cause them, and there are risk factors you’ll want to avoid. When a cramp happens, try flexing the muscle, applying heat or ice and massaging the area.
Leg cramps are sudden, involuntary, intense muscle pains usually in your calf, foot or thigh. You might also know them as a “charley horse.” Sometimes, the cramp may cause your leg to spasm — to tighten uncontrollably. Although painful to live with, cramps in your legs are generally harmless.
Muscle cramps in your legs can last from several seconds to several minutes.
The older you are, the more likely you are to have leg cramps. This is because your tendons (the tissues that connect your muscles to your bones) naturally shorten as you age. Women and people assigned female at birth (AFAB) are also more likely to get them. Up to 60% of adults get leg cramps at night, as do up to 40% of children and teenagers.
Cleveland Clinic is a non-profit academic medical center. Advertising on our site helps support our mission. We do not endorse non-Cleveland Clinic products or services. Policy
Leg cramps at night happen when you’re not very active or when you’re asleep. They may wake you up, make it harder for you to fall back asleep and leave you feeling sore all night. Yearly, monthly, weekly, nightly — the frequency of leg cramps depends on the person.
Night leg cramps (nocturnal leg cramps) can happen to anyone at any age, but they happen most often to older adults. Of people over age 60, 33% will have a leg cramp at night at least once every two months. Nearly every adult age 50 and older will have them at least one time. Approximately 40% of people will experience leg cramps during pregnancy. Healthcare providers believe that’s because the extra weight of pregnancy strains your muscles.
About 3 out of 4 reported cases of leg cramps happen at night.
Unfortunately, leg cramps happen very suddenly. There aren’t any warning signs. But there are risk factors, like pregnancy and the use of medications that have leg cramps as a side effect. If you know you have certain risk factors, you can be on the alert for leg cramps and so you won’t be as startled when they happen.
A leg cramp feels like a clenched, contracted muscle tightened into a knot. It can be severely uncomfortable, painful or even unbearable. Your muscles in the area might hurt for hours after the cramp goes away.
Some leg cramps happen for no known reason. These are called “idiopathic” cramps. Possible causes of these leg cramps include:
Possible causes for leg cramps at night (nocturnal leg cramps) include:
Medications have side effects. A prescription you’re taking could be causing your leg cramps. In that case, work closely with your healthcare provider to determine the pros and cons of the medication vs. its side effects. Your provider may be able to put you on a different medication that doesn’t have leg cramps as a side effect.
Medicines that have leg cramps as a side effect include:
Cancer treatments like chemotherapy can cause nerve damage, which may also cause leg cramps.
Sometimes, leg cramps happen for no reason, but other times, they could be a sign or symptom of a health condition. “Secondary” leg cramps are a symptom or complication of a more serious health condition. If you have any of the following conditions, your leg cramps may be a result of that condition.
Also, keep in mind that if you don’t already know you have any of these conditions, your leg cramps may be a sign that you do. Always consult a healthcare provider if you think your leg cramps are a symptom of something serious.
Leg cramps can be a sign of serious conditions, including:
Your healthcare provider will need to know your medical history, medications and a description of what you’re experiencing. Be specific. Report your symptoms to your healthcare provider and include the following information:
There’s no specific test to diagnose leg cramps. But your provider will likely check your vital signs and do routine tests (like getting samples of your blood and urine). These can show if you have a medical condition you didn’t know about.
You want to get rid of a leg cramp the moment it strikes. You might be finishing up an exercise routine, or a cramp might wake you up in the middle of the night. In moments like that, unfortunately, there aren’t any magical injections that can instantly relieve your pain. However, there are eight steps to take to possibly get rid of a leg cramp:
Try this if your cramp is in your calf muscle: While standing (or sitting), straighten your leg and lift your foot until your toes are pointing at your shin. Pull on your toes if you’re able to reach them. You can also try walking around on your heels.
There aren’t any recommended medications that can prevent leg cramps 100% of the time. However, some prescription medications show a little evidence of preventing leg cramps. Under the direction of your healthcare provider, you might want to try the following:
No vitamin is likely to help with a leg cramp 100% of the time. But some experts do recommend that you take a vitamin B12 complex or magnesium for leg cramps.
Ideas for prevention include several activities you may want to do every day:
It’s not always possible to get rid of leg cramps forever. But these steps might lower your risk:
Try the following to prevent leg cramps in your calves:
Leg cramps don’t have a cure at this time. Fortunately, there are steps you can take to prevent and manage your leg cramps.
It depends on the person. Some people see improvement with prevention and treatment plans, while others struggle. Your cramps may feel worse and happen more often as you age.
Planning is key. Work with your healthcare provider to develop:
See a healthcare provider if your leg cramps are unbearably painful, happen frequently or last for a long time. Also, talk to your provider right away if you have any of the following symptoms in addition to leg cramps:
See a healthcare provider immediately if you’re concerned that your leg cramps are a symptom of an underlying serious medical condition.
Go to the emergency room if a leg cramp lasts longer than 10 minutes or becomes unbearably painful. Also, go if a leg cramp happens after you touch a substance that could be poisonous or infectious. For example, if you have a cut on your skin that touches dirt, you could get a bacterial infection like tetanus. Exposure to mercury, lead or other toxic substances should also be a reason to go to the emergency department.
Questions you may want to ask your provider include:
Although both nocturnal leg cramps (leg cramps at night) and restless legs syndrome tend to happen to you at night or when you’re at rest, restless legs syndrome doesn’t cause severe pain. Restless legs syndrome is uncomfortable, but not agonizing. It’s a crawling sensation that makes you want to move your legs. When you do move, the restlessness stops, but there’s still discomfort.
A note from Cleveland Clinic
Leg cramps can be unpredictable and agonizing. They can affect your sleep, your exercise routine and your general quality of life. They’re common, very normal and, fortunately, temporary. There are steps you can take to manage them. Do your best to avoid risk factors, avoid medications with leg cramps as a side effect and take recommended preventive measures.
If you’re concerned about the severity and duration of your leg cramps, or think a serious condition may be causing them, don’t hesitate to contact your healthcare provider. Ask questions and voice your concerns. You don’t have to “just live with” leg cramps.
Last reviewed by a Cleveland Clinic medical professional on 06/05/2023.
Learn more about our editorial process.