Cookies on this website

We use cookies on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the NHS Direct Wales website. However, if you would like to, you can change your cookie settings at any time.


Leg cramps, unknown cause


Leg cramps, unknown cause

Leg cramps are a common, usually harmless condition where the muscles in your leg suddenly become tight and painful. Leg cramps usually occur in the calf muscles although they can affect any part of the leg including your feet and thighs.

After the cramping has passed, you may have pain and tenderness in your leg for several hours.

In three out of four cases, leg cramps occur at night during sleep.

Read more about the symptoms of leg cramps

What causes leg cramps?

Leg cramps can occur for no apparent reason, known as idiopathic leg cramps, or as a symptom or complication of a health condition, known as secondary leg cramps.

Causes of secondary leg cramps include:

  • pregnancy
  • exercise
  • certain types of medication, such as statins (medicines that help lower cholesterol levels)
  • liver disease

A leg cramp occurs when your muscles suddenly shorten (contract), causing pain in your leg. This is called a spasm, and you cannot control the affected muscle.

The cramp can last from a few seconds to 10 minutes. When the spasm passes, you will be able to control the affected muscle again.

See Leg cramps – causes for more information about the possible causes of secondary leg cramps.

When to see your GP

Speak to your GP if your leg cramps are affecting your quality of life; for example, if you have frequent leg cramps or they are interfering with your sleep.

Your GP will ask about your symptoms and examine your legs and feet. They may also ask if you have other symptoms, such as numbness or swelling, which may be a sign that you have secondary leg cramps caused by an underlying condition.

In this case, you may need further tests, such as blood tests and urine tests, to rule out other conditions.

Treating leg cramps 

Most cases of leg cramps can be relieved by exercising the affected muscles.  Exercising your legs during the day will often help reduce how often you get cramping episodes.


To stretch your calf muscles, stand with the front half of your feet on a step, with your heels hanging off the edge. Slowly lower your heels so that they are below the level of the step. Hold for a few seconds before lifting your heels back up to the starting position. Repeat a number of times.

Medication is usually only required for the most persistent cases of cramping that do not respond to exercise.

If you have secondary leg cramps, treating the underlying cause may help relieve your symptoms. Leg cramps that occur during pregnancy should pass after the baby is born.

Leg cramps that occur during a serious case of liver disease can be harder to treat.  Your treatment plan may include using medications such as muscle relaxants.

For more information see Leg cramps – treatment.

Preventing leg cramps

If you often get leg cramps, regularly stretching the muscles in your lower legs may help prevent the cramps or reduce their frequency.

You might find it useful to stretch your calves before you go to bed each night (see stretching advice above).

The following night-time advice may also help:

  • If you lie on your back, make sure that your toes point upwards – placing a pillow on its side at the end of your bed, with the soles of your feet propped up against it may help keep your feet in the right position.
  • If you lie on your front, hang your feet over the end of the bed – this will keep your feet in a relaxed position and help stop the muscles in your calves from contracting and tensing.
  • Keep your sheets and blankets loose.


^^ Back to top


A leg cramp is an episode of sudden pain in the leg muscles due to an involuntary contracting (shortening) of the leg muscle.

Most leg cramps occur in the calf muscles and, less commonly, in the feet and thighs. Cramps can last from a few seconds up to 10 minutes. Cramps that occur in the thigh muscles tend to last the longest.

During an episode of cramping, the affected muscles will become tight and painful, while the feet and toes become stiff.

 After the cramps have passed, you may feel tenderness and pain in your legs for several hours.

When to seek medical advice

If you only get leg cramps occasionally, it is not a cause for concern and a medical diagnosis is not required.

A visit to your GP will only be necessary if you get leg cramps frequently, or if they are so painful they disrupt your sleep and you are unable to function normally the next day.

You should also visit your GP if the muscles in your legs are shrinking or becoming weaker.

When to seek immediate medical advice

There are two situations where leg cramps may be a sign of a more serious underlying health condition.

You should seek immediate medical help if:

  • the cramps last longer than 10 minutes and fail to improve, despite exercise
  • cramps develop after you come into contact with a substance that could be toxic (poisonous) or infectious – for example, getting a cut that is contaminated with soil (which can sometimes cause a bacterial infection, such as tetanus) or being exposed to elements such as mercury or lead

In these circumstances, telephone your GP for advice immediately. If this is not possible, then telephone NHS Direct Wales on 0845 4647 or contact your local out-of-hours service.

^^ Back to top


The cause of leg cramps is sometimes unknown (idiopathic). In other cases, there may be an underlying condition or another identifiable cause.

Idiopathic leg cramps

Although the cause of idiopathic leg cramps is unknown, there are a number of theories about what might cause idiopathic leg cramps. These include:

  • abnormal nerve activity during sleep which causes the muscle of the leg to cramp
  • excessive strain placed on leg muscles, such as when exercising, may cause the muscles to cramp at certain times
  • a sudden restriction in blood supply to the affected muscles

Also, tendons naturally shorten over time as we grow older which may explain why older people are particularly affected by leg cramps. Tendons are tough bands of tissue that connect muscles to bone. If your tendons become too short, they may cause the muscles connected to them to cramp.

Secondary leg cramps

Secondary leg cramps are caused by an underlying condition or another identifiable cause. These include:

  • pregnancy – the extra weight of pregnancy can place strain on the leg muscles, making them more vulnerable to cramping
  • exercise – leg cramps are often experienced when resting after exercise
  • neurological conditions (conditions that affect the nerves in your leg muscles) – for example, motor neurone disease or peripheral neuropathy
  • liver disease – if your liver stops working properly, toxins inside the blood can build up, which can make your muscles go into spasm
  • infection – some type of bacterial infection, such as tetanus, can cause muscle cramps and spasm
  • toxins – high levels of toxic (poisonous) substances in the blood, such as lead or mercury, can cause leg cramps
  • dehydration – in some people, low levels of water in the body can leads to a drop in your salt levels, which can trigger muscle cramps


Certain medications have been known to cause leg cramps in a small number of people. These include:

If you are concerned that your medication may be causing your leg cramps, contact your GP as your dosage may need to be adjusted. Never stop taking a prescribed medication unless advised to do so by your GP or another qualified healthcare professional who is responsible for your care.

^^ Back to top


If the cause of your leg cramps is known, it may be possible to treat the underlying cause.

For example, secondary leg cramps that are related to liver disease are caused by high levels of toxins in the blood which trigger muscles spasms. Therefore, muscle relaxants can be used to help prevent your muscles from going into spasm.

If the cause of your legs cramps is unknown (primary idiopathic leg cramps), a combination of exercise and painkilling medication is usually recommended.


Most cases of leg cramps can be treated with exercises. There are two types of exercise that you can do:

  • an exercise that you carry out during an episode of cramping to relieve the pain and end the cramping
  • exercises that you do during the day to reduce how often you get leg cramps

The two types of exercises are explained below.

Exercises during cramps

If you get a leg cramp, stretch and massage the affected muscle. For example, if the cramp is in your calf muscle:

  • straighten your leg and lift your foot upwards, bending it at the ankle so that your toes are lifted towards your shin
  • try walking around on your heels for a few minutes

Exercises to prevent cramps

To reduce your chance of having leg cramps in the future, do exercises to stretch the affected muscles three times a day.

For example, if your calf muscles are affected by cramps, then the following exercise should be beneficial:

  • stand one meter (3ft 3inches) away from a wall
  • lean forward with your arms outstretched to touch the wall while keeping the soles of your feet flat on the floor
  • hold this position for five seconds, then release
  • repeat the exercise for five minutes

For the best results, you should repeat this exercise three times a day, including one session just before you go to bed.

If you find these exercises useful then carry on doing them for as long as you are able to.


If you have leg pain that persists after an episode of cramping, an over-the-counter painkiller such as paracetamol or ibuprofen may help reduce any pain.


Quinine is a medication that was originally designed to treat malaria. Research has since found that it can be moderately effective in reducing the frequency of leg cramps.

However, there is a small chance that quinine may cause unpleasant side effects, such as:

  • tinnitus (ringing in your ears)
  • impaired hearing
  • headache
  • nausea (feeling sick)
  • disturbed vision
  • confusion
  • hot flushes

A more serious and rare complication of quinine is thrombocytopenia, when your level of platelets (a type of blood cell) drops to a dangerously low level. Platelets help the blood to clot, so people with  thrombocytopenia are prone to excessive bleeding, such as:

  • nose bleeds
  • bleeding gums
  • bleeding inside the eye
  • bleeding inside the skull or digestive system – both of which can be fatal

There have been a number of reported cases of people dying from thrombocytopenia after taking quinine to prevent leg cramps.

Never take more than your recommended dose of quinine. An overdose of quinine can result in permanent blindness and death.

Because of these potential risks, however small, your GP will only prescribe quinine if there is evidence that the potential benefit of treatment outweighs the risks.

It is recommended that quinine is only prescribed when:

  • you have tried the exercise techniques discussed above and they have not helped to prevent leg cramps
  • the leg cramps are frequent and affecting your quality of life

If this is the case, you may be prescribed a four-week course of quinine. If you gain no benefit, the treatment will be withdrawn.

If you have any of the side effects listed above, stop taking quinine immediately and contact your GP.

^^ Back to top

Selected links

NHS Direct Wales links

Sprains and strains

External links

MHRA: recommendations for quinine use

^^ Back to top

The information on this page has been adapted by NHS Wales from original content supplied by NHS Choices.
Last Updated: 24/04/2015 16:44:04

Please leave your rating

Thank you for your rating
Average Rating
based on 52 ratings

7 ratings
6 ratings
7 ratings
14 ratings
18 ratings
Please leave your rating

Average Rating
based on 52 ratings
7 ratings
6 ratings
7 ratings
14 ratings
18 ratings
| Share
1000 Lives Campaign health challenge wales Twf change for life stonewall