Suffering from leg cramps? Also known as a persistent, involuntary muscle contraction, leg cramps can be caused by a variety of different factors, including dehydration, a lack of stretching, a lack of electrolytes, and more.[1] Thankfully, it’s easy to stop muscle cramps on your own. Keep reading for plenty of medically-supported advice to help get rid of leg pain in the moment, as well as some tips to help prevent leg cramps in the future.

1

Stretch the cramped leg muscle.

  1. If your calf muscle suddenly cramps up, stand with your hands flat against an empty section of a wall. Step forward when your non-cramped leg, bending your knee while keeping your foot completely flat. Then, anchor the heel of your back, cramped leg onto the ground. Angle the toes of your back foot so they’re pointing toward the heel of your front foot, and stay in that position for up to 30 seconds.[2] Here are a few other stretches you can try, depending on where the leg cramp is:
    • Quad/Thigh Stretch: Stand in front of a chair or other sturdy surface, so you can lean on it for balance. Then, kick your cramped leg back so you can grab your ankle. Gently bring your ankle closer to your butt until you feel a nice stretch in your cramped quad.
    • Hamstring Stretch: Sit on the floor with your legs together and pointed straight out in front of you. Then, place your palms flat on the ground next to each leg. Slowly glide your palms in the direction of your feet, hinging your hips as you go. Keep sliding your hands forward until you experience a nice stretch in your cramped hamstring muscle.
    • Try stretching before bed, too! Research shows that pre-bed stretches can help prevent overnight leg cramps.[3]
    Advertisement
2

Massage the affected muscle.

  1. [4] Gently knead your fingers into the cramped portion of the muscle and see if that eases the pain any.[5] You can also guide a small foam roller up and down the affected muscle to help soothe away the discomfort.[6]
    • You can find foam rollers online, or at big-box retail stores. Some foam rollers cost as little as $20, while others are at least $30-$35.
5

Soothe sore muscles with an ice pack.

6

Take some painkillers.

  1. Reach for a bottle of over-the-counter pain meds, like acetaminophen (Tylenol), ibuprofen (Advil), or naproxen (Aleve). Always follow the recommended dosage instructions on the bottle, and never take more than the recommended amount in a given day.[12] Here are some adult dosage guidelines:
    • Acetaminophen: Take up to 1000 mg per pose, with a maximum of 4000 mg per day.[13]
    • Ibuprofen: Take up to 800 mg per pose, with a maximum of 3200 mg per day.[14]
    • Naproxen: Take 550 mg during your first dose, with a follow-up dose of 275 mg once every 6-8 hours. If you don’t feel like taking a follow-up dose, wait another 12 hours before taking another 550 mg dose.[15]
9

Wear comfortable, supportive shoes.

  1. When shopping for new shoes, walk around in each pair to make sure that they feel good and support your feet well. Make sure that your current shoes are still comfortable and supportive, too.[18]
    • Sneakers are always a great, supportive shoe option if you’re usually on the go. Wedge heels are a nice, comfy option if you’re on the market for some formal footwear.[19]
    Advertisement
10

Stand up once every 30 minutes.

  1. [20] If you typically sit for long chunks of time, set a timer for yourself so you remember to stand up and walk around once every 30 minutes. You can even look for other opportunities to stand instead of sit, like:[21]
    • Switching to a standing desk at work
    • Standing up to watch your favorite TV show
    • Taking your phone calls standing up instead of sitting down
11

Drink plenty of water.

  1. Make sure that you’re drinking plenty of fluids throughout the day–this improves your muscle function, which helps prevent cramps.[22] Always drink lots of water during and after a workout, too, since you’ll be losing fluids as you exercise.[23]
    • Health experts suggest that women consume 11.5 cups (2.7 L) of fluids per day, and men consume 15.5 cups (3.7 L).[24]
    • Water alone may not be enough during heavy exercise.[25] In this case, your body is depleting electrolytes, which causes muscle cramps.[26]
    Advertisement

Expert Q&A

Search
Add New Question
  • Question
    How can I prevent leg cramps?
    Peter Fryer
    Peter Fryer
    Sports Coach
    Peter Fryer is a Tennis Instructor based in Derry, Northern Ireland. He works as both a tennis writer and a coach. He completed his professional tennis teaching qualification shortly after finishing university and has been teaching the sport for over 13 years. Peter began the Love Tennis Blog in 2010, and is a contributing writer for the BBC and a variety of other national media outlets.
    Peter Fryer
    Sports Coach
    Expert Answer
    Remember to drink electrolyte drinks during vigorous exercise so that you are not losing salt in your sweat. Bring an electrolyte drink rather than just water. This will ensure that the salt lost through water is replenished, which reduces your chances of getting leg cramps.
  • Question
    How can I loosen tight muscles in my legs?
    Peter Fryer
    Peter Fryer
    Sports Coach
    Peter Fryer is a Tennis Instructor based in Derry, Northern Ireland. He works as both a tennis writer and a coach. He completed his professional tennis teaching qualification shortly after finishing university and has been teaching the sport for over 13 years. Peter began the Love Tennis Blog in 2010, and is a contributing writer for the BBC and a variety of other national media outlets.
    Peter Fryer
    Sports Coach
    Expert Answer
    If you suffer from leg cramps, my advice would be to keep moving and try your best to stay loose. A muscle rub can help relax the leg muscles but it won't get rid of the problem. Once you sit down, you begin to tighten up. Try to keep moving to prevent seizing up. Muscle vibration massagers are also very effective at loosening up tight muscles.
  • Question
    How can you relieve stiff muscles?
    Shira Tsvi
    Shira Tsvi
    Personal Trainer & Fitness Instructor
    Shira Tsvi is a Personal Trainer and Fitness Instructor with over 7 years of personal training experience and over 2 years leading a group training department. Shira is certified by the National College of Exercise Professionals and the Orde Wingate Institute for Physical Education and Sports in Israel. Her practice is based in the San Francisco Bay Area.
    Shira Tsvi
    Personal Trainer & Fitness Instructor
    Expert Answer
    In general, stretching and foam rolling can provide relief. Though many people may think stretching is an optional part of their workout routine, it is very important and should be considered mandatory.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit

Advertisement

Tips

  • Always stretch before and after your workouts to prevent cramps.[29]
  • Certain medicines may boost your chances of getting leg cramps, like nifedipine, tolcapone, donepezil, furosemide, and statin drugs.[30]
  • If you’re currently pregnant, a magnesium supplement may help reduce your leg cramps. Make an appointment with your doctor and see what they recommend.[31]
Advertisement

Warnings

  • The medication quinine used to be a common remedy for leg cramps, but medical professionals don’t recommend it anymore. Unfortunately, it can have extreme and deadly side effects, like dysphoria, vomiting, hypoglycemia (low blood sugar), hypotension (low blood pressure), and arrhythmias (irregular heartbeat).[32]
Advertisement
  1. https://orthoinfo.aaos.org/en/diseases--conditions/muscle-cramps
  2. https://www.beaumont.org/health-wellness/blogs/when-to-use-ice-and-when-to-use-heat-for-aches-and-pains
  3. https://myhealth.alberta.ca/Health/aftercareinformation/pages/conditions.aspx?hwid=abs1415
  4. https://www.drugs.com/acetaminophen.html#dosage
  5. https://www.drugs.com/ibuprofen.html#dosage
  6. https://www.drugs.com/dosage/naproxen.html#Usual_Adult_Dose_for_Pain
  7. https://sleepeducation.org/sleep-disorders/sleep-leg-cramps/
  8. https://health.clevelandclinic.org/how-to-prevent-leg-cramps-and-treat-them-at-home/
  9. https://newsnetwork.mayoclinic.org/discussion/steps-can-be-taken-to-relieve-or-prevent-night-leg-cramps/
  10. https://www.piedmont.org/living-better/the-best-and-worst-shoes-for-your-feet
  11. https://my.clevelandclinic.org/health/diseases/15466-muscle-spasms
  12. https://www.mayoclinic.org/healthy-lifestyle/adult-health/expert-answers/sitting/faq-20058005
  13. https://newsnetwork.mayoclinic.org/discussion/steps-can-be-taken-to-relieve-or-prevent-night-leg-cramps/
  14. https://orthoinfo.aaos.org/en/diseases--conditions/muscle-cramps
  15. https://www.mayoclinic.org/healthy-lifestyle/nutrition-and-healthy-eating/in-depth/water/art-20044256
  16. Peter Fryer. Tennis Coach. Expert Interview
  17. http://www.nlm.nih.gov/medlineplus/ency/article/003193.htm
  18. https://orthoinfo.aaos.org/en/diseases--conditions/muscle-cramps
  19. https://orthoinfo.aaos.org/en/diseases--conditions/muscle-cramps
  20. https://medlineplus.gov/musclecramps.html
  21. https://muschealth.org/medical-services/geriatrics-and-aging/healthy-aging/cramps-and-spasms
  22. https://www.pregnancybirthbaby.org.au/leg-cramps-during-pregnancy
  23. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4347765/

About this article

Peter Fryer
Co-authored by:
Sports Coach
This article was co-authored by Peter Fryer and by wikiHow staff writer, Janice Tieperman. Peter Fryer is a Tennis Instructor based in Derry, Northern Ireland. He works as both a tennis writer and a coach. He completed his professional tennis teaching qualification shortly after finishing university and has been teaching the sport for over 13 years. Peter began the Love Tennis Blog in 2010, and is a contributing writer for the BBC and a variety of other national media outlets. This article has been viewed 904,324 times.
14 votes - 67%
Co-authors: 19
Updated: October 7, 2025
Views: 904,324
Article SummaryX

To get rid of leg cramps, stretch your leg muscles and try to hold the stretch for a minute or until the cramps go away. You can also massage the parts of your legs that are cramping, which will help relax the muscles. If that doesn't help, try applying heat to your leg muscles using a warm towel or heating pad or by taking a warm bath. Finally, try applying an ice pack to your leg muscles to alleviate pain and stop the cramping. To learn more from our Personal Trainer co-author, such as how to use heat treatments or when to see a doctor, keep reading!

Did this summary help you?

Thanks to all authors for creating a page that has been read 904,324 times.

Reader Success Stories

  • Christina Montez

    Christina Montez

    Jun 12, 2017

    "I was unaware that my sudden leg cramps were associated with my pregnancy. I was in much pain & even brought to..." more

Did this article help you?

Advertisement