How to Treat a Hamstring Cramp

Stretch the hamstring muscle as soon as you feel it cramp up.
Image Credit: Hero Images/Hero Images/GettyImages

Muscle cramps are a real pain in the, well, hamstring. Striking when you least expect it — even waking you in the middle of the night — hamstring cramps are a painful sensation that, while temporary, can leave lasting soreness. If you get them frequently, you may wonder how you can reduce the disruption in your daily life and get moving — or sleeping — again. A bit of stretching, massage, and hot and cold therapy should do the trick.



Most muscle cramps can be treated with stretching, massage, heat and ice.

Video of the Day

Muscle Cramp Relief

Muscle cramps treatment typically involves self-care measures, and there's not much to it. When a hamstring cramp strikes, try the following:

Video of the Day

Stretch: As soon as you feel the cramp, step forward with the foot of the affected leg out in front of you. Lift the toes of the foot and bend forward. Reach for your toes, and if you can reach them, gently pull them back toward your face. You can also try this stretch sitting on a chair or on the side of the bed.

You can also do a hamstring stretch seated on the floor with both legs extended. Simply reach for your toes. If you can grasp them, pull them gently toward your face; if you can't, just reach as far down your leg as you can.

In both stretches, keep the affected leg as straight as possible; bending the knee will make the stretch slightly less effective. You also want to be sure not to overstretch — that can make matters worse. Stretch until you feel a slight sensation and the cramp starts to dissipate; never stretch to the point of pain.


Massage: Once you've found a little relief through stretching, use your fingers to gently massage the hamstring muscle. Lightly knead your fingertips into the tissue where you feel the discomfort the most. This can help the muscle relax.

As with stretching, you want to be conservative with the pressure. Apply too much pressure and you'll only increase the discomfort.


Apply Heat: Applying a warm compress or heating pad, or taking a warm bath, can help further relax the hamstrings. Heat also improves blood flow to the hamstring, which could provide pain relief.

Use Ice: If residual muscle soreness sticks around, you can relieve it by applying ice. Use an ice pack or a bag of frozen vegetables and press it to the hamstring. Do not apply ice directly to the skin; wrap it in a towel. Keep the ice on the muscle for 10 to 20 minutes, then remove it for at least 20 minutes before applying it again.



If your muscle cramp is long-lasting, very painful and is not relieved by self-care, call your doctor.

Causes of Muscle Cramps

Muscle cramps may happen once or they may occur more frequently. If yours show up more often than you'd like, you may be able to do something about it. First, it helps to know what causes muscle cramps:


  • Reduced blood circulation to the legs, often caused by a narrowing of the arteries (atherosclerosis).
  • Compression in your spinal nerves. Typically the pain appears while walking and worsens the farther you walk.
  • Deficiencies of the electrolyte minerals potassium, calcium and magnesium, which are involved in aiding proper muscle contraction.


Other common causes of muscle cramps include:

  • Dehydration
  • Overexertion of hamstring muscles during exercise or other strenuous activity
  • Muscular fatigue from longer bouts of exercise or other activity
  • Tight muscles
  • Exercising or working outdoors in hot weather

Medications you take may also increase the risk of muscle cramps. A few of these include:


  • Diuretics
  • Asthma medications
  • Statins

Finally, certain populations are at increased risk of muscle cramps:

  • Pregnant women
  • Older adults
  • People with certain medical conditions such as diabetes and nerve, liver or thyroid disorders

Read more: Home Remedies to Get Rid of Leg Cramps


Preventing Muscle Cramps

If you know the cause of your hamstring cramps, you can take the proper steps to prevent them, or at least lessen their impact. Here are a few easy things you can do to find muscle cramp relief:

Treat mineral deficiencies: Visit your doctor to see if you have any mineral deficiencies. Taking diuretics can sometimes cause too many minerals to be removed from the body, or you may have trouble absorbing enough of the minerals. Your doctor can recommend adjustments to your diet, a mineral supplement or another course of treatment to get your levels where they should be and keep them there.


Stay hydrated: Especially if you're exercising or working in hot weather, replacing fluids is crucial for muscle cramp relief. Drink plenty of water before, during and after your activity. If you don't drink enough water in general, and you think that may be causing your cramps, follow the advice of the Mayo Clinic by increasing your daily fluid intake to 15.5 cups if you're a man and 11.5 cups if you're a woman.

Take breaks in hot weather: If you must exercise or work outdoors in the heat, take periodic breaks indoors or in the shade. This is a good time to replace lost fluids and electrolytes.

Move and stretch before bed: If you get nocturnal hamstring cramps, a little light activity, such as riding a stationary bike and stretching before bed, may prevent them, according to the Cleveland Clinic.

Prevent overexertion and fatigue: Shorten your exercise and activity sessions to prevent your muscles from becoming overly fatigued. Also, increase exercise intensity gradually to avoid overexerting the hamstring muscles.

Warm up and stretch: Warm up for five to 10 minutes before your workout to prime the muscles for more intense activity. Perform a few gentle hamstring stretches as part of your warmup, then stretch again after your workout. Make a habit of stretching your hamstring muscle throughout the day.

For all other causes of muscle cramps, a visit to your doctor may be in order. If your cramps are being caused by an underlying condition, such as atherosclerosis, your doctor can devise a treatment plan that may resolve or reduce your hamstring cramps. If a medication you're taking is causing your cramps, you and your doctor can decide whether the benefits and necessity of the medication outweigh the side effects.

Read more: Vitamins & Minerals for Leg Cramps




Is this an emergency? If you are experiencing serious medical symptoms, please see the National Library of Medicine’s list of signs you need emergency medical attention or call 911.