How to Fix Nighttime Leg Cramping and Pain

Jennifer Purdie
by Jennifer Purdie
Share it:
How to Fix Nighttime Leg Cramping and Pain

The scenario is all too familiar: You lie down for a night’s sleep and the pain comes. Your knee starts to hurt and the leg cramps come on strong. You feel OK during the day, but the pain keeps you awake at night. For those who work out often, the cause of nighttime leg cramping and knee pain hinges on hydration.

“The most common reason for leg cramps and knee pain that occur, especially at night, is because the athlete is dehydrated,” says Jason Piken, DC. “Hydration does not simply mean water but also electrolytes.”

Often the culprits involve not replenishing sodium and magnesium. Another factor leading to nighttime pain is a decrease in blood flow: “Cramps and pain often come at night because we are now resting,” says Lisa Alemi, a physical therapist. “Our body is quiet.” Also, a hydrochloric acid shortage can cause your body to improperly digest food and discourage calcium absorption. A side effect of this is night cramps, says Eugene Charles, DC, director of The Applied Kinesiology Center of New York.

Finally joint inflammation from muscle overuse can make the knee become achy. “When athletes overexert themselves in the day with heavy training and do not allow time and space for recovery, inflammation can build up,” says Jessica Tranchina, a certified physical therapist and co-founder of Generator Athlete Lab. At night, the muscles around the knee begin to relax and without these muscles to support it, the “knee joint space narrows, causing compression on cartilage tissue and other joint structures.”


You can help relieve the cramping and knee irritation through quick fixes and by staying proactive with your hydration intake. Start with a few of the following expert recommendations:

Near-term fixes:

  • Bring your knees to your chest and hold for 30 seconds. This “will greatly help with the cramps that come from this nerve entrapment,” says Charles.
  • Use heat or ice on sore areas. Aleimi says you can choose either one — whatever helps you feel better.
  • Wear graduated compression socks at night, addsTranchina.
  • Stay mindful of your sleeping position. “If you sleep on your back, it may be beneficial to try sleeping with a pillow or a small bolster under your knees to keep them slightly bent,” says Adria Biasi, A physical therapist. For those who sleep on their side, Biasi advises placing a pillow between your knees to improve hip alignment.
  • Take ice baths after workouts. This activity “helps decrease inflammation throughout your body,” says Tranchina. At night, she recommends taking a warm bath to help relax muscles.

Long-term fixes:

  • Take magnesium on a regular basis like with an Epsom salt bath. “Magnesium will be most effective taken transdermally, or through your skin,” says Lauren Lobert, DPT, owner of APEX Physical Therapy. You can do this with magnesium oil by “rubbing it on the bottom of your feet or putting some in warm water.”
  • Drink apple cider vinegar on an empty stomach. “Make sure you brush your teeth afterward,“ says Charles.
  • Hydrate. Tranchina endorses drinking at least half your body weight in ounces and drink an additional 1–2 liters, depending on how active you were that day.
  • Salt your water. Lobert recommends adding 1/8 teaspoon per eight ounces of water. But don’t worry, “this won’t make your water taste salty or cause you to feel puffy,” she says. “This will allow your body to retain and utilize the water.” This will also help you if you’re someone who constantly runs to the bathroom. This is a sign you are actually dehydrated, “as the water is going right through you,” she says.
  • Build strength in your legs. Lobert says you should do single-leg exercises such as high stepups, the single-leg press, single-leg knee extension and hamstring curl machines and retro/back lunges.
  • Foam roll and stretch. “Thorough and regular stretching and foam rolling can help with your symptoms as you get stronger,” says Lobert.

About the Author

Jennifer Purdie
Jennifer Purdie
Jennifer is a Southern California-based freelance writer who covers topics such as health, fitness, lifestyle and travel for both national and regional publications. She runs marathons across the world and is an Ironman finisher. She is also a certified personal trainer through the National Academy of Sports Medicine. You can follow her on Twitter @jenpurdie.


Never Miss a Post!

Turn on MyFitnessPal desktop notifications and stay up to date on the latest health and fitness advice.


Click the 'Allow' Button Above


You're all set.