Most muscle twitching is harmless and stops on its own, but you can speed things along by addressing the usual triggers: poor sleep, dehydration, stress, and low electrolytes. Persistent twitching that lasts weeks or comes with muscle weakness is a different story, but the vast majority of twitches are benign fasciculations that respond well to simple lifestyle changes.
Why Your Muscles Twitch
A twitch happens when a small group of muscle fibers contracts involuntarily, usually because the nerve controlling them fires when it shouldn’t. This can be triggered by almost anything that makes your nervous system more excitable: caffeine, fatigue, emotional stress, or an electrolyte imbalance. The technical term is fasciculation, and most people experience it in the eyelids, calves, or thumbs.
Sleep deprivation is one of the most reliable triggers. When you don’t sleep enough, your brain increases the activity of excitatory chemical signals while dialing down the inhibitory ones that normally keep nerve firing in check. The result is a nervous system running hotter than usual, which makes spontaneous muscle twitches far more likely. Even one night of poor sleep can shift this balance.
Quick Relief for Active Twitching
There’s no instant off switch for a twitching muscle, but several techniques can interrupt the cycle. Gently stretch the affected area and hold for 15 to 30 seconds. If the twitch is in your calf, stand on the ball of your foot and slowly lower your heel. For eyelid twitches, try closing your eyes firmly for a few seconds, then relaxing them.
Massaging the muscle with your hands or a foam roller can also help by resetting the nerve signals in the area. Applying a warm compress increases blood flow and relaxes the tissue. Walking around for a minute or two works surprisingly well for leg twitches, since voluntary movement overrides the erratic nerve signals causing the involuntary ones. Ice can help too, particularly if the muscle feels sore from prolonged twitching.
Fix Your Electrolyte Balance
Electrolytes, particularly calcium, potassium, and sodium, regulate how your nerve and muscle cells fire. When levels drop too low, muscles become irritable and twitch more easily. Low calcium is the most common electrolyte cause of muscle irritability and can progress to sustained involuntary contractions called tetany. Low potassium disrupts normal nerve signaling to both skeletal and heart muscle cells.
What you drink matters as much as how much you drink. Research published in BMJ Open Sport & Exercise Medicine found that rehydrating with plain water after sweating actually made muscles more susceptible to cramping, because it diluted the remaining electrolytes in the blood. Drinking fluid that contained sodium, potassium, chloride, and glucose (similar to an oral rehydration solution) reversed that effect and made muscles more resistant to cramping. Sodium and chloride appeared to be the most important electrolytes for this protective effect.
In practical terms, if you’re twitching after exercise, heavy sweating, or a bout of illness with vomiting or diarrhea, reach for a drink with electrolytes rather than plain water. Sports drinks work, but oral rehydration solutions contain a more effective ratio of sodium to fluid. Foods rich in potassium (bananas, potatoes, spinach) and calcium (dairy, fortified plant milks, canned sardines) help maintain baseline levels day to day.
What About Magnesium?
Magnesium supplements are widely recommended online for twitching and cramping, but the evidence is weaker than most people expect. A Cochrane review found that magnesium supplementation is unlikely to provide meaningful relief for muscle cramps in older adults, and no controlled trials have evaluated it specifically for exercise-related or disease-related cramps. That doesn’t mean magnesium is useless. If you’re genuinely deficient (common in people who eat few nuts, seeds, and leafy greens), correcting the deficiency may help. But taking extra magnesium on top of adequate levels probably won’t stop your twitching.
Lifestyle Changes That Reduce Twitching
Because most benign twitching comes from an overstimulated nervous system, calming that system down is the most effective long-term fix.
- Sleep 7 to 9 hours consistently. Sleep restores the balance between excitatory and inhibitory brain chemicals. Even partial sleep deprivation shifts your nervous system toward hyperexcitability, so prioritizing sleep is one of the single most effective things you can do.
- Cut back on caffeine. Caffeine directly increases nerve excitability. If you’re twitching regularly, try reducing your intake by half for a week and see if it improves. Pay attention to hidden sources like tea, chocolate, and pre-workout supplements.
- Manage stress. Chronic stress keeps your body in a state of heightened arousal that promotes twitching. Regular physical activity, deep breathing, and even brief daily meditation can lower baseline nervous system activity.
- Stay consistently hydrated with electrolytes. Don’t wait until you’re thirsty. Sip throughout the day, and choose electrolyte-containing fluids during and after exercise.
- Limit alcohol. Alcohol disrupts sleep quality and acts as a diuretic, worsening both sleep deprivation and dehydration triggers simultaneously.
Most people who make two or three of these changes notice their twitching fades within a few days to a couple of weeks.
When Twitching Signals Something Serious
The fear most people have when they search “how to stop twitching” is that it could be a sign of a neurological disease like ALS. Here’s the reassurance: twitching alone, without other symptoms, is not a sign of ALS. The disease involves degeneration of motor neurons that produces a specific combination of muscle wasting, progressive weakness, and changes in reflexes alongside fasciculations. A twitching calf muscle in an otherwise healthy person is a completely different situation.
That said, see a doctor if your twitching is accompanied by muscle weakness that makes it harder to grip things, climb stairs, or do tasks you could do before. Visible muscle shrinking (atrophy), difficulty speaking or swallowing, or twitching that stays strictly in one body region and worsens over weeks also warrants evaluation. A neurologist can perform a straightforward exam to distinguish benign fasciculations from something that needs further workup.
Medical Options for Persistent Twitching
If you’ve addressed sleep, stress, caffeine, and electrolytes and the twitching persists for months, a doctor may consider medication. The options are generally reserved for cases where twitching is frequent enough to interfere with daily life or sleep. Medications that calm nerve activity, reduce muscle excitability, or address underlying spasticity are sometimes used. These tend to cause drowsiness and aren’t typically needed for ordinary fasciculations, so they’re a last resort rather than a first-line approach.
For most people, the twitching resolves well before medication becomes necessary. Benign fasciculation syndrome, a diagnosis of exclusion given when twitching is persistent but no underlying disease is found, often improves gradually over months as stress about the twitching itself decreases. Ironically, worrying about twitching tends to make it worse by keeping the nervous system in a heightened state.